Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Main action cards #1278

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Main action cards #1278

wants to merge 5 commits into from

Conversation

0xjocke
Copy link
Contributor

@0xjocke 0xjocke commented Sep 2, 2022

I was gonna add some cypress component tests, but I think it's better to wait until we've migrated to js-monorepo. And maybe even until we removed next, since the configuration seems a bit different when using next vs raw webpack

https://staking-storybook-git-main-action-cards-synthetixio.vercel.app/?path=/story/mainactioncard--primary
image

@vercel
Copy link

vercel bot commented Sep 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
staking ✅ Ready (Inspect) Visit Preview Sep 2, 2022 at 1:58AM (UTC)
staking-storybook ✅ Ready (Inspect) Visit Preview Sep 2, 2022 at 1:58AM (UTC)

@@ -0,0 +1,235 @@
import { Badge, Box, Button, Flex, Heading, Stack, Text } from '@chakra-ui/react';
import React, { PropsWithChildren, ReactNode } from 'react';
import { getVariant } from '../c-ratio-health-card/getVariant';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is probably gonna be important in a few places. Maybe we should think about a better name and put it elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah for sure. Maybe something like solvency/health state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just keep it in v2-components for now? Maybe getHealthVariant since we have color and components variants defined with these values?

@0xjocke
Copy link
Contributor Author

0xjocke commented Sep 2, 2022

hmm a little more work on the disabled states coming

border={'1px'}
borderColor={variant}
display="flex"
alignItems={'center'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit annoying but can we do just "center" and "1px"
My editor is code completing to {'center'} as well but bit annoying tbh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea I dont care too much. But if we wanna enforce it I'll add 'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }],. Then eslint can fix all places for us. 78 places in total.. Probably wait with fixing that until migraiton to monorepo is done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, eslint should sort these things automatically for us. Please, enable =)

<InfoIcon color={variant} width="10px" height="10px" />
<Text ml="0.5">
{variant !== 'success'
? 'Adjust to collect weekly rewards'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in i18 json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You caught me. My other components are also missing i18.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this at all?

<CardHeader
step={3}
headingText="Collect Rewards"
bodyText="Maintain your target C-Ratio to collect your weekly rewards."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+i18

Copy link
Contributor

@jmzwar jmzwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some little things

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants