From 09cbc9fbc32754b59a809a7e2d93c46ec960958f Mon Sep 17 00:00:00 2001 From: Artemy Date: Tue, 11 Apr 2023 11:09:24 +0300 Subject: [PATCH] feat: menu dropdown on mobile --- src/components/button.jsx | 22 +++++++++++------ src/components/menu.jsx | 52 +++++++++++++++++++++++++++------------ src/localisation/en.js | 1 + src/localisation/eo.js | 1 + src/localisation/es.js | 1 + src/localisation/ru.js | 1 + 6 files changed, 54 insertions(+), 24 deletions(-) diff --git a/src/components/button.jsx b/src/components/button.jsx index b7dcee2..b665c16 100644 --- a/src/components/button.jsx +++ b/src/components/button.jsx @@ -1,17 +1,22 @@ import { Link } from "react-router-dom"; -function Button(props) { +function Button({ + href, + className, + onClick, + w, + children, + color = "bg-zinc-100 hover:bg-zinc-300 dark:bg-zinc-600 dark:hover:bg-zinc-800", +}) { return ( - +
- {props.children} + {children}
); @@ -41,6 +46,7 @@ function ButtonWithIcon(props) { className={props.className} onClick={props.onClick} w={props.w} + color={props.color} > - - - - + {window.innerWidth < 1024 && ( + { + setHidden(!hidden); + }} + /> + )} + {!hidden && ( + <> + + + + + + )} ); } diff --git a/src/localisation/en.js b/src/localisation/en.js index c4a89a0..096e390 100644 --- a/src/localisation/en.js +++ b/src/localisation/en.js @@ -54,6 +54,7 @@ let en = { NoNotesFound: "No notes found", LocalNote: "Local", PublicNote: "Public", + Menu: "Menu", }; export default en; diff --git a/src/localisation/eo.js b/src/localisation/eo.js index c70c556..8d7a4ca 100644 --- a/src/localisation/eo.js +++ b/src/localisation/eo.js @@ -57,6 +57,7 @@ let eo = { NoNotesFound: "Neniuj notoj trovitaj", LocalNote: "Loka", PublicNote: "Publika", + Menu: "Menuo", }; export default eo; diff --git a/src/localisation/es.js b/src/localisation/es.js index c521eb2..49c5dd8 100644 --- a/src/localisation/es.js +++ b/src/localisation/es.js @@ -57,6 +57,7 @@ let es = { NoNotesFound: "No se encontraron notas", LocalNote: "Local", PublicNote: "Pública", + Menu: "Menú", }; export default es; diff --git a/src/localisation/ru.js b/src/localisation/ru.js index 1f710bd..62c6530 100644 --- a/src/localisation/ru.js +++ b/src/localisation/ru.js @@ -55,6 +55,7 @@ let ru = { NoNotesFound: "Заметок не найдено", LocalNote: "Локальная", PublishNote: "Публичная", + Menu: "Меню", }; export default ru;