forked from vegaprotocol/frontend-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trading): enable simple reward cards
- Loading branch information
Showing
5 changed files
with
81 additions
and
90 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
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
50 changes: 37 additions & 13 deletions
50
apps/trading/components/rewards-container/simple-reward-cards-container.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 |
---|---|---|
@@ -1,23 +1,47 @@ | ||
import { SimpleRewardCard } from './simple-reward-card'; | ||
import { Loader } from '@vegaprotocol/ui-toolkit'; | ||
import { ExternalLink, Loader } from '@vegaprotocol/ui-toolkit'; | ||
import { useRewardCards } from '@vegaprotocol/rest'; | ||
import { Trans } from 'react-i18next'; | ||
import { DocsLinks } from '@vegaprotocol/environment'; | ||
import { useT } from '../../lib/use-t'; | ||
|
||
export const SimpleRewardCardsContainer = () => { | ||
const t = useT(); | ||
const { data, isLoading } = useRewardCards(); | ||
|
||
if (isLoading) { | ||
return ( | ||
<div> | ||
<Loader /> | ||
</div> | ||
); | ||
} | ||
if (!data.length) return null; | ||
|
||
return ( | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4"> | ||
{data?.map((card) => { | ||
return <SimpleRewardCard key={card.rewardId} {...card} />; | ||
})} | ||
</div> | ||
<section className="mb-12"> | ||
<h2 className="text-2xl mb-1">{t('Games')}</h2> | ||
<p className="mb-6 text-sm"> | ||
<Trans | ||
i18nKey={ | ||
'See all the live games on the cards below. <0>Find out how to create one</0>.' | ||
} | ||
components={[ | ||
<ExternalLink | ||
className="underline" | ||
key="find-out" | ||
href={DocsLinks?.ASSET_TRANSFER_PROPOSAL} | ||
> | ||
Find out how to create one | ||
</ExternalLink>, | ||
]} | ||
/> | ||
{/** Docs: https://docs.vega.xyz/mainnet/tutorials/proposals/asset-transfer-proposal */} | ||
</p> | ||
<div className="mb-12 flex flex-col"> | ||
{isLoading ? ( | ||
<Loader /> | ||
) : ( | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6"> | ||
{data?.map((card) => { | ||
return <SimpleRewardCard key={card.rewardId} {...card} />; | ||
})} | ||
</div> | ||
)} | ||
</div> | ||
</section> | ||
); | ||
}; |
This file was deleted.
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