diff --git a/src/app/configs/navigation-i18n/en.js b/src/app/configs/navigation-i18n/en.js index 8adecec..795492c 100644 --- a/src/app/configs/navigation-i18n/en.js +++ b/src/app/configs/navigation-i18n/en.js @@ -1,8 +1,8 @@ -const en = { +const locale = { dashboard: 'Dashboard', favorites: 'Favorites', history: 'History', profile: 'My profile', }; -export default en; +export default locale; diff --git a/src/app/theme-layouts/layout2/Layout2.js b/src/app/theme-layouts/layout2/Layout2.js new file mode 100644 index 0000000..5d9ee88 --- /dev/null +++ b/src/app/theme-layouts/layout2/Layout2.js @@ -0,0 +1,32 @@ +import FuseSuspense from '@fuse/core/FuseSuspense'; +import AppContext from 'app/AppContext'; +import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice'; +import i18next from 'i18next'; +import { memo, useContext } from 'react'; +import { useSelector } from 'react-redux'; +import { useRoutes } from 'react-router-dom'; +import FooterLayout2 from './components/FooterLayout2'; +import HeaderLayout2 from './components/HeaderLayout2'; + +import en from './i18n/en'; + +i18next.addResourceBundle('en', 'layout2', en); + +function Layout2(props) { + const config = useSelector(selectFuseCurrentLayoutConfig); + const appContext = useContext(AppContext); + const { routes } = appContext; + + return ( + <> + {config.header.display && } + + {useRoutes(routes)} + {props.children} + + {config.footer.display && } + > + ); +} + +export default memo(Layout2); diff --git a/src/app/theme-layouts/layout2/Layout2Config.js b/src/app/theme-layouts/layout2/Layout2Config.js new file mode 100644 index 0000000..cf3368c --- /dev/null +++ b/src/app/theme-layouts/layout2/Layout2Config.js @@ -0,0 +1,37 @@ +const config = { + title: 'Layout 2 - Regular', + defaults: { + header: { + display: true, + }, + footer: { + display: true, + }, + }, + form: { + mode: { + title: 'Mode', + type: 'radio', + options: [ + { + name: 'Boxed', + value: 'boxed', + }, + { + name: 'Full Width', + value: 'fullwidth', + }, + { + name: 'Container', + value: 'container', + }, + ], + }, + containerWidth: { + title: 'Container Width (px)', + type: 'number', + }, + }, +}; + +export default config; diff --git a/src/app/theme-layouts/layout2/components/FooterLayout2.js b/src/app/theme-layouts/layout2/components/FooterLayout2.js new file mode 100644 index 0000000..1973e2d --- /dev/null +++ b/src/app/theme-layouts/layout2/components/FooterLayout2.js @@ -0,0 +1,52 @@ +import { memo } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; +import linksConfigLayout2 from './linksLayout2Config'; + +function FooterLayout2() { + const { t } = useTranslation('layout2'); + + return ( + + ); +} + +export default memo(FooterLayout2); diff --git a/src/app/theme-layouts/layout2/components/HeaderLayout2.js b/src/app/theme-layouts/layout2/components/HeaderLayout2.js new file mode 100644 index 0000000..9bc11f5 --- /dev/null +++ b/src/app/theme-layouts/layout2/components/HeaderLayout2.js @@ -0,0 +1,48 @@ +import FuseSvgIcon from '@fuse/core/FuseSvgIcon/FuseSvgIcon'; +import { memo } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; +import linksConfigLayout2 from './linksLayout2Config'; + +function HeaderLayout2() { + const { t } = useTranslation('layout2'); + + return ( + + + + + + + {linksConfigLayout2.map((path) => ( + + {t(path)} + + ))} + + + + {t('sign_up')} + + + {t('sign_in')} + heroicons-outline:login + + + + + ); +} + +export default memo(HeaderLayout2); diff --git a/src/app/theme-layouts/layout2/components/linksLayout2Config.js b/src/app/theme-layouts/layout2/components/linksLayout2Config.js new file mode 100644 index 0000000..7efc7a2 --- /dev/null +++ b/src/app/theme-layouts/layout2/components/linksLayout2Config.js @@ -0,0 +1,3 @@ +const linksConfigLayout2 = ['rent-and-buy', 'about-us', 'blog', 'contacts']; + +export default linksConfigLayout2; diff --git a/src/app/theme-layouts/layout2/i18n/en.js b/src/app/theme-layouts/layout2/i18n/en.js new file mode 100644 index 0000000..0c9119c --- /dev/null +++ b/src/app/theme-layouts/layout2/i18n/en.js @@ -0,0 +1,11 @@ +const locale = { + 'rent-and-buy': 'Rent&Buy Analysis', + 'about-us': 'About Us', + blog: 'Blog', + contacts: 'Contacts', + sign_up: 'Log In', + sign_in: 'Register', + logo_alt: 'Logo', +}; + +export default locale;