Skip to content

Commit

Permalink
refactor: styling and enters
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanad94 committed Jun 6, 2024
1 parent 3853ec7 commit 18a7513
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 1 addition & 2 deletions packages/sn-editor-react/src/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ const useStyles = makeStyles((theme) => {
paddingBlock: '10px',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
alignItems: 'strech',
rowGap: '20px',
'& .panel': {
display: 'inline-block',
border: '2px solid',
borderColor: theme.palette.primary.main,
borderRadius: '8px',
Expand Down
9 changes: 5 additions & 4 deletions packages/sn-editor-react/src/components/menu-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ export const MenuBar: FC<MenuBarProps> = ({ editor }) => {
<FormatListNumberedIcon />
</IconButton>
</Tooltip>
<AccordionControl
editor={editor}
buttonProps={{ classes: { root: classes.button, colorPrimary: classes.buttonPrimary } }}
/>
<LinkControl
editor={editor}
buttonProps={{ classes: { root: classes.button, colorPrimary: classes.buttonPrimary } }}
Expand Down Expand Up @@ -218,10 +222,7 @@ export const MenuBar: FC<MenuBarProps> = ({ editor }) => {
<RedoIcon />
</IconButton>
</Tooltip>
<AccordionControl
editor={editor}
buttonProps={{ classes: { root: classes.button, colorPrimary: classes.buttonPrimary } }}
/>

<HTMLEditorControl
editor={editor}
buttonProps={{ classes: { root: classes.button, colorPrimary: classes.buttonPrimary } }}
Expand Down
8 changes: 7 additions & 1 deletion packages/sn-editor-react/src/extension-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ export const createExtensions = (options?: ExtensionOptions) => [
Document.configure(),
Dropcursor.configure(),
Gapcursor.configure(),
HardBreak.configure(),
HardBreak.configure().extend({
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.setHardBreak(),
}
},
}),
Heading.configure(),
History.configure(),
Italic.configure(),
Expand Down

0 comments on commit 18a7513

Please sign in to comment.