Skip to content

Commit

Permalink
feat: add language control selector for static build
Browse files Browse the repository at this point in the history
  • Loading branch information
makamekm committed Mar 28, 2024
1 parent 34e2a6e commit b918e47
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ export function App(props: DocInnerProps): ReactElement {
const settings = useSettings();
const mobileView = useMobile();

const onChangeLang = useCallback((lang: Lang) => {
window.location.replace(getLangPath(router, lang));
}, []);
const onChangeLang = useCallback(
(lang: Lang) => {
window.location.replace(getLangPath(router, lang));
},
[router],
);

const {theme, textSize, wideFormat, fullScreen, showMiniToc, onChangeFullScreen} = settings;
const fullHeader = !fullScreen && Boolean(navigation);
Expand Down

0 comments on commit b918e47

Please sign in to comment.