-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: onramp fixes an cleanup (#8656)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview ### Focus of this PR: This PR focuses on making changes to the BuyCrypto feature in the web app. It includes updates to styles, types, components, and constants related to BuyCrypto. ### Detailed summary: - Updated styles in `BuyCrypto/styles.tsx` and added a new styled component `DropdownWrapper`. - Updated types in `BuyCrypto/types.ts`. - Updated the `toggleAccordianVisibility` function in `Accordion.tsx`. - Removed an entry in the `pancake-supported-onramp-currency-list.json` file. - Added a new import and updated the `CryptoCard` component in `Card/index.tsx`. - Added a new component `BuyCryptoTooltip` in `Tooltip.tsx`. - Added a new component `ProviderCampaign` in `ProviderCampaign.tsx`. - Updated the `BuyCryptoForm` component in `BuyCryptoForm.tsx`. - Updated constants in `constants.ts`. - Updated translations in `translations.json`. > The following files were skipped due to too many changes: `packages/localization/src/config/translations.json`, `apps/web/src/views/BuyCrypto/components/AccordionDropdown/AccordionItem.tsx` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
1 parent
67f1dc8
commit 589a21c
Showing
11 changed files
with
227 additions
and
169 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
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
233 changes: 99 additions & 134 deletions
233
apps/web/src/views/BuyCrypto/components/AccordionDropdown/AccordionItem.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
45 changes: 45 additions & 0 deletions
45
apps/web/src/views/BuyCrypto/components/ProviderCampaign/ProviderCampaign.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,45 @@ | ||
import { useTranslation } from '@pancakeswap/localization' | ||
import { Box, Flex, Text } from '@pancakeswap/uikit' | ||
import getTimePeriods from '@pancakeswap/utils/getTimePeriods' | ||
import Image from 'next/image' | ||
import { CURRENT_CAMPAIGN_TIMESTAMP, ONRAMP_PROVIDERS } from 'views/BuyCrypto/constants' | ||
import pocketWatch from '../../../../../public/images/pocket-watch.svg' | ||
|
||
const activeCampaigns: { [provider in keyof typeof ONRAMP_PROVIDERS]: boolean } = { | ||
[ONRAMP_PROVIDERS.Mercuryo]: false, | ||
[ONRAMP_PROVIDERS.MoonPay]: false, | ||
[ONRAMP_PROVIDERS.Transak]: false, | ||
} | ||
|
||
const ProviderCampaign = ({ provider }: { provider: keyof typeof ONRAMP_PROVIDERS }) => { | ||
const { t } = useTranslation() | ||
|
||
const currentTimestamp = Math.floor(Date.now() / 1000) | ||
const { | ||
days, | ||
hours, | ||
minutes, | ||
seconds: campaignEndTimeInSeconds, | ||
} = getTimePeriods(currentTimestamp - CURRENT_CAMPAIGN_TIMESTAMP) | ||
|
||
return ( | ||
<> | ||
{activeCampaigns[provider] && campaignEndTimeInSeconds >= 1 ? ( | ||
<Box mt="16px" background="#F0E4E2" padding="16px" border="1px solid #D67E0A" borderRadius="16px"> | ||
<Flex> | ||
<Image src={pocketWatch} alt="pocket-watch" height={30} width={30} /> | ||
<Text marginLeft="14px" fontSize="15px" color="#D67E0B"> | ||
{t('No provider fees. Ends in %days% days and %hours% hours and %minutes% minutes.', { | ||
days, | ||
hours, | ||
minutes, | ||
})} | ||
</Text> | ||
</Flex> | ||
</Box> | ||
) : null} | ||
</> | ||
) | ||
} | ||
|
||
export default ProviderCampaign |
Oops, something went wrong.
589a21c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
uikit – ./packages/uikit
uikit-git-develop.pancake.run
uikit.pancake.run
589a21c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./apps/web
pancake-prod.vercel.app
pancakeswap.finance
web2.pancake.run
web.pancake.run
www.pancakeswap.finance
web-git-develop.pancake.run