From 802311a06aa68af8270e8d8e75624dd7785bbc0d Mon Sep 17 00:00:00 2001 From: Anas Khafaga Date: Sat, 5 Oct 2024 17:45:48 +0300 Subject: [PATCH 1/2] fix: remove the extra margin on screens greater than medium size --- frontend/src/settings/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/settings/index.tsx b/frontend/src/settings/index.tsx index ef5434aa6..46687684c 100644 --- a/frontend/src/settings/index.tsx +++ b/frontend/src/settings/index.tsx @@ -70,7 +70,7 @@ export default function Settings() { left-arrow -
+
{tabs.map((tab, index) => ( +
+
+ {tabs.map((tab, index) => ( + + ))} +
+
+ +
+
+ ); +}; + +export default SettingsBar; diff --git a/frontend/src/settings/index.tsx b/frontend/src/settings/index.tsx index 46687684c..ea3d44281 100644 --- a/frontend/src/settings/index.tsx +++ b/frontend/src/settings/index.tsx @@ -3,8 +3,7 @@ import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; import userService from '../api/services/userService'; -import ArrowLeft from '../assets/arrow-left.svg'; -import ArrowRight from '../assets/arrow-right.svg'; +import SettingsBar from '../components/SettingsBar'; import i18n from '../locale/i18n'; import { Doc } from '../models/misc'; import { @@ -21,13 +20,6 @@ import Widgets from './Widgets'; export default function Settings() { const dispatch = useDispatch(); const { t } = useTranslation(); - const tabs = [ - t('settings.general.label'), - t('settings.documents.label'), - t('settings.apiKeys.label'), - t('settings.analytics.label'), - t('settings.logs.label'), - ]; const [activeTab, setActiveTab] = React.useState(t('settings.general.label')); const [widgetScreenshot, setWidgetScreenshot] = React.useState( null, @@ -61,39 +53,7 @@ export default function Settings() {

{t('settings.label')}

-
-
- -
-
- {tabs.map((tab, index) => ( - - ))} -
-
- -
-
+ {renderActiveTab()} {/* {activeTab === 'Widgets' && ( @@ -105,13 +65,6 @@ export default function Settings() { ); - function scrollTabs(direction: number) { - const container = document.querySelector('.flex-nowrap'); - if (container) { - container.scrollLeft += direction * 100; // Adjust the scroll amount as needed - } - } - function renderActiveTab() { switch (activeTab) { case t('settings.general.label'):