Skip to content

Commit a19d427

Browse files
authored
Fix empty items in preferences modal (codesandbox#2815)
1 parent ab2f495 commit a19d427

File tree

1 file changed

+57
-56
lines changed
  • packages/app/src/app/pages/common/Modals/PreferencesModal

1 file changed

+57
-56
lines changed

packages/app/src/app/pages/common/Modals/PreferencesModal/index.tsx

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -38,62 +38,63 @@ const PreferencesModal: React.FC = () => {
3838
} = useOvermind();
3939

4040
const items = useMemo(
41-
() => [
42-
{
43-
id: 'appearance',
44-
title: 'Appearance',
45-
icon: <AppearanceIcon />,
46-
content: <Appearance />,
47-
},
48-
{
49-
id: 'editor',
50-
title: 'Editor',
51-
icon: <CodeIcon />,
52-
content: <EditorSettings />,
53-
},
54-
{
55-
id: 'prettierSettings',
56-
title: 'Prettier Settings',
57-
icon: <CodeFormatIcon />,
58-
content: <CodeFormatting />,
59-
},
60-
{
61-
id: 'preview',
62-
title: 'Preview',
63-
icon: <BrowserIcon />,
64-
content: <PreviewSettings />,
65-
},
66-
{
67-
id: 'keybindings',
68-
title: 'Key Bindings',
69-
icon: <KeyboardIcon />,
70-
content: <KeyMapping />,
71-
},
72-
isLoggedIn && {
73-
id: 'integrations',
74-
title: 'Integrations',
75-
icon: <IntegrationIcon />,
76-
content: <Integrations />,
77-
},
78-
isPatron && {
79-
id: 'paymentInfo',
80-
title: 'Payment Info',
81-
icon: <CreditCardIcon />,
82-
content: <PaymentInfo />,
83-
},
84-
isPatron && {
85-
id: 'badges',
86-
title: 'Badges',
87-
icon: <StarIcon />,
88-
content: <Badges />,
89-
},
90-
{
91-
id: 'experiments',
92-
title: 'Experiments',
93-
icon: <FlaskIcon />,
94-
content: <Experiments />,
95-
},
96-
],
41+
() =>
42+
[
43+
{
44+
id: 'appearance',
45+
title: 'Appearance',
46+
icon: <AppearanceIcon />,
47+
content: <Appearance />,
48+
},
49+
{
50+
id: 'editor',
51+
title: 'Editor',
52+
icon: <CodeIcon />,
53+
content: <EditorSettings />,
54+
},
55+
{
56+
id: 'prettierSettings',
57+
title: 'Prettier Settings',
58+
icon: <CodeFormatIcon />,
59+
content: <CodeFormatting />,
60+
},
61+
{
62+
id: 'preview',
63+
title: 'Preview',
64+
icon: <BrowserIcon />,
65+
content: <PreviewSettings />,
66+
},
67+
{
68+
id: 'keybindings',
69+
title: 'Key Bindings',
70+
icon: <KeyboardIcon />,
71+
content: <KeyMapping />,
72+
},
73+
isLoggedIn && {
74+
id: 'integrations',
75+
title: 'Integrations',
76+
icon: <IntegrationIcon />,
77+
content: <Integrations />,
78+
},
79+
isPatron && {
80+
id: 'paymentInfo',
81+
title: 'Payment Info',
82+
icon: <CreditCardIcon />,
83+
content: <PaymentInfo />,
84+
},
85+
isPatron && {
86+
id: 'badges',
87+
title: 'Badges',
88+
icon: <StarIcon />,
89+
content: <Badges />,
90+
},
91+
{
92+
id: 'experiments',
93+
title: 'Experiments',
94+
icon: <FlaskIcon />,
95+
content: <Experiments />,
96+
},
97+
].filter(Boolean),
9798
[isLoggedIn, isPatron]
9899
);
99100

0 commit comments

Comments
 (0)