@@ -9,6 +9,8 @@ import { useLocalization } from '@fluent/react';
99import Head from 'fxa-react/components/Head' ;
1010import classNames from 'classnames' ;
1111import { RelierCmsInfo } from '../../models/integrations' ;
12+ import { LocaleToggle } from '../LocaleToggle' ;
13+ import { useConfig } from '../../models/hooks' ;
1214
1315type AppLayoutProps = {
1416 // TODO: FXA-6803 - the title prop should be made mandatory
@@ -25,6 +27,8 @@ type AppLayoutProps = {
2527 * `FlowContainer`.
2628 */
2729 wrapInCard ?: boolean ;
30+ /** Whether to show the locale toggle in the footer */
31+ showLocaleToggle ?: boolean ;
2832} ;
2933
3034const looseValidBgCheck = ( value : string | undefined ) => {
@@ -45,6 +49,7 @@ export const AppLayout = ({
4549 wrapInCard = true ,
4650} : AppLayoutProps ) => {
4751 const { l10n } = useLocalization ( ) ;
52+ const config = useConfig ( ) ;
4853 const cmsBackgroundColor = cmsInfo ?. shared ?. backgroundColor ;
4954 const cmsHeaderBackground = cmsInfo ?. shared ?. headerBackground ;
5055 const cmsPageTitle = cmsInfo ?. shared ?. pageTitle ;
@@ -58,6 +63,8 @@ export const AppLayout = ({
5863
5964 const favicon = cmsInfo ?. shared ?. favicon ;
6065
66+ const showLocaleToggle = config . featureFlags ?. showLocaleToggle ;
67+
6168 return (
6269 < >
6370 < Head { ...{ title : overrideTitle , favicon } } />
@@ -116,7 +123,7 @@ export const AppLayout = ({
116123 </ LinkExternal >
117124 </ header >
118125 < main className = "mobileLandscape:flex mobileLandscape:items-center mobileLandscape:flex-1" >
119- < section >
126+ < section className = "relative" >
120127 { wrapInCard ? (
121128 < div className = { classNames ( 'card' , widthClass ) } > { children } </ div >
122129 ) : (
@@ -125,6 +132,14 @@ export const AppLayout = ({
125132 </ section >
126133 </ main >
127134 </ div >
135+ < footer >
136+ { /* LocaleToggle positioned in lower left corner of page */ }
137+ { showLocaleToggle && (
138+ < div className = "fixed bottom-6 left-6 z-10" >
139+ < LocaleToggle placement = "footer" />
140+ </ div >
141+ ) }
142+ </ footer >
128143 < div id = "body-bottom" className = "w-full block mobileLandscape:hidden" />
129144 </ >
130145 ) ;
0 commit comments