Skip to content

Commit

Permalink
Merge pull request #165 from PotLock/payout-update
Browse files Browse the repository at this point in the history
Payout-update
  • Loading branch information
M-Rb3 authored Jul 21, 2024
2 parents 76aa5fb + e40723e commit d82c686
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ type Props = {
stopPropagation?: boolean;
style?: React.CSSProperties;
target?: TargetValue;
key?: string;
iconSrc?: string;
children: string | React.ReactNode;
};

const Button = ({
key,
type,
varient,
name,
Expand Down Expand Up @@ -45,6 +47,7 @@ const Button = ({
style: style ?? {},
target: target,
...(href ? { href } : {}),
...(key ? { key } : {}),
...(name ? { name } : {}),
}}
>
Expand Down
14 changes: 11 additions & 3 deletions src/pages/Pot/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const Header = () => {
context.accountId && `&referrerId=${context.accountId}`
}`;

const canPayoutsBeProcessed = userIsAdminOrGreater && now >= cooldown_end_ms && !all_paid_out;
const canPayoutsBeProcessed = userIsAdminOrGreater && cooldown_end_ms && !all_paid_out;

const canPayoutsBeSet = userIsChefOrGreater && !all_paid_out && (now > cooldown_end_ms || !_cooldown_end_ms);

Expand Down Expand Up @@ -242,8 +242,16 @@ const Header = () => {
{existingChallengeForUser ? "Update challenge" : "Challenge payouts"}
</Button>
)}
{canPayoutsBeSet && <Button onClick={handleSetPayouts}> Set Payouts </Button>}
{canPayoutsBeProcessed && <Button onClick={handleProcessPayouts}>Process Payouts</Button>}
{canPayoutsBeSet && (
<Button key={"set-payout-btn"} onClick={handleSetPayouts}>
Set Payouts
</Button>
)}
{canPayoutsBeProcessed && (
<Button key={"process-payout-btn"} onClick={handleProcessPayouts}>
Process Payouts
</Button>
)}
</ButtonsWrapper>
<Referral>
<CopyIcon textToCopy={potLink} />
Expand Down

0 comments on commit d82c686

Please sign in to comment.