From a44117533c14a9108c3e664a89f1d769b172976a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damla=20K=C3=B6ksal?= Date: Fri, 1 Jan 2021 17:54:53 +0300 Subject: [PATCH 1/5] [#39] fix: seperated button as a link and a button(for scroll event) --- .../custom-button/custom-button.component.jsx | 28 +++++++++++++------ components/layout/layout.component.jsx | 5 ---- components/menu-item/menu-item.component.jsx | 2 +- global/global.scss | 3 +- pages/about-us/index.jsx | 2 +- pages/factory/index.jsx | 2 +- pages/index.js | 6 ++-- 7 files changed, 28 insertions(+), 20 deletions(-) diff --git a/components/custom-button/custom-button.component.jsx b/components/custom-button/custom-button.component.jsx index f52b00e..ffdae45 100644 --- a/components/custom-button/custom-button.component.jsx +++ b/components/custom-button/custom-button.component.jsx @@ -6,21 +6,33 @@ export default function CustomButton({ onClick, href, children, - button, inverted, + linked, }) { return ( -
- - + {linked ? ( + + +
{children}
+
+ + ) : ( +
+ + )} + ); } diff --git a/components/layout/layout.component.jsx b/components/layout/layout.component.jsx index f10f1a7..cb6feed 100644 --- a/components/layout/layout.component.jsx +++ b/components/layout/layout.component.jsx @@ -33,11 +33,6 @@ export default function Layout({ : document.querySelector("body").classList.remove("disableScroll"); }; - // console.log("announcement", announcement); - // console.log("sidebar", sidebar); - // console.log("navbar", navbar); - // console.log("footer", footer); - return (
diff --git a/components/menu-item/menu-item.component.jsx b/components/menu-item/menu-item.component.jsx index c85efa9..86b5f89 100644 --- a/components/menu-item/menu-item.component.jsx +++ b/components/menu-item/menu-item.component.jsx @@ -11,4 +11,4 @@ export default function MenuItem({ href, children, locale }) { ); } -/* TODO: Burayi test et, oncesinde {"classname"} seklinde yazilmis, problem cikarabilirdi */ +/* TODO: fix the bug about links */ diff --git a/global/global.scss b/global/global.scss index ebe1ae6..1acec5a 100644 --- a/global/global.scss +++ b/global/global.scss @@ -20,7 +20,8 @@ body { } } ul, -li { +li, +button { border: 0; font-size: 100%; font: inherit; diff --git a/pages/about-us/index.jsx b/pages/about-us/index.jsx index 3a57bcc..e374961 100644 --- a/pages/about-us/index.jsx +++ b/pages/about-us/index.jsx @@ -46,7 +46,7 @@ export default function AboutUs({ common, page: { title } }) { } button={ - + Daha Fazlası diff --git a/pages/factory/index.jsx b/pages/factory/index.jsx index 9b73730..f51712d 100644 --- a/pages/factory/index.jsx +++ b/pages/factory/index.jsx @@ -46,7 +46,7 @@ export default function Factory({ common, page: { title } }) { } button={ - + Daha Fazlası diff --git a/pages/index.js b/pages/index.js index 6ac6ca7..42574d0 100644 --- a/pages/index.js +++ b/pages/index.js @@ -55,7 +55,7 @@ export default function Anasayfa({ common, page: { title } }) { } button={ - scrollToSection("section-2")}> + scrollToSection("section-2")}> Daha Fazlası @@ -93,7 +93,7 @@ export default function Anasayfa({ common, page: { title } }) { } button={ - + Daha Fazlası @@ -116,7 +116,7 @@ export default function Anasayfa({ common, page: { title } }) { } button={ - + Daha Fazlası From 5c315e87fec12ad7045f6fee4126e4a914ff6a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damla=20K=C3=B6ksal?= Date: Fri, 1 Jan 2021 18:01:31 +0300 Subject: [PATCH 2/5] [#39] refactor: refactor done for custom button component --- components/custom-button/custom-button.component.jsx | 12 +++--------- pages/index.js | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/components/custom-button/custom-button.component.jsx b/components/custom-button/custom-button.component.jsx index ffdae45..731f281 100644 --- a/components/custom-button/custom-button.component.jsx +++ b/components/custom-button/custom-button.component.jsx @@ -2,17 +2,11 @@ import styles from "./custom-button.module.scss"; import Link from "next/link"; import classNames from "classnames"; -export default function CustomButton({ - onClick, - href, - children, - inverted, - linked, -}) { +export default function CustomButton({ onClick, href, children, inverted }) { return ( <> - {linked ? ( - + {href ? ( + } button={ - + Daha Fazlası From 1c39a5fb2976633e3dc435eb06e388dfad844413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damla=20K=C3=B6ksal?= Date: Fri, 1 Jan 2021 18:19:32 +0300 Subject: [PATCH 3/5] [#36] fix: deleted locale property from menu items in sidebar --- .../layout/side-bar/side-bar.component.jsx | 20 ++++++------------- components/menu-item/menu-item.component.jsx | 4 ++-- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/components/layout/side-bar/side-bar.component.jsx b/components/layout/side-bar/side-bar.component.jsx index 2e1103c..517f9f1 100644 --- a/components/layout/side-bar/side-bar.component.jsx +++ b/components/layout/side-bar/side-bar.component.jsx @@ -17,22 +17,14 @@ export default function SideBar({
{hamburgerButton}
- - {about_us.text} - - - {factory.text} - - - {catalog.text} - - - {contact.text} - - + {about_us.text} + {factory.text} + {catalog.text} + {contact.text} + {turkish.text} - + {english.text}
diff --git a/components/menu-item/menu-item.component.jsx b/components/menu-item/menu-item.component.jsx index 86b5f89..cf16f5b 100644 --- a/components/menu-item/menu-item.component.jsx +++ b/components/menu-item/menu-item.component.jsx @@ -1,11 +1,11 @@ import Link from "next/link"; import styles from "./menu-item.module.scss"; -export default function MenuItem({ href, children, locale }) { +export default function MenuItem({ href, children, lang }) { // TODO: Ignore warning from here return (
  • - + {children}
  • From 8ec47bda7a02e4783413373727fe6c8bfce97b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damla=20K=C3=B6ksal?= Date: Fri, 1 Jan 2021 18:27:27 +0300 Subject: [PATCH 4/5] [#36] fix: deleted locale property from menu items in navbar --- .../layout/nav-bar/nav-bar.component.jsx | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/components/layout/nav-bar/nav-bar.component.jsx b/components/layout/nav-bar/nav-bar.component.jsx index 2489e2d..607deb8 100644 --- a/components/layout/nav-bar/nav-bar.component.jsx +++ b/components/layout/nav-bar/nav-bar.component.jsx @@ -43,26 +43,18 @@ export default function NavBar({ {isDesktopOrLaptop && ( <> - - {about_us.text} - - - {factory.text} - - - {catalog.text} - - - {contact.text} - + {about_us.text} + {factory.text} + {catalog.text} + {contact.text}
    - + {english.text} | - + {turkish.text}
    @@ -73,26 +65,12 @@ export default function NavBar({ {isTabletOrMobile && ( <> - + - - {hamburgerButton} - - {/* TODO: LINK ICINDE LINK VAR! */} + {hamburgerButton} )} From 1184ffb84f4dbf2e2ef9de4ab7e2b2b65463920b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damla=20K=C3=B6ksal?= Date: Fri, 1 Jan 2021 20:52:14 +0300 Subject: [PATCH 5/5] [#36] fix: clicking twice problem solved. - Changed language links found in sidebar component to tags. --- components/layout/layout.component.jsx | 3 ++- .../layout/side-bar/side-bar.component.jsx | 4 ++-- components/menu-item/menu-item.component.jsx | 22 ++++++++++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/components/layout/layout.component.jsx b/components/layout/layout.component.jsx index cb6feed..4929f6e 100644 --- a/components/layout/layout.component.jsx +++ b/components/layout/layout.component.jsx @@ -13,11 +13,12 @@ export default function Layout({ children, data: { announcement, sidebar, navbar, footer }, }) { + const [isOpen, setIsOpen] = useState(false); + const isMobile = useMediaQuery({ query: "(max-width: 475px)" }); const isDesktopOrLaptop = useMediaQuery({ query: "(min-width: 1131px)", }); - const [isOpen, setIsOpen] = useState(false); useEffect(() => { if (typeof window !== "undefined") disableScrollBody(isOpen); diff --git a/components/layout/side-bar/side-bar.component.jsx b/components/layout/side-bar/side-bar.component.jsx index 517f9f1..7310ed4 100644 --- a/components/layout/side-bar/side-bar.component.jsx +++ b/components/layout/side-bar/side-bar.component.jsx @@ -21,10 +21,10 @@ export default function SideBar({ {factory.text} {catalog.text} {contact.text} - + {turkish.text} - + {english.text}
    diff --git a/components/menu-item/menu-item.component.jsx b/components/menu-item/menu-item.component.jsx index cf16f5b..8a39241 100644 --- a/components/menu-item/menu-item.component.jsx +++ b/components/menu-item/menu-item.component.jsx @@ -1,14 +1,24 @@ import Link from "next/link"; import styles from "./menu-item.module.scss"; -export default function MenuItem({ href, children, lang }) { +export default function MenuItem({ href, children, lang, refresh }) { // TODO: Ignore warning from here return ( -
  • - - {children} - -
  • + <> + {refresh ? ( +
  • + + {children} + +
  • + ) : ( +
  • + + {children} + +
  • + )} + ); } /* TODO: fix the bug about links */