From ef17be3efc695b9ed84437261635c3c59a1618f9 Mon Sep 17 00:00:00 2001 From: Damla Koksal Date: Fri, 22 Apr 2022 03:05:17 +0300 Subject: [PATCH 1/5] [#4]feat: add language selector --- next.config.js | 2 +- .../LanguageSelector/LanguageSelector.tsx | 55 +++++++++++++++++++ .../common/Notification/Notification.tsx | 2 +- src/components/common/index.tsx | 1 + src/components/layouts/Home/HomeLayout.tsx | 11 ---- .../layouts/Home/modules/Footer/Footer.tsx | 13 +++-- 6 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 src/components/common/LanguageSelector/LanguageSelector.tsx diff --git a/next.config.js b/next.config.js index 4a80a01..c1c91ed 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, + reactStrictMode: false, i18n: { // These are all the locales you want to support in // your application diff --git a/src/components/common/LanguageSelector/LanguageSelector.tsx b/src/components/common/LanguageSelector/LanguageSelector.tsx new file mode 100644 index 0000000..3c234d0 --- /dev/null +++ b/src/components/common/LanguageSelector/LanguageSelector.tsx @@ -0,0 +1,55 @@ +import { Menu, Transition } from '@headlessui/react'; +import { ChevronUpIcon } from '@heroicons/react/solid'; +import Link from 'next/link'; +import { Fragment } from 'react'; + +const LanguageSelector = () => { + // const [selectedLang, setSelectedLang] = useState([ + // { value: 'en', label: 'English', current: true }, + // { value: 'tr', label: 'Turkish', current: false }, + // ]); + + return ( +
+ + + Languages + + + + + + + +
+ ); +}; + +export default LanguageSelector; diff --git a/src/components/common/Notification/Notification.tsx b/src/components/common/Notification/Notification.tsx index 75b18e4..9f7f34b 100644 --- a/src/components/common/Notification/Notification.tsx +++ b/src/components/common/Notification/Notification.tsx @@ -21,7 +21,7 @@ const Notification = () => { return (
{ ); }; export default Landing; - -// TODO: ADD LANGUAGE SELECTOR -{ - /* - EN - - | - - TR - */ -} diff --git a/src/components/layouts/Home/modules/Footer/Footer.tsx b/src/components/layouts/Home/modules/Footer/Footer.tsx index 2f7d586..867ebdb 100644 --- a/src/components/layouts/Home/modules/Footer/Footer.tsx +++ b/src/components/layouts/Home/modules/Footer/Footer.tsx @@ -1,6 +1,6 @@ -import Link from 'next/link'; import { IFooter } from '../../../../../interfaces/landing'; import { APP_NAME } from '../../../../../utils/constants'; +import { LanguageSelector } from '../../../../common'; interface Props { data: IFooter; @@ -9,9 +9,14 @@ interface Props { const Footer = ({ data }: Props) => { const { rights } = data; return ( -