Skip to main content

Composer

Interfaces

ComposerProps

Extends

  • Omit<DialogProps, "defaultValue" | "scroll">

Properties

PropertyTypeDescriptionOverrides
EditorProps?Omit <EditorProps, "onFocus">Editor props

Default
{}
-
defaultValue?objectInitialization Data for the Composer, this is a hook to generate custom posts

Default
null
-
defaultValue.addressing?SCTagType[]--
defaultValue.audience?string--
defaultValue.categories?SCCategoryType[]--
defaultValue.group?SCGroupType--
defaultValue.location?string--
defaultValue.medias?SCMediaType[]--
defaultValue.poll?SCPollType--
defaultValue.text?string--
defaultValue.title?string--
feedObject?SCFeedObjectType | SCFeedDiscussionType | SCFeedPostTypeFeed object

Default
null
-
feedObjectId?numberId of feed object

Default
null
-
feedObjectType?DISCUSSION | POST | STATUSType of feed object

Default
null
-
feedType?SCFeedTypologyTypeThe feed where the component is rendered

Default
SCFeedTypologyType.HOME
-
mediaObjectTypes?SCMediaObjectType[]Media objects available

Default
File, Document, Link
-
onClose?(event: SyntheticEvent<Element, Event>) => voidCallback triggered on close click

Default
null
Omit.onClose
onSuccess?(res: any) => voidCallback triggered on success contribution creation

Default
null
-

Functions

Composer()

Composer(inProps): JSX.Element

API documentation for the Community-JS Composer component. Learn about the available props and the CSS API.

The Composer component contains the logic around the creation of Post and Discussion objects.

info

To prevent the editor toolbar and action botton bar being hidden underneath the Virtual Keyboard you need to set the interactive-widget=resizes-content on meta viewport. This works on chrome for android. For iOS devices there is a lack of support of this meta so we force the blur event when the user start dragging. More information

Import

import {Composer} from '@selfcommunity/react-ui';

Component Name

The name SCComposer can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCComposer-rootStyles applied to the root element.
ios.SCComposer-iosStyles applied to the root element when the device is ios.
title.SCComposer-titleStyles applied to the title element.
types.SCComposer-typesStyles applied to the types element.
content.SCComposer-contentStyles applied to the content.
attributes.SCComposer-attributesStyles applied to the attributes.
medias.SCComposer-mediasStyles applied to the medias.
actions.SCComposer-actionsStyles applied to the actions section.
layerTransitionRoot.SCComposer-layer-transition-rootStyles applied to the overlay layers (eg. location).

Parameters

ParameterTypeDescription
inPropsComposerProps

Returns

JSX.Element

Source

packages/react-ui/src/components/Composer/Composer.tsx:229