-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
New Design for Table component on Farms page #482
Conversation
fix: add defaultProps for Cell component
…ke-frontend into table-update
…ontend into feature/farms-table
@@ -17,13 +17,36 @@ interface FarmCardActionsProps { | |||
addLiquidityUrl?: string | |||
} | |||
|
|||
const StyledHeading = styled(Heading)` | |||
margin-right: 48px; |
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.
Instead of creating a component for this, you can use the prop mr
on Heading
end: earningsBusd, | ||
duration: 1, | ||
separator: ',', | ||
// eslint-disable-next-line no-nested-ternary |
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.
remove this please
export const Staked = styled.div` | ||
font-size: 12px; | ||
color: ${(props) => props.theme.colors.textSubtle}; | ||
` |
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.
this file hasn't been prettified
info: string | ||
} | ||
|
||
const StyledLinkExternal = styled(LinkExternal)` |
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.
if you don't want to display the svg, use the Link
component , with the external
props
const TranslateString = useI18n() | ||
|
||
return ( | ||
<> |
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.
unnecessary fragment
@@ -0,0 +1,94 @@ | |||
import React, { useRef } from 'react' |
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.
Why this component is here and not in the uikit ?
|
||
import { ActionContainer, ActionTitles, Title, Subtle, ActionContent, Earned, Staked } from './styles' | ||
|
||
const HarvestButton = styled(Button)` |
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.
you don't need to create a new component for this.
Most of the uikit component use the space API from styled-system
which means you can use <Button ml="4px">....</Button>
instead of this
@@ -15,8 +15,13 @@ const ApyButton: React.FC<ApyButtonProps> = ({ lpLabel, cakePrice, apy, addLiqui | |||
<ApyCalculatorModal lpLabel={lpLabel} cakePrice={cakePrice} apy={apy} addLiquidityUrl={addLiquidityUrl} />, | |||
) | |||
|
|||
const handleClickButton = (event): void => { | |||
event.stopPropagation() |
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.
Is this necessary?
button { | ||
width: 32px; | ||
height: 32px; | ||
|
||
svg { | ||
width: 20px; | ||
} |
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.
Can you not use the <IconButton />
component?
|
||
const StyledInput = styled(Input)` | ||
border-radius: 16px; | ||
transition: 0.3s; |
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.
What is this transition for? Try and avoid setting transition for every property.
${({ theme }) => theme.mediaQueries.sm} { | ||
width: 100% !important; | ||
padding: 0 1rem !important; | ||
opacity: 1 !important; |
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.
Please double check why !important
is necessary. In principal if we need an !important
on our own code then we did something wrong to begin with.
|
||
const ListItem = styled.li` | ||
list-style: none; | ||
padding: 6px 16px; |
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.
Padding should be a multiple of 4px
, please double check.
const bsc = `https://bscscan.com/address/${farm.lpAddresses[process.env.REACT_APP_CHAIN_ID]}` | ||
const info = `https://pancakeswap.info/pair/${farm.lpAddresses[process.env.REACT_APP_CHAIN_ID]}` |
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.
Please put the chain id in a variable at the top of the file if we are using it more than once.
if (account) { | ||
if (isApproved) { | ||
if (rawStakedBalance) { |
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.
I think there is a cleaner way to represent this. Avoid using many nested if
blocks. Maybe before this block you can do something like
if (!account) {
return (
<ActionContainer>
<ActionTitles>
<Subtle>{TranslateString(999, 'START FARMING')}</Subtle>
</ActionTitles>
<ActionContent>
<UnlockButton fullWidth />
</ActionContent>
</ActionContainer>
)
}
} | ||
` | ||
|
||
const Tags: React.FunctionComponent<FarmWithStakedValue> = ({ tokenSymbol, dual }) => { |
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.
React.FC
bottom: calc(100% + 16px); | ||
transform: translate(34px, 0); | ||
right: 0; | ||
max-width: 246px; |
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.
This number seems pretty arbitrary. It is okay for now but please try and void numbers like these.
3355709
to
e50be37
Compare
* feat: create table component for farm page * feat: add scrollbar option and complete header * chore: Prettier * wip * feat: complete farm table * Update Cell.tsx fix: add defaultProps for Cell component * feat: integrate API into table * feat: table mobile * style: lint * style: lint * build: update table component pack * sort * feat: call-to-action * feat: black theme table * feat: search & toggle * feat: sticky table header and coin column * feat: mobile search * fix: uncomment * wip * conflicts resolved * Wip * build: Uikit package updated * fix: Sort * fix: Apr styling * build: Uikit * build: Uikit revert * build: Yarn lock * fix: Styling * refactor: gitignore * build: Revert npm packages * style: Package.json * style: Rm comment * styling: Rem to px * styling: Lowered to loweredcaseQuery * styling: Tags * fix: Rm unused styling * feat: farm header * feat: Mobile view * feat: Select component * Conflicts resolved * feat: New table * feat: Multiplier styling * feat: Update select to use theme color * style: Rm unused component * feat: Localization * style: Rm unused * style: Rem to px * style: Rm unused * style: Rm unused * feat: Select updated * feat: Select update * feat: Select arrow prerender * feat: Smaller viewport row * fix: Ios styling fixed * build: Uikit update * feat: Responsive styling * feat: Select transition * build: Uikit updated * fix: Actions spacing on smaller viewport * fix: Responsive styling Co-authored-by: CBunnyDev <59729252+ranon127@users.noreply.github.com> Co-authored-by: hachiojidev <hachiojidev@protonmail.com>
Fix #360
Fix #511