From 247f3f504a9cfed3e70b09b33d76ce7b264bc50a Mon Sep 17 00:00:00 2001 From: loischen68 Date: Fri, 6 Dec 2024 14:08:38 +0800 Subject: [PATCH] fix: adjust LocaleCollapse languagesList --- src/components/common/LocaleCollapse.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/common/LocaleCollapse.tsx b/src/components/common/LocaleCollapse.tsx index 99a01c054..1c885c139 100644 --- a/src/components/common/LocaleCollapse.tsx +++ b/src/components/common/LocaleCollapse.tsx @@ -18,7 +18,7 @@ const BlankIcon = styled.i` const LocaleCollapse: React.FC = () => { const { isOpen, onToggle } = useDisclosure() - const { currentLocale, setCurrentLocale } = useContext(LocaleContext) + const { currentLocale, setCurrentLocale, languagesList } = useContext(LocaleContext) return ( <> @@ -33,14 +33,16 @@ const LocaleCollapse: React.FC = () => { - {SUPPORTED_LOCALES.filter(v => v.locale !== currentLocale).map(v => ( - - setCurrentLocale?.(v.locale)}> - - {v.label} - - - ))} + {languagesList + .filter(v => v.locale !== currentLocale) + .map(v => ( + + setCurrentLocale?.(v.locale)}> + + {v.label} + + + ))} )