From 05dd017a508dab93ee3dc303f2831f87aba27060 Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Thu, 17 Nov 2022 14:07:20 +0300 Subject: [PATCH] themes instead props --- frontend/pages/subscriptions.js | 2 +- frontend/src/Theme/Button/index.js | 25 +++++++ frontend/src/Theme/theme.js | 1 + frontend/src/components/ForgotPassword.js | 39 +--------- frontend/src/components/NewDashboardName.js | 3 +- frontend/src/components/NewSubscription.js | 62 ++++------------ frontend/src/components/SignIn.js | 62 ++-------------- frontend/src/components/SignUp.js | 81 ++------------------- 8 files changed, 61 insertions(+), 214 deletions(-) diff --git a/frontend/pages/subscriptions.js b/frontend/pages/subscriptions.js index ecfb469a..d61f2a3c 100644 --- a/frontend/pages/subscriptions.js +++ b/frontend/pages/subscriptions.js @@ -63,7 +63,7 @@ const Subscriptions = () => { { }; }; +const variantPlainOrange = () => { + return { + alignItems: "center", + justifyContent: "center", + border: "solid transparent", + borderRadius: "30px", + variant: "solid", + fontSize: ["md", "md", "lg", "lg", "xl", "xl"], + textColor: "white", + bg: "#F56646", + fontWeight: "700", + padding: "10px 30px", + _hover: { + backgroundColor: "#F4532F", + }, + _focus: { + backgroundColor: "#F4532F", + }, + _active: { + backgroundColor: "#F4532F", + }, + }; +}; + const Button = { // 1. We can update the base styles baseStyle: () => ({ @@ -183,6 +207,7 @@ const Button = { link: variantLink, orangeAndBlue: variantOrangeAndBlue, whiteOnOrange: variantWhiteOnOrange, + plainOrange: variantPlainOrange, }, }; export default Button; diff --git a/frontend/src/Theme/theme.js b/frontend/src/Theme/theme.js index 0cb302e0..5e1cfc10 100644 --- a/frontend/src/Theme/theme.js +++ b/frontend/src/Theme/theme.js @@ -184,6 +184,7 @@ const theme = extendTheme({ black: { 100: "#333399", 200: "#111442", + 300: "#1A1D22", }, }, }); diff --git a/frontend/src/components/ForgotPassword.js b/frontend/src/components/ForgotPassword.js index 87bd7863..253dc968 100644 --- a/frontend/src/components/ForgotPassword.js +++ b/frontend/src/components/ForgotPassword.js @@ -28,24 +28,7 @@ const ForgotPassword = ({ toggleModal }) => { { diff --git a/frontend/src/components/NewDashboardName.js b/frontend/src/components/NewDashboardName.js index 8985a7f9..34894189 100644 --- a/frontend/src/components/NewDashboardName.js +++ b/frontend/src/components/NewDashboardName.js @@ -58,12 +58,11 @@ const NewDashboardName = (props) => { <> - Name: + Name: setName(e.target.value)} placeholder={placeholder} diff --git a/frontend/src/components/NewSubscription.js b/frontend/src/components/NewSubscription.js index 6b1c646a..9c4aee0a 100644 --- a/frontend/src/components/NewSubscription.js +++ b/frontend/src/components/NewSubscription.js @@ -166,7 +166,7 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { isTruncated maxW="60px" fontSize="sm" - bgColor="#1A1D22" + bgColor="black.300" > @@ -175,13 +175,7 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { placeholder="What do you want to subscribe to" isTruncated fontSize="sm" - bg="#1A1D22" - _hover={{ - backgroundColor: "#1A1D22", - }} - _focus={{ - backgroundColor: "#1A1D22", - }} + variant="bw" {...getInputProps()} > @@ -192,12 +186,12 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { w="100%" m={0} p={0} - bg="#1A1D22" + bg="black.300" _hover={{ - backgroundColor: "#1A1D22", + backgroundColor: "black.300", }} _focus={{ - backgroundColor: "#1A1D22", + backgroundColor: "black.300", }} {...getToggleButtonProps({})} aria-label={"toggle menu"} @@ -212,7 +206,7 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { direction="column" className="menuListTim" {...getMenuProps()} - bgColor="#1A1D22" + bgColor="black.300" borderRadius="md" boxShadow="lg" pos="absolute" @@ -297,7 +291,7 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { border="1px solid white" borderRadius="7px" > - + { { border="1px solid white" borderRadius="7px" > - + { { )} {type && ( - + {!isModal ? ( { > { icon={} /> { type="input" placeholder="color" name="color" - variant="outline" - backgroundColor="#1A1D22" - _hover={{ - backgroundColor: "#1A1D22", - }} - _focus={{ - backgroundColor: "#1A1D22", - }} + variant="bw" ref={register({ required: "color is required!" })} value={color} onChange={() => null} @@ -471,12 +438,11 @@ const _NewSubscription = ({ onClose, setIsLoading, isModal, initialValue }) => { styles={{ default: { card: { - background: "#1A1D22", + background: "black.300", border: "1px solid white", }, triangle: { borderBottomColor: "white", - // border: "1px solid white", }, }, }} diff --git a/frontend/src/components/SignIn.js b/frontend/src/components/SignIn.js index f8ac9176..335526aa 100644 --- a/frontend/src/components/SignIn.js +++ b/frontend/src/components/SignIn.js @@ -17,7 +17,7 @@ import { MODAL_TYPES } from "../core/providers/OverlayProvider/constants"; const SignIn = ({ toggleModal }) => { const { handleSubmit, errors, register } = useForm(); const { login, isLoading, data } = useLogin(); - const [showPassword, togglePassword] = useState(false); + const [showPassword, setShowPassword] = useState(false); useEffect(() => { if (!data) { @@ -43,29 +43,12 @@ const SignIn = ({ toggleModal }) => { @@ -80,31 +63,14 @@ const SignIn = ({ toggleModal }) => { - togglePassword(!showPassword)}> + setShowPassword(!showPassword)}> @@ -125,26 +91,12 @@ const SignIn = ({ toggleModal }) => { diff --git a/frontend/src/components/SignUp.js b/frontend/src/components/SignUp.js index 9aeb5560..41ee6dfc 100644 --- a/frontend/src/components/SignUp.js +++ b/frontend/src/components/SignUp.js @@ -17,7 +17,7 @@ import { MODAL_TYPES } from "../core/providers/OverlayProvider/constants"; const SignUp = ({ toggleModal }) => { const { handleSubmit, errors, register } = useForm(); const { signUp, isLoading, isSuccess } = useSignUp(); - const [showPassword, togglePassword] = useState(false); + const [showPassword, setShowPassword] = useState(false); useEffect(() => { if (isSuccess) { @@ -41,29 +41,12 @@ const SignUp = ({ toggleModal }) => { @@ -79,24 +62,7 @@ const SignUp = ({ toggleModal }) => { { - togglePassword(!showPassword)}> + setShowPassword(!showPassword)}> @@ -148,26 +97,12 @@ const SignUp = ({ toggleModal }) => {