mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 15:48:23 -05:00
don't show sugg button front if voting has started
This commit is contained in:
@@ -12,6 +12,7 @@ import MyHead from "components/common/MyHead";
|
||||
import SubText from "components/common/SubText";
|
||||
import { useUser } from "hooks/common";
|
||||
import { Fragment } from "react";
|
||||
import { getVotingRange } from "utils/plus";
|
||||
import { getFullUsername } from "utils/strings";
|
||||
import Suggestion from "./Suggestion";
|
||||
import SuggestionModal from "./SuggestionModal";
|
||||
@@ -35,16 +36,22 @@ const PlusHomePage = () => {
|
||||
<Box fontSize="sm" mb={4}>
|
||||
<VotingInfoHeader isMember={!!plusStatusData?.membershipTier} />
|
||||
</Box>
|
||||
{plusStatusData && plusStatusData.membershipTier && !ownSuggestion && (
|
||||
<SuggestionModal
|
||||
userPlusMembershipTier={plusStatusData.membershipTier}
|
||||
/>
|
||||
{!getVotingRange().isHappening && (
|
||||
<>
|
||||
{plusStatusData &&
|
||||
plusStatusData.membershipTier &&
|
||||
!ownSuggestion && (
|
||||
<SuggestionModal
|
||||
userPlusMembershipTier={plusStatusData.membershipTier}
|
||||
/>
|
||||
)}
|
||||
{plusStatusData &&
|
||||
plusStatusData.canVouchFor &&
|
||||
!plusStatusData.canVouchAgainAfter && (
|
||||
<VouchModal canVouchFor={plusStatusData.canVouchFor} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{plusStatusData &&
|
||||
plusStatusData.canVouchFor &&
|
||||
!plusStatusData.canVouchAgainAfter && (
|
||||
<VouchModal canVouchFor={plusStatusData.canVouchFor} />
|
||||
)}
|
||||
{plusStatusData &&
|
||||
(plusStatusData.canVouchAgainAfter ||
|
||||
plusStatusData.voucher ||
|
||||
|
||||
@@ -18,6 +18,7 @@ import { useMyTheme } from "hooks/common";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { getVotingRange } from "utils/plus";
|
||||
import { getFullUsername } from "utils/strings";
|
||||
import { trpc } from "utils/trpc";
|
||||
import { Unpacked } from "utils/types";
|
||||
@@ -95,7 +96,7 @@ const Suggestion = ({
|
||||
</Box>
|
||||
);
|
||||
})}
|
||||
{canSuggest && !showTextarea && (
|
||||
{canSuggest && !showTextarea && !getVotingRange().isHappening && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user