Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vote with BNT #753

Merged
merged 9 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Open Source Token Swap and Pool Liquidity Portal
| | City |
| --------------- | ------------------------------------------------------------------- |
| Jan Langheimer | [Freiburg](https://www.timeanddate.com/worldclock/germany/freiburg) |
| Ran Cohen | [Tel Aviv](https://www.timeanddate.com/worldclock/israel/tel-aviv) |
| Doron Z | [Tel Aviv](https://www.timeanddate.com/worldclock/israel/tel-aviv) |

## How to contribute
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const Playground: ComponentStory<typeof Button> = (args) => (
Playground.args = {
children: 'Primary Button',
variant: ButtonVariant.Primary,
size: ButtonSize.Meduim,
size: ButtonSize.Medium,
disabled: false,
className: '',
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export enum ButtonSize {
Full,
ExtraLarge,
Large,
Meduim,
Medium,
Small,
ExtraSmall,
}
Expand Down Expand Up @@ -45,7 +45,7 @@ const getSizeStyle = (size: ButtonSize) => {
return 'w-[428px] h-[53px]';
case ButtonSize.Large:
return 'w-[335px] h-[53px]';
case ButtonSize.Meduim:
case ButtonSize.Medium:
return 'w-[266px] h-[47px]';
case ButtonSize.Small:
return 'w-[142px] h-[39px]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const V3WithdrawConfirmInfo = ({ handleCancelClick }: Props) => {
<Button
className="mt-50"
onClick={handleCancelClick}
size={ButtonSize.Meduim}
size={ButtonSize.Medium}
variant={ButtonVariant.Secondary}
>
Cancel withdrawal
Expand Down
19 changes: 10 additions & 9 deletions src/elements/modalVbnt/ModalVbnt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ export const ModalVbnt = ({
}, [amount, token, percentages, fieldBlance]);

const handleStakeUnstake = async () => {
setAmount('');
if (stakeDisabled || !account) return;

sendGovEvent(GovEvent.Click, govProperties, stake);
sendGovEvent(GovEvent.WalletRequest, govProperties, stake);
if (stake)
await stakeAmount(
amount,
token,
(txHash: string) => {
stakeNotification(dispatch, amount, txHash);
stakeNotification(dispatch, amount, txHash, token.symbol);
sendGovEvent(GovEvent.WalletConfirm, govProperties, stake);
},
() => {
Expand All @@ -98,7 +98,7 @@ export const ModalVbnt = ({
sendGovEvent(GovEvent.Failed, govProperties, stake, undefined, error);
},
(error: string) => {
stakeFailedNotification(dispatch, amount);
stakeFailedNotification(dispatch, amount, token.symbol);
sendGovEvent(GovEvent.Failed, govProperties, stake, undefined, error);
}
);
Expand All @@ -107,7 +107,7 @@ export const ModalVbnt = ({
amount,
token,
(txHash: string) => {
unstakeNotification(dispatch, amount, txHash);
unstakeNotification(dispatch, amount, txHash, token.symbol);
sendGovEvent(GovEvent.WalletConfirm, govProperties, stake);
},
() => {
Expand All @@ -119,7 +119,7 @@ export const ModalVbnt = ({
sendGovEvent(GovEvent.Failed, govProperties, stake, undefined, error);
},
(error: string) => {
unstakeFailedNotification(dispatch, amount);
unstakeFailedNotification(dispatch, amount, token.symbol);
sendGovEvent(GovEvent.Failed, govProperties, stake, undefined, error);
}
);
Expand All @@ -128,7 +128,9 @@ export const ModalVbnt = ({
const [checkApprove, ModalApprove] = useApproveModal(
[{ amount: amount, token: token }],
handleStakeUnstake,
ApprovalContract.Governance,
token.symbol === 'BNT'
? ApprovalContract.GovernanceBnt
: ApprovalContract.GovernanceVbnt,
() => sendGovEvent(GovEvent.UnlimitedPopup, govProperties, stake),
(isUnlimited: boolean) =>
sendGovEvent(
Expand All @@ -148,7 +150,7 @@ export const ModalVbnt = ({
return (
<>
<Modal
title={`${stake ? 'Stake' : 'Unstake'} vBNT`}
title={`${stake ? 'Stake' : 'Unstake'} ${token.symbol}`}
titleElement={<SwapSwitch />}
setIsOpen={setIsOpen}
isOpen={isOpen}
Expand All @@ -167,7 +169,6 @@ export const ModalVbnt = ({
/>
<Button
onClick={() => {
setAmount('');
setIsOpen(false);
if (stake) checkApprove();
else handleStakeUnstake();
Expand All @@ -176,7 +177,7 @@ export const ModalVbnt = ({
className="mt-30 mb-20"
size={ButtonSize.Full}
>
{`${stake ? 'Stake' : 'Unstake'} vBNT`}
{`${stake ? 'Stake' : 'Unstake'} ${token.symbol}`}
</Button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/elements/walletConnect/WalletConnectRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const WalletConnectRequest = () => {
</div>
<Button
variant={ButtonVariant.Secondary}
size={ButtonSize.Meduim}
size={ButtonSize.Medium}
onClick={() => handleWalletButtonClick()}
>
Connect Wallet
Expand Down
4 changes: 2 additions & 2 deletions src/pages/UnsupportedNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const UnsupportedNetwork = () => {
<div className="flex items-center gap-15">
<Button
variant={ButtonVariant.Secondary}
size={isMobile ? ButtonSize.Small : ButtonSize.Meduim}
size={isMobile ? ButtonSize.Small : ButtonSize.Medium}
>
<Navigate
to="https://support.bancor.network/hc/en-us/articles/5463892405010-MetaMask-Setup-Guide"
Expand All @@ -29,7 +29,7 @@ export const UnsupportedNetwork = () => {
</Button>
<Button
variant={ButtonVariant.Primary}
size={isMobile ? ButtonSize.Small : ButtonSize.Meduim}
size={isMobile ? ButtonSize.Small : ButtonSize.Medium}
onClick={() => requestSwitchChain()}
>
Switch Network
Expand Down
Loading
Loading