From db3a80c081142035ca743e3fc7b7d0f2f37a9200 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Sun, 29 Dec 2024 13:13:59 +0530 Subject: [PATCH] feat: Add RTL support for header navigation --- src/components/Layouts/Header.tsx | 11 +++++++++-- src/routes/firefox-route.tsx | 6 ++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/Layouts/Header.tsx b/src/components/Layouts/Header.tsx index b15a7d7..4f4da36 100644 --- a/src/components/Layouts/Header.tsx +++ b/src/components/Layouts/Header.tsx @@ -2,6 +2,7 @@ import { useStorage } from "@plasmohq/storage/hook" import { BrainCog, ChevronLeft, + ChevronRight, CogIcon, ComputerIcon, GithubIcon, @@ -31,7 +32,9 @@ export const Header: React.FC = ({ setOpenModelSettings, setSidebarOpen }) => { - const { t } = useTranslation(["option", "common"]) + const { t, i18n } = useTranslation(["option", "common"]) + const isRTL = i18n?.dir() === "rtl" + const [shareModeEnabled] = useStorage("shareMode", false) const [hideCurrentChatModelSettings] = useStorage( "hideCurrentChatModelSettings", @@ -97,7 +100,11 @@ export const Header: React.FC = ({ - + {isRTL ? ( + + ) : ( + + )} )} diff --git a/src/routes/firefox-route.tsx b/src/routes/firefox-route.tsx index 456ba34..a338bf5 100644 --- a/src/routes/firefox-route.tsx +++ b/src/routes/firefox-route.tsx @@ -9,8 +9,7 @@ export const OptionRouting = () => { return (
}> - - +
) @@ -22,8 +21,7 @@ export const SidepanelRouting = () => { return (
}> - - +
)