Skip to content

Commit

Permalink
fix(settings): fix tabs export
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk-sa committed Apr 22, 2024
1 parent cb637ad commit 2db25c8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/components/navbar/SettingsDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { tabs as settingsTabs } from '../settings-page/index';
import { tabs } from '../settings-page/tabs';
import { NavDropdown } from 'react-bootstrap';
import { NavLink } from 'react-router-dom';

Expand All @@ -11,7 +11,7 @@ export function SettingsDropdown() {
<div className="btn-group text-nowrap">
<NavDropdown title={<i className={'fa fa-cog'} />} id="navbarScrollingDropdown">
<>
{settingsTabs.map((tab) => (
{tabs.map((tab) => (
<NavDropdown.Item as={NavLink} key={tab.url} activeClassName={'active'} to={tab.url}>
{t(tab.translationKey)}
</NavDropdown.Item>
Expand Down
27 changes: 1 addition & 26 deletions src/components/settings-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { saveAs } from 'file-saver';
import Spinner from '../spinner';
import { TranslatedImageLocaliser } from './image-localiser';
import { DeviceApi } from '../../actions/DeviceApi';
import { tabs } from './tabs';

const Form = withTheme(Bootstrap5Theme);

Expand Down Expand Up @@ -59,32 +60,6 @@ const removePropertiesFromSchema = (
return { schema, config };
};

export const tabs = [
{
translationKey: 'settings',
url: `/settings/settings`,
},
{
translationKey: 'tools',
url: `/settings/tools`,
},
{
translationKey: 'about',
url: `/settings/about`,
},
{
translationKey: 'raw',
url: `/settings/bridge`,
},
{
translationKey: 'translate',
url: '/settings/translate',
},
{
translationKey: 'donate',
url: '/settings/donate',
},
];
const rows = [
<div key="nurikk" className="row pb-2">
<div className="col">
Expand Down
27 changes: 27 additions & 0 deletions src/components/settings-page/tabs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

export const tabs = [
{
translationKey: 'settings',
url: `/settings/settings`,
},
{
translationKey: 'tools',
url: `/settings/tools`,
},
{
translationKey: 'about',
url: `/settings/about`,
},
{
translationKey: 'raw',
url: `/settings/bridge`,
},
{
translationKey: 'translate',
url: '/settings/translate',
},
{
translationKey: 'donate',
url: '/settings/donate',
},
];

0 comments on commit 2db25c8

Please sign in to comment.