Skip to content

Commit

Permalink
fix: remove unneeded titles (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
astandrik authored Oct 21, 2024
1 parent e3dfcba commit b4c44e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/containers/UserSettings/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ export const UserSettings = ({settings: userSettings}: UserSettingsProps) => {
return (
<Settings>
{userSettings.map((page) => {
const {id, title, icon, sections = []} = page;
const {id, title, icon, sections = [], showTitle} = page;

return (
<Settings.Page key={id} id={id} title={title} icon={icon}>
{sections.map((section) => {
const {title: sectionTitle, settings: sectionSettings = []} = section;

return (
<Settings.Section key={id} title={sectionTitle}>
<Settings.Section
key={id}
title={sectionTitle}
showTitle={showTitle ?? true}
>
{sectionSettings.map((setting) => {
if (setting.type === 'info') {
return (
Expand Down
5 changes: 5 additions & 0 deletions src/containers/UserSettings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface SettingsPage {
title: string;
icon: IconProps;
sections: SettingsSection[];
// default true
showTitle?: false;
}

export type YDBEmbeddedUISettings = SettingsPage[];
Expand Down Expand Up @@ -155,12 +157,14 @@ export const generalPage: SettingsPage = {
title: i18n('page.general'),
icon: {data: StarFill, height: 14, width: 14},
sections: [appearanceSection],
showTitle: false,
};
export const experimentsPage: SettingsPage = {
id: 'experimentsPage',
title: i18n('page.experiments'),
icon: {data: Flask},
sections: [experimentsSection],
showTitle: false,
};
export const editorPage: SettingsPage = {
id: 'editorPage',
Expand All @@ -174,6 +178,7 @@ export const aboutPage: SettingsPage = {
title: i18n('page.about'),
icon: {data: CircleInfo},
sections: [aboutSettingsSection],
showTitle: false,
};

export function getUserSettings({singleClusterMode}: {singleClusterMode: boolean}) {
Expand Down

0 comments on commit b4c44e9

Please sign in to comment.