Skip to content

Commit

Permalink
Fix prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kudlajz committed Aug 6, 2024
1 parent 2a355d6 commit 327d11b
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions packages/slate-editor/src/extensions/variables/VariableElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function VariableElement({ attributes, children, element, variables }: Pr
const options = variables.map((variable) => ({
value: variable.key,
label: variable.text,
withFallback: variable.withFallback
withFallback: variable.withFallback,
}));
const option = options.find(({ value }) => value === element.key);

Expand Down Expand Up @@ -65,8 +65,13 @@ export function VariableElement({ attributes, children, element, variables }: Pr
return (
<>
{selected && container && isMenuOpen && (
<Menu popperOptions={{ modifiers: { arrow: { padding: 0 } } }} reference={container}>
<Toolbox.Header onCloseClick={handleCloseMenu} withCloseButton>Dynamic field settings</Toolbox.Header>
<Menu
popperOptions={{ modifiers: { arrow: { padding: 0 } } }}
reference={container}
>
<Toolbox.Header onCloseClick={handleCloseMenu} withCloseButton>
Dynamic field settings
</Toolbox.Header>
<Toolbox.Section>
<VStack spacing="2">
<Toolbox.Caption>Type</Toolbox.Caption>
Expand Down Expand Up @@ -95,7 +100,13 @@ export function VariableElement({ attributes, children, element, variables }: Pr
onChange={setFallback}
placeholder="Define your fallback"
/>
<Button variant="primary" type="submit" size="small" fullWidth round>
<Button
variant="primary"
type="submit"
size="small"
fullWidth
round
>
Save
</Button>
</VStack>
Expand All @@ -117,7 +128,8 @@ export function VariableElement({ attributes, children, element, variables }: Pr
contentEditable={false}
ref={setContainer}
>
{option?.label}{element.fallback && ` or "${element.fallback}"`}
{option?.label}
{element.fallback && ` or "${element.fallback}"`}
{children}
</span>
</>
Expand Down

0 comments on commit 327d11b

Please sign in to comment.