From 37a2e69dec05ef0c42478895e179bb40a0f5dfa9 Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Fri, 24 Nov 2023 16:30:43 -0500 Subject: [PATCH 1/2] staging deploy error ; capitalize SelectorStyles --- .../components/ProposalTypeSelect/ProposalTypeSelect.tsx | 4 ++-- .../components/ProposalTypeSelect/selectorStyles.ts | 2 +- src/shared/components/Form/Select/Select.tsx | 4 ++-- src/shared/components/Form/Select/selectorStyles.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx index 123d9d8eda..b7e87c2b06 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx @@ -4,7 +4,7 @@ import { useFormikContext } from "formik"; import { ProposalsTypes } from "@/shared/constants"; import { RightArrowThinIcon } from "@/shared/icons"; import { NewProposalCreationFormValues } from "@/shared/interfaces"; -import { selectorStyles } from "./selectorStyles"; +import { SelectorStyles } from "./selectorStyles"; import styles from "./ProposalTypeSelect.module.scss"; interface ProposalTypeSelectProps { @@ -52,7 +52,7 @@ const ProposalTypeSelect = ({ commonBalance }: ProposalTypeSelectProps) => { }} onBlur={handleBlur("proposalType")} hideSelectedOptions={false} - styles={selectorStyles(hasError)} + styles={SelectorStyles(hasError)} components={{ DropdownIndicator, }} diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts index f4002dd1f4..02834be093 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts @@ -1,7 +1,7 @@ import { ThemeColors } from "@/shared/constants"; import useThemeColor from "@/shared/hooks/useThemeColor"; -export const selectorStyles = (hasError: boolean) => { +export const SelectorStyles = (hasError: boolean) => { const { getThemeColor } = useThemeColor(); return { diff --git a/src/shared/components/Form/Select/Select.tsx b/src/shared/components/Form/Select/Select.tsx index 0bc8720731..9c8ba54f6e 100644 --- a/src/shared/components/Form/Select/Select.tsx +++ b/src/shared/components/Form/Select/Select.tsx @@ -4,7 +4,7 @@ import classNames from "classnames"; import { useFormikContext } from "formik"; import { RightArrowThinIcon } from "@/shared/icons"; import { SelectOptionType } from "@/shared/interfaces/Select"; -import { selectorStyles } from "./selectorStyles"; +import { SelectorStyles } from "./selectorStyles"; import styles from "./Select.module.scss"; interface FormSelectProps { @@ -54,7 +54,7 @@ const FormSelect: FC = ({ }} onBlur={handleBlur(formName)} hideSelectedOptions={false} - styles={selectorStyles(hasError)} + styles={SelectorStyles(hasError)} components={{ DropdownIndicator, }} diff --git a/src/shared/components/Form/Select/selectorStyles.ts b/src/shared/components/Form/Select/selectorStyles.ts index 8a85bf0e13..341639f46e 100644 --- a/src/shared/components/Form/Select/selectorStyles.ts +++ b/src/shared/components/Form/Select/selectorStyles.ts @@ -1,7 +1,7 @@ import { ThemeColors } from "@/shared/constants"; import useThemeColor from "@/shared/hooks/useThemeColor"; -export const selectorStyles = (hasError: boolean) => { +export const SelectorStyles = (hasError: boolean) => { const { getThemeColor } = useThemeColor(); return { From d06ea4fcefc4d3ee4a91bac5a661ef137c09bd55 Mon Sep 17 00:00:00 2001 From: Pavel Meyer Date: Mon, 27 Nov 2023 11:22:24 +0300 Subject: [PATCH 2/2] CW-Hotfix-staging Fix code --- .../components/ProposalTypeSelect/ProposalTypeSelect.tsx | 9 ++++++--- .../components/ProposalTypeSelect/selectorStyles.ts | 5 +---- src/shared/components/Form/Select/Select.tsx | 7 +++++-- src/shared/components/Form/Select/selectorStyles.ts | 5 +---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx index b7e87c2b06..6242d133de 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/ProposalTypeSelect.tsx @@ -4,7 +4,8 @@ import { useFormikContext } from "formik"; import { ProposalsTypes } from "@/shared/constants"; import { RightArrowThinIcon } from "@/shared/icons"; import { NewProposalCreationFormValues } from "@/shared/interfaces"; -import { SelectorStyles } from "./selectorStyles"; +import useThemeColor from "@/shared/hooks/useThemeColor"; +import { selectorStyles } from "./selectorStyles"; import styles from "./ProposalTypeSelect.module.scss"; interface ProposalTypeSelectProps { @@ -37,7 +38,9 @@ const getProposalOptions = (commonBalance: number) => { const ProposalTypeSelect = ({ commonBalance }: ProposalTypeSelectProps) => { const { values, setFieldValue, handleBlur, touched, errors } = - useFormikContext(); + useFormikContext(); + + const { getThemeColor } = useThemeColor(); const hasError = Boolean(touched.proposalType && errors.proposalType); return ( @@ -52,7 +55,7 @@ const ProposalTypeSelect = ({ commonBalance }: ProposalTypeSelectProps) => { }} onBlur={handleBlur("proposalType")} hideSelectedOptions={false} - styles={SelectorStyles(hasError)} + styles={selectorStyles(hasError, getThemeColor)} components={{ DropdownIndicator, }} diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts index 02834be093..2c8a90ff5b 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalTypeSelect/selectorStyles.ts @@ -1,9 +1,6 @@ import { ThemeColors } from "@/shared/constants"; -import useThemeColor from "@/shared/hooks/useThemeColor"; - -export const SelectorStyles = (hasError: boolean) => { - const { getThemeColor } = useThemeColor(); +export const selectorStyles = (hasError: boolean, getThemeColor: (color: ThemeColors) => string) => { return { menu: (provided) => ({ ...provided, zIndex: 10000 }), menuPortal: (provided) => ({ ...provided, zIndex: 10000 }), diff --git a/src/shared/components/Form/Select/Select.tsx b/src/shared/components/Form/Select/Select.tsx index 9c8ba54f6e..7a73da21d5 100644 --- a/src/shared/components/Form/Select/Select.tsx +++ b/src/shared/components/Form/Select/Select.tsx @@ -2,9 +2,10 @@ import React, { FC } from "react"; import Select, { components, DropdownIndicatorProps } from "react-select"; import classNames from "classnames"; import { useFormikContext } from "formik"; +import useThemeColor from "@/shared/hooks/useThemeColor"; import { RightArrowThinIcon } from "@/shared/icons"; import { SelectOptionType } from "@/shared/interfaces/Select"; -import { SelectorStyles } from "./selectorStyles"; +import { selectorStyles } from "./selectorStyles"; import styles from "./Select.module.scss"; interface FormSelectProps { @@ -38,6 +39,8 @@ const FormSelect: FC = ({ }) => { const { values, setFieldValue, handleBlur, touched, errors } = useFormikContext>(); + + const { getThemeColor } = useThemeColor(); const hasError = Boolean(touched[formName] && errors[formName]); return ( @@ -54,7 +57,7 @@ const FormSelect: FC = ({ }} onBlur={handleBlur(formName)} hideSelectedOptions={false} - styles={SelectorStyles(hasError)} + styles={selectorStyles(hasError, getThemeColor)} components={{ DropdownIndicator, }} diff --git a/src/shared/components/Form/Select/selectorStyles.ts b/src/shared/components/Form/Select/selectorStyles.ts index 341639f46e..9de9905eb7 100644 --- a/src/shared/components/Form/Select/selectorStyles.ts +++ b/src/shared/components/Form/Select/selectorStyles.ts @@ -1,9 +1,6 @@ import { ThemeColors } from "@/shared/constants"; -import useThemeColor from "@/shared/hooks/useThemeColor"; - -export const SelectorStyles = (hasError: boolean) => { - const { getThemeColor } = useThemeColor(); +export const selectorStyles = (hasError: boolean, getThemeColor: (color: ThemeColors) => string) => { return { menu: (provided) => ({ ...provided, zIndex: 10000 }), menuPortal: (provided) => ({ ...provided, zIndex: 10000 }),