Skip to content

Commit

Permalink
Use a Container from the registry in the Form component and fallback … (
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Jun 15, 2023
1 parent 883a5a9 commit e66d1ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/4849.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use a Container from the registry in the Form component and fallback to the Semantic UI one. @sneridagh
8 changes: 5 additions & 3 deletions src/components/manage/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Portal } from 'react-portal';
import { connect } from 'react-redux';
import {
Button,
Container,
Container as SemanticContainer,
Form as UiForm,
Message,
Segment,
Expand Down Expand Up @@ -545,12 +545,14 @@ class Form extends Component {
const { schema: originalSchema, onCancel, onSubmit } = this.props;
const { formData } = this.state;
const schema = this.removeBlocksLayoutFields(originalSchema);
const Container =
config.getComponent({ name: 'Container' }).component || SemanticContainer;

return this.props.visual ? (
// Removing this from SSR is important, since react-beautiful-dnd supports SSR,
// but draftJS don't like it much and the hydration gets messed up
this.state.isClient && (
<div className="ui container">
<Container>
<BlocksToolbar
formData={this.state.formData}
selectedBlock={this.state.selected}
Expand Down Expand Up @@ -639,7 +641,7 @@ class Form extends Component {
</UiForm>
</Portal>
)}
</div>
</Container>
)
) : (
<Container>
Expand Down

0 comments on commit e66d1ed

Please sign in to comment.