Skip to content

Commit

Permalink
feat: wallet UI claim rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
namgold committed Jul 27, 2023
1 parent 922c45f commit 254a328
Show file tree
Hide file tree
Showing 33 changed files with 812 additions and 665 deletions.
20 changes: 11 additions & 9 deletions src/assets/svg/dollar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
271 changes: 89 additions & 182 deletions src/assets/svg/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/Announcement/Popups/TransactionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const SUMMARY: { [type in TRANSACTION_TYPE]: SummaryFunction } = {
[TRANSACTION_TYPE.CANCEL_LIMIT_ORDER]: summaryCancelLimitOrder,
[TRANSACTION_TYPE.TRANSFER_TOKEN]: summaryTransferToken,

[TRANSACTION_TYPE.KYBERDAO_CLAIM_GAS_REFUND]: summary1Token, //todo namgold
[TRANSACTION_TYPE.KYBERDAO_CLAIM]: summary1Token,
[TRANSACTION_TYPE.KYBERDAO_UNDELEGATE]: summaryDelegateDao,
[TRANSACTION_TYPE.KYBERDAO_MIGRATE]: summary2Token,
Expand Down
9 changes: 8 additions & 1 deletion src/components/Header/groups/KyberDaoGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ const KyberDAONavGroup = () => {
<VoteIcon />
<Trans>Vote</Trans>
</StyledNavLink>
<StyledNavLink id="knc-utility" to={APP_PATHS.KYBERDAO_KNC_UTILITY} style={{ gap: '4px' }}>
<StyledNavLink
id="knc-utility"
to={APP_PATHS.KYBERDAO_KNC_UTILITY}
style={{ gap: '4px' }}
onClick={() => {
mixpanelHandler(MIXPANEL_TYPE.GAS_REFUND_SOURCE_CLICK, { source: 'KyberDAO_tab' })
}}
>
<KyberLogo width={16} height={16} />
<Trans>KNC Utility</Trans>
</StyledNavLink>
Expand Down
7 changes: 5 additions & 2 deletions src/components/Icons/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import React from 'react'

import sprite from 'assets/svg/sprite.svg'
import { ICON_ID } from 'constants/index'

export default function Icon({
id,
size,
style,
color,
...rest
}: {
id: string
id: ICON_ID
size?: number | string
color?: string
style?: React.CSSProperties
title?: string
}) {
return (
<div style={style} {...rest}>
<svg width={size || 24} height={size || 24} display="block">
<svg width={size || 24} height={size || 24} display="block" color={color}>
<use href={`${sprite}#${id}`} width={size || 24} height={size || 24} />
</svg>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/SwapForm/TradeSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ const TradeSummary: React.FC<Props> = ({ routeSummary, slippage }) => {
</MouseoverTooltip>
</TextDashed>
</RowFixed>
<NavLink to={APP_PATHS.KYBERDAO_KNC_UTILITY}>
<NavLink
to={APP_PATHS.KYBERDAO_KNC_UTILITY}
onClick={() => {
mixpanelHandler(MIXPANEL_TYPE.GAS_REFUND_SOURCE_CLICK, { source: 'Swap_page_more_info' })
}}
>
<ButtonLight padding="0px 8px" width="fit-content" fontSize={10} fontWeight={500} lineHeight="16px">
<Trans>{account ? gasRefundPerCentage * 100 : '--'}% Refund</Trans>
</ButtonLight>
Expand Down
4 changes: 3 additions & 1 deletion src/components/WalletPopup/AccountInfo/ActionButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ReactComponent as DollarIcon } from 'assets/svg/dollar.svg'
import { ButtonLight } from 'components/Button'
import SendIcon from 'components/Icons/SendIcon'
import { ClickHandlerProps } from 'components/WalletPopup/AccountInfo'
import useTheme from 'hooks/useTheme'

const ActionButton = styled(ButtonLight)`
flex: 0 1 105px;
Expand All @@ -17,6 +18,7 @@ type Props = {
className?: string
} & ClickHandlerProps
const ActionButtonGroup: React.FC<Props> = ({ onClickBuy, onClickReceive, onClickSend, className, disabledSend }) => {
const theme = useTheme()
return (
<Flex
className={className}
Expand All @@ -26,7 +28,7 @@ const ActionButtonGroup: React.FC<Props> = ({ onClickBuy, onClickReceive, onClic
}}
>
<ActionButton onClick={onClickBuy}>
<DollarIcon />
<DollarIcon color={theme.primary} />
<Text as="span" marginLeft="7px">
<Trans>Buy</Trans>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ReactComponent as DollarIcon } from 'assets/svg/dollar.svg'
import { ButtonLight } from 'components/Button'
import SendIcon from 'components/Icons/SendIcon'
import { ClickHandlerProps } from 'components/WalletPopup/AccountInfo'
import useTheme from 'hooks/useTheme'

const MinimalActionButton = styled(ButtonLight)`
flex: 0 0 36px;
Expand All @@ -23,6 +24,7 @@ const MinimalActionButtonGroup: React.FC<Props> = ({
className,
disabledSend,
}) => {
const theme = useTheme()
return (
<Flex
className={className}
Expand All @@ -33,7 +35,7 @@ const MinimalActionButtonGroup: React.FC<Props> = ({
}}
>
<MinimalActionButton onClick={onClickBuy}>
<DollarIcon width={'24px'} height={'24px'} />
<DollarIcon width={'24px'} height={'24px'} color={theme.primary} />
</MinimalActionButton>
<MinimalActionButton onClick={onClickReceive}>
<SendIcon size={14} style={{ transform: 'rotate(180deg)' }} />
Expand Down
80 changes: 0 additions & 80 deletions src/components/WalletPopup/AccountInfo/Settings.tsx

This file was deleted.

Loading

0 comments on commit 254a328

Please sign in to comment.