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 d62a576 commit 34e2a6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function App(props: DocInnerProps): ReactElement {
const pageContext = {
...settings,
onChangeLang,
}
};

if (!navigation) {
return (
Expand Down Expand Up @@ -215,12 +215,20 @@ export function App(props: DocInnerProps): ReactElement {
custom={{
navigation: {
controls: () => (
<HeaderControls {...pageContext} {...pageProps} onChangeLang={onChangeLang} mobileView={mobileView} />
<HeaderControls
{...pageContext}
{...pageProps}
onChangeLang={onChangeLang}
mobileView={mobileView}
/>
),
},
blocks: {
page: () => (
<Page {...pageProps} {...(headerWithControls ? {} : pageContext)}>
<Page
{...pageProps}
{...(headerWithControls ? {} : pageContext)}
>
{type === DocumentType.PageConstructor &&
'data' in data && (
<ConstructorPage
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderControls/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const HeaderControls = memo<Props>(

showMiniToc,
onChangeShowMiniToc,

lang,
langs,
onChangeLang,
Expand Down

0 comments on commit 34e2a6e

Please sign in to comment.