diff --git a/packages/react-app-revamp/components/Share/index.tsx b/packages/react-app-revamp/components/Share/index.tsx index bc9fbabe6..21501f004 100644 --- a/packages/react-app-revamp/components/Share/index.tsx +++ b/packages/react-app-revamp/components/Share/index.tsx @@ -18,10 +18,9 @@ interface ShareDropdownProps { contestName: string; contestAddress: string; chain: string; - onMenuStateChange?: (isOpen: boolean) => void; } -const ShareDropdown: FC<ShareDropdownProps> = ({ contestName, contestAddress, chain, onMenuStateChange }) => { +const ShareDropdown: FC<ShareDropdownProps> = ({ contestName, contestAddress, chain }) => { const [isCopied, setIsCopied] = useState(false); useEffect(() => { @@ -42,8 +41,6 @@ const ShareDropdown: FC<ShareDropdownProps> = ({ contestName, contestAddress, ch return ( <Menu as="div" className="relative inline-block text-left"> {({ open }) => { - onMenuStateChange?.(open); - return ( <> <MediaQuery maxWidth={768}> diff --git a/packages/react-app-revamp/components/_pages/Contest/Contest/index.tsx b/packages/react-app-revamp/components/_pages/Contest/Contest/index.tsx index a1e257de6..4021e0338 100644 --- a/packages/react-app-revamp/components/_pages/Contest/Contest/index.tsx +++ b/packages/react-app-revamp/components/_pages/Contest/Contest/index.tsx @@ -37,7 +37,6 @@ const ContestTab = () => { const qualifiedToSubmit = currentUserQualifiedToSubmit && currentUserProposalCount < contestMaxNumberSubmissionsPerUser; const isMobile = useMediaQuery({ maxWidth: 768 }); - const [blurProposals, setBlurProposals] = useState(false); const isInPwaMode = window.matchMedia("(display-mode: standalone)").matches; const { contestState } = useContestStateStore(state => state); const isContestCanceled = contestState === ContestStateEnum.Canceled; @@ -98,18 +97,11 @@ const ContestTab = () => { <div className={`mt-4 ${isInPwaMode ? "mb-12" : "mb-0"}`}> <div className="flex flex-col gap-2"> {contestStatus !== ContestStatus.ContestOpen && !isContestLoading && ( - <ProposalStatistics - contestStatus={contestStatus} - onMenuStateChange={(value: boolean) => setBlurProposals(value)} - /> + <ProposalStatistics contestStatus={contestStatus} /> )} {!isContestLoading && !isListProposalsLoading && isContestSuccess && isListProposalsSuccess && ( - <div - className={`animate-reveal ${contestStatus !== ContestStatus.SubmissionOpen ? "mt-4" : "mt-0"} ${ - blurProposals ? "blurProposals" : "" - }`} - > + <div className={`animate-reveal ${contestStatus !== ContestStatus.SubmissionOpen ? "mt-4" : "mt-0"}`}> <ListProposals /> </div> )} diff --git a/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/components/SortDropdown/index.tsx b/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/components/SortDropdown/index.tsx index 20bb7a001..6cb6a6efc 100644 --- a/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/components/SortDropdown/index.tsx +++ b/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/components/SortDropdown/index.tsx @@ -16,10 +16,9 @@ const options = [ interface SortProposalsDropdownProps { defaultValue: string; onChange?: (value: string) => void; - onMenuStateChange?: (isOpen: boolean) => void; } -const SortProposalsDropdown: FC<SortProposalsDropdownProps> = ({ defaultValue, onChange, onMenuStateChange }) => { +const SortProposalsDropdown: FC<SortProposalsDropdownProps> = ({ defaultValue, onChange }) => { const [selectedValue, setSelectedValue] = useState(defaultValue); const menuRef = useRef<HTMLDivElement>(null); @@ -33,8 +32,6 @@ const SortProposalsDropdown: FC<SortProposalsDropdownProps> = ({ defaultValue, o return ( <Menu as="div" className="relative inline-block text-left" ref={menuRef}> {({ open }) => { - onMenuStateChange?.(open); - return ( <> <MenuButton className="flex items-center gap-2 text-[16px] text-positive-11 w-full"> diff --git a/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/index.tsx b/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/index.tsx index 5771a6da9..31ebb8e54 100644 --- a/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/index.tsx +++ b/packages/react-app-revamp/components/_pages/Contest/components/ProposalStatistics/index.tsx @@ -12,10 +12,9 @@ import { chains } from "@config/wagmi"; interface ProposalStatisticsProps { contestStatus: ContestStatus; - onMenuStateChange: (isOpen: boolean) => void; } -const ProposalStatistics: FC<ProposalStatisticsProps> = ({ contestStatus, onMenuStateChange }) => { +const ProposalStatistics: FC<ProposalStatisticsProps> = ({ contestStatus }) => { const asPath = usePathname(); const { chainName, address } = extractPathSegments(asPath ?? ""); const chainId = chains.filter(chain => chain.name.toLowerCase() === chainName.toLowerCase())[0]?.id; @@ -62,11 +61,7 @@ const ProposalStatistics: FC<ProposalStatisticsProps> = ({ contestStatus, onMenu <div className="flex flex-col md:flex-row gap-4 md:justify-between md:items-center border-b border-primary-2 pb-4"> <ProposalStatisticsPanel submissionsCount={submissionsCount} contestStatus={contestStatus} /> {submissionsCount > 1 ? ( - <SortProposalsDropdown - defaultValue={sortBy ?? ""} - onChange={handleSortTypeChange} - onMenuStateChange={onMenuStateChange} - /> + <SortProposalsDropdown defaultValue={sortBy ?? ""} onChange={handleSortTypeChange} /> ) : null} </div> </div> diff --git a/packages/react-app-revamp/layouts/LayoutViewContest/index.tsx b/packages/react-app-revamp/layouts/LayoutViewContest/index.tsx index fef9ae31b..a46bcb494 100644 --- a/packages/react-app-revamp/layouts/LayoutViewContest/index.tsx +++ b/packages/react-app-revamp/layouts/LayoutViewContest/index.tsx @@ -62,7 +62,6 @@ const LayoutViewContest = ({ children }: { children: React.ReactNode }) => { const [tab, setTab] = useState<Tab>(Tab.Contest); const isMobile = useMediaQuery({ maxWidth: 768 }); const bugReportLink = populateBugReportLink(url?.href ?? "", accountAddress ?? "", error ?? ""); - const [fadeBg, setFadeBg] = useState(false); useAccountEffect({ onConnect(data) { @@ -253,12 +252,7 @@ const LayoutViewContest = ({ children }: { children: React.ReactNode }) => { <Image src="/forward.svg" alt="share" width={15} height={13} /> </div> ) : ( - <ShareDropdown - contestAddress={address} - chain={chainName} - contestName={contestName} - onMenuStateChange={setFadeBg} - /> + <ShareDropdown contestAddress={address} chain={chainName} contestName={contestName} /> )} <div @@ -269,7 +263,7 @@ const LayoutViewContest = ({ children }: { children: React.ReactNode }) => { </div> </div> </div> - <div className={`${fadeBg ? "opacity-30" : "opacity-100"}`}> + <div> <div className="mt-8 mb-8 gap-3 flex flex-col"> <ContestTabs tab={tab} onChange={tab => setTab(tab)} /> </div>