-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix ratio slider * Switch from active to all queries * Add link to powered by Joystream * Minor fixes * Crt marketplace table fixes * Allow to start revenue share with amm active * Remove default isVerified true * Prevent amm slope tx failure * Allow holder to stake vested tokens * Encapsulate claim rev share logic inside single component * Avoid safe integer bloat * Revenue share related fixes * Change vested to unlocked for HoldersWidget.tsx * Add revenue share to payments table * Add revenue share button for channels with token * Fixes 02.04 * Block amm transactions during revenue share
- Loading branch information
Showing
55 changed files
with
494 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/atlas/src/api/queries/__generated__/baseTypes.generated.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 40 additions & 1 deletion
41
packages/atlas/src/api/queries/__generated__/channels.generated.tsx
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/atlas/src/components/_crt/ClaimRevenueShareButton/ClaimRevenueShareButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useState } from 'react' | ||
|
||
import { FullCreatorTokenFragment } from '@/api/queries/__generated__/fragments.generated' | ||
import { Button, ButtonProps } from '@/components/_buttons/Button' | ||
import { ClaimShareModal } from '@/components/_crt/ClaimShareModal' | ||
import { useSnackbar } from '@/providers/snackbars' | ||
|
||
export type ClaimRevenueShareButtonProps = { | ||
token: FullCreatorTokenFragment | ||
disabled?: boolean | ||
} & Pick<ButtonProps, 'variant' | 'size' | 'fullWidth'> | ||
|
||
export const ClaimRevenueShareButton = ({ token, ...btnProps }: ClaimRevenueShareButtonProps) => { | ||
const [openClaimShareModal, setOpenClaimShareModal] = useState(false) | ||
const { displaySnackbar } = useSnackbar() | ||
const hasActiveRevenueShare = token.revenueShares.some((revenueShare) => !revenueShare.finalized) | ||
|
||
return ( | ||
<> | ||
<Button | ||
{...btnProps} | ||
onClick={() => { | ||
if (!hasActiveRevenueShare) { | ||
displaySnackbar({ | ||
iconType: 'info', | ||
title: 'No active revenue share to claim', | ||
}) | ||
return | ||
} | ||
|
||
setOpenClaimShareModal(true) | ||
}} | ||
> | ||
Stake your tokens | ||
</Button> | ||
<ClaimShareModal onClose={() => setOpenClaimShareModal(false)} show={openClaimShareModal} tokenId={token.id} /> | ||
</> | ||
) | ||
} |
Oops, something went wrong.