diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index edba40b53..910715186 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -1,5 +1,7 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; import Arrow2 from './assets/dropdown-arrow.svg'; +import ArrowLeft from './assets/arrow-left.svg'; +import ArrowRight from './assets/arrow-right.svg'; const Setting = () => { const list = ['General', 'Prompts', 'Documents', 'Widgets']; @@ -11,21 +13,58 @@ const Setting = () => { else if (active === 'Widgets') return ; else return <>; }; + const scrollableRef = useRef(null); + const scrollStep = 100; + const scrollLeft = () => { + if (scrollableRef.current) { + if (scrollableRef.current.scrollLeft > 0) { + scrollableRef.current.scrollLeft -= scrollStep; // Adjust the scroll amount as needed + } + } + }; + + const scrollRight = () => { + if (scrollableRef.current) { + scrollableRef.current.scrollLeft += scrollStep; // Adjust the scroll amount as needed + } + }; return (

Settings

-
- {list.map((item, index) => ( -
setActive(item)} - > - {item} +
+
+
+ +
+
+
+ {list.map((item, index) => ( +
setActive(item)} + > + {item} +
+ ))} +
+
+
+
- ))} +
{returnActiveTabs()}
@@ -45,18 +84,18 @@ const General = () => {

Select Theme

setIsThemeListOpen(!isThemeListOpen)} > {theme && ( -

{theme}

+

{theme}

)} arrow
{isThemeListOpen && ( @@ -86,11 +125,11 @@ const General = () => {

Select Language

setIsLanguageListOpen(!isLanguageListOpen)} > {language && ( -

+

{language}

)} @@ -99,7 +138,7 @@ const General = () => { alt="arrow" className={`${ !isLanguageListOpen ? 'rotate-0' : 'rotate-180' - } ml-auto mr-3 w-3 transition-all`} + } ml-auto mr-6 w-3 transition-all`} />
{isLanguageListOpen && ( diff --git a/frontend/src/assets/arrow-left.svg b/frontend/src/assets/arrow-left.svg new file mode 100644 index 000000000..8c7c79723 --- /dev/null +++ b/frontend/src/assets/arrow-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/arrow-right.svg b/frontend/src/assets/arrow-right.svg new file mode 100644 index 000000000..a36d6e8fe --- /dev/null +++ b/frontend/src/assets/arrow-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/settingGear.svg b/frontend/src/assets/settingGear.svg index 0b9af06be..abbde123e 100644 --- a/frontend/src/assets/settingGear.svg +++ b/frontend/src/assets/settingGear.svg @@ -1,70 +1,3 @@ - - - - - - settings-gear - - - - image/svg+xml - - settings-gear - - - - - - - - - \ No newline at end of file + + +