-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into development-lumi-7752
- Loading branch information
Showing
20 changed files
with
251 additions
and
335 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
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
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,63 @@ | ||
import React from 'react'; | ||
import { | ||
Container, | ||
Text, | ||
Flex, | ||
Divider, | ||
} from '@chakra-ui/react'; | ||
import PropTypes from 'prop-types'; | ||
import useTranslation from 'next-translate/useTranslation'; | ||
import { useRouter } from 'next/router'; | ||
import logoData from '../../../public/logo.json'; | ||
import NextChakraLink from './NextChakraLink'; | ||
import useAuth from '../hooks/useAuth'; | ||
|
||
function FooterTC({ pageProps }) { | ||
const { t } = useTranslation('footer'); | ||
const { isAuthenticated } = useAuth(); | ||
const copyrightName = pageProps?.existsWhiteLabel ? logoData.name : '4Geeks'; | ||
const actualYear = new Date().getFullYear(); | ||
const router = useRouter(); | ||
const noFooterRoutes = ['/cohort/[cohortSlug]/[slug]/[version]', '/syllabus/[cohortSlug]/[lesson]/[lessonSlug]']; | ||
|
||
if (noFooterRoutes.includes(router.pathname)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Container as={isAuthenticated && 'footer'} maxW> | ||
<Divider borderBottomWidth="2px" marginTop={isAuthenticated && '50px'} /> | ||
<Flex | ||
key="copyright" | ||
padding="20px 20px 5px 20px" | ||
justifyContent={['center', 'center', 'space-between', 'space-between']} | ||
wrap={['wrap', 'wrap', 'nowrap', 'nowrap']} | ||
textAlign="center" | ||
> | ||
<Text marginBottom={['20px', '20px', '0', '0']} fontSize="sm">{t('copyright', { name: copyrightName, year: actualYear })}</Text> | ||
<Flex | ||
wrap={['wrap', 'wrap', 'nowrap', 'nowrap']} | ||
justifyContent={['center', 'center', 'space-between', 'space-between']} | ||
width={['100%', '100%', '35%', '25%']} | ||
> | ||
<NextChakraLink href={t('terms.href')}> | ||
<Text fontSize="sm">{t('terms.label')}</Text> | ||
</NextChakraLink> | ||
<NextChakraLink href={t('privacy.href')}> | ||
<Text fontSize="sm">{t('privacy.label')}</Text> | ||
</NextChakraLink> | ||
</Flex> | ||
</Flex> | ||
</Container> | ||
); | ||
} | ||
|
||
FooterTC.propTypes = { | ||
pageProps: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), | ||
}; | ||
|
||
FooterTC.defaultProps = { | ||
pageProps: {}, | ||
}; | ||
|
||
export default FooterTC; |
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
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
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
Oops, something went wrong.