-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aliwoto <[email protected]>
- Loading branch information
Showing
34 changed files
with
953 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Jalaali", | ||
"jalali", | ||
"snackbars" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { Box } from '@mui/material'; | ||
import AppFooter from './components/footers/AppFooter'; | ||
import { SupportedTranslations, switchAppTranslation } from './translations/translationSwitcher'; | ||
import apiClient from './apiClient'; | ||
|
||
const AppLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => { | ||
const [currentAppLanguage, setCurrentAppLanguage] = React.useState<string>('en'); | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
minHeight: '110vh', // Ensure the layout takes at least the full viewport height | ||
}} | ||
> | ||
<Box sx={{ flexGrow: 1 }} key={`ExamSphere-app-${currentAppLanguage}-box`}> | ||
{children} | ||
</Box> | ||
<AppFooter setAppLanguage={async (lang) => { | ||
console.log(`Switching from ${currentAppLanguage} to ${lang}`); | ||
// doing this, so react re-renders the app with the new language | ||
setCurrentAppLanguage(lang); | ||
const userLang = lang as SupportedTranslations; | ||
switchAppTranslation(userLang); | ||
await apiClient.setAppLanguage(userLang); | ||
}} /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default AppLayout; |
Oops, something went wrong.