Skip to content

Commit

Permalink
add option all chains
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Oct 5, 2023
1 parent 732ada9 commit c70b94e
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 284 deletions.
54 changes: 54 additions & 0 deletions src/pages/MyEarnings/MultipleChainSelectV2/ApplyButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Trans } from '@lingui/macro'
import { MouseEventHandler } from 'react'
import { Flex } from 'rebass'

import { ButtonPrimary } from 'components/Button'
import useTheme from 'hooks/useTheme'

type ApplyButtonProps = {
disabled: boolean
onClick: MouseEventHandler<HTMLButtonElement>
numOfChains: number
}

export const ApplyButton: React.FC<ApplyButtonProps> = ({ disabled, onClick, numOfChains }) => {
const theme = useTheme()
return (
<ButtonPrimary
disabled={disabled}
style={{
height: '40px',
padding: '0 12px',
}}
onClick={onClick}
>
<Flex
as="span"
sx={{
width: '100%',
display: 'inline-flex',
justifyContent: 'space-between',
alignItems: 'center',
gap: '4px',
}}
>
<Trans>View Selected Chains</Trans>
<Flex
as="span"
sx={{
width: '22px',
height: '22px',
borderRadius: '999px',
display: 'inline-flex',
justifyContent: 'center',
alignItems: 'center',
background: disabled ? undefined : theme.darkText,
color: disabled ? theme.border : theme.primary,
}}
>
{numOfChains ? String(numOfChains).padStart(2, '0') : 0}
</Flex>
</Flex>
</ButtonPrimary>
)
}
257 changes: 0 additions & 257 deletions src/pages/MyEarnings/MultipleChainSelectV2/PopoverBody.tsx

This file was deleted.

14 changes: 2 additions & 12 deletions src/pages/MyEarnings/MultipleChainSelectV2/SelectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,8 @@ const Label = styled.span<{ labelColor?: string }>`
overflow: hidden;
text-overflow: ellipsis;
`
type Props = {
onClick: () => void
} & MultipleChainSelectProps
const SelectButton: React.FC<Props> = ({
onClick,
selectedChainIds,
chainIds,
activeRender,
activeStyle,
labelColor,
}) => {
type Props = MultipleChainSelectProps
const SelectButton: React.FC<Props> = ({ selectedChainIds, chainIds, activeRender, activeStyle, labelColor }) => {
const theme = useTheme()

const renderButtonBody = () => {
Expand Down Expand Up @@ -88,7 +79,6 @@ const SelectButton: React.FC<Props> = ({
cursor: 'pointer',
...activeStyle,
}}
onClick={onClick}
>
{activeRender ? activeRender(renderButtonBody()) : renderButtonBody()}
</Flex>
Expand Down
Loading

0 comments on commit c70b94e

Please sign in to comment.