From 4bd425061b7ceac69a11b41813bb1956a3b89580 Mon Sep 17 00:00:00 2001 From: developomp Date: Tue, 10 Aug 2021 08:57:42 +0900 Subject: [PATCH] improved search bar styling --- source/src/pages/Search.tsx | 38 +++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/source/src/pages/Search.tsx b/source/src/pages/Search.tsx index c83ea79..795cda6 100644 --- a/source/src/pages/Search.tsx +++ b/source/src/pages/Search.tsx @@ -19,12 +19,6 @@ import PostCard from "../components/PostCard" const StyledSearch = styled.div` text-align: center; - - color: ${(props) => - theming.theme(props.theme.currentTheme, { - light: theming.dark.color1, - dark: theming.dark.color1, - })}; ` const StyledSearchContainer = styled.div` @@ -54,11 +48,31 @@ const StyledDateRange = styled(DateRange)` } ` -const StyledInput = styled.input` +const StyledSearchBar = styled.input` width: 100%; - height: 2rem; + border-radius: 100px; /* arbitrarily large value */ + height: 3rem; + padding: 0 0 0 1rem; + font-size: 1.25rem; - background-color: ${theming.dark.color0}; + border: ${(props) => + theming.theme(props.theme.currentTheme, { + light: "1px solid #ccc", + dark: "1px solid #555", + })}; + outline: none; + + background-color: ${(props) => + theming.theme(props.theme.currentTheme, { + light: theming.dark.color1, + dark: theming.dark.backgroundColor1, + })}; + + color: ${(props) => + theming.theme(props.theme.currentTheme, { + light: theming.light.color1, + dark: theming.dark.color1, + })}; ` function isDateInRange( @@ -232,18 +246,18 @@ function _Search() { { event.preventDefault() - doSearch() + if (searchInput) doSearch() }} > - setSearchInput(event.target.value) } /> -