From 9cc88c9f9ab477420bcec611cea91c6c5ec1f770 Mon Sep 17 00:00:00 2001 From: xxibcill Date: Tue, 7 Feb 2023 17:30:52 +0700 Subject: [PATCH 01/18] add Divider to Navbar --- src/components/NavBar.re | 14 +++++++++----- src/reusable/Divider.re | 20 ++++++++++++++++++++ src/utils/Route.re | 1 + 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/reusable/Divider.re diff --git a/src/components/NavBar.re b/src/components/NavBar.re index 33b08a7f..f9e46f2b 100644 --- a/src/components/NavBar.re +++ b/src/components/NavBar.re @@ -7,6 +7,7 @@ module RenderDesktop = { padding3(~top=`px(16), ~h=`zero, ~bottom=`px(12)), cursor(`pointer), fontSize(`px(12)), + fontWeight(`num(600)), hover([color(theme.neutral_900)]), active([color(theme.neutral_900)]), transition(~duration=400, "all"), @@ -24,11 +25,11 @@ module RenderDesktop = { @@ -146,11 +146,19 @@ module MobileRender = {
- +
+ + + + + + + + ; }; }; diff --git a/src/components/NavBar.re b/src/components/NavBar.re index 04386e50..782acf13 100644 --- a/src/components/NavBar.re +++ b/src/components/NavBar.re @@ -83,7 +83,7 @@ module RenderMobile = { let menuContainer = style([ - marginLeft(`px(10)), + marginLeft(`px(16)), flexBasis(`px(24)), flexGrow(0.), flexShrink(0.), diff --git a/src/components/ToggleThemeButton.re b/src/components/ToggleThemeButton.re index 9203e2af..8f9c5a85 100644 --- a/src/components/ToggleThemeButton.re +++ b/src/components/ToggleThemeButton.re @@ -1,12 +1,12 @@ module Styles = { open Css; - let button = (isDarkMode, theme: Theme.t) => + let button = (theme: Theme.t, isDarkMode) => style([ - backgroundColor(isDarkMode ? theme.white : theme.black), + backgroundColor(isDarkMode ? theme.neutral_900 : theme.neutral_800), position(`relative), borderRadius(`px(8)), - border(`px(1), `solid, isDarkMode ? theme.white : theme.black), + border(`px(1), `solid, isDarkMode ? theme.neutral_900 : theme.neutral_800), cursor(`pointer), outlineStyle(`none), width(`px(32)), @@ -27,9 +27,9 @@ module Styles = { [@react.component] let make = () => { - let ({ThemeContext.isDarkMode, theme}, toggle) = React.useContext(ThemeContext.context); + let ({ThemeContext.theme, isDarkMode}, toggle) = React.useContext(ThemeContext.context); - ; diff --git a/src/components/buttons/Button.re b/src/components/buttons/Button.re index 1ce2467c..a79ec846 100644 --- a/src/components/buttons/Button.re +++ b/src/components/buttons/Button.re @@ -13,6 +13,7 @@ module Styles = { ~py=13, ~pxSm=px, ~pySm=py, + ~fullWidth, theme: Theme.t, isDarkMode, (), @@ -20,6 +21,7 @@ module Styles = { let base = style([ display(`block), + width(fullWidth ? `percent(100.) : `auto), padding2(~v=`px(py), ~h=`px(px)), transition(~duration=200, "all"), borderRadius(`px(8)), @@ -90,12 +92,13 @@ let make = ~onClick=_=>(), ~style="", ~disabled=false, + ~fullWidth=false, ) => { let ({ThemeContext.theme, isDarkMode}, _) = React.useContext(ThemeContext.context);