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

Feat: label redesign #1043

Draft
wants to merge 7 commits into
base: feat/ui-redesign-v2
Choose a base branch
from
Draft

Conversation

Asmadek
Copy link
Contributor

@Asmadek Asmadek commented Aug 31, 2023

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2023

Current coverage report

Summary

Lines Statements Branches Functions
Covered: 63%
62.35% (3351/5374) 38.81% (795/2048) 41.93% (460/1097)

Tests which was executed

Tests Skipped Failures Errors Time
246 0 💤 0 ❌ 0 🔥 3m 33s ⏱️
Coverage by files (63%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files62.3538.8141.9363.62 
components/common/ExplorerLink61.110064.28 
   ExplorerLink.tsx57.140058.339, 25–32
   constants.ts75100100100 
components/common/FallbackScreen87.51005085.71 
   FallbackScreen.tsx87.51005085.7112
components/common/Header100100100100 
   Header.tsx100100100100 
components/common/QrCode/QrGeneratorContainer900088.88 
   QrGeneratorContainer.tsx900088.8818
components/common/QrCode/QrReader25.860028.3 
   QrReaderWrapper.tsx25.860028.337–116
components/common/Scanning29.330033.33 
   ScanMultiframeQr.tsx29.160033.3345–105
   ScanSingleframeQr.tsx29.620033.3338–90
components/layout/PrimaryLayout/NavItem10057.14100100 
   NavItem.tsx10057.1410010025–32
components/layout/PrimaryLayout/Navigation96.8733.3383.3396.55 
   Navigation.tsx96.8733.3383.3396.5534
components/layout/PrimaryLayout/Wallets40.650043.9 
   ActiveAccountCard.tsx500053.3317–26
   WalletGroup.tsx57.890061.1120–56
   WalletMenu.tsx31.480034.6932–135
components/layout/PrimaryLayout/Wallets/common60100100100 
   constants.ts60100100100 
components/modals/CreateMultisigAccount55.2944.4426.6656.41 
   CreateMultisigAccount.tsx55.2944.4426.6656.4166–69, 74–75, 79–102, 111–122, 126–145, 157–198
components/modals/CreateMultisigAccount/components23.853.173.725.8 
   SelectSignatories.tsx22.055.885.8821.6633–174
   WalletForm.tsx20.580025.9222–24, 50–93
   WalletsTabItem.tsx57.140066.6610–11
components/modals/MatrixModal/components/Credentials93.7510010093.33 
   Credentials.tsx93.7510010093.3321
components/modals/MatrixModal/components/LoginForm84.0585.7110084.61 
   LoginForm.tsx84.0585.7110084.6183–84, 98, 109–110, 119–120, 136–138
components/modals/MatrixModal/components/Verification93.6110092.8593.47 
   Verification.tsx93.6110092.8593.4787, 96–97
domain100100100100 
   connection.ts100100100100 
entities/account100100100100 
   index.ts100100100100 
entities/account/ui/AccountAddress10091.66100100 
   AccountAddress.tsx10091.6610010055
entities/account/ui/AddressWithName88.8873.335087.5 
   AddressWithName.tsx88.8873.335087.565
entities/asset/ui/AssetBalance100100100100 
   AssetBalance.tsx100100100100 
entities/asset/ui/AssetCard76.19505075 
   AssetCard.tsx76.1950507529–30, 34–37
entities/asset/ui/AssetIcon100100100100 
   AssetIcon.tsx100100100100 
entities/chain/ui/ChainTitle100100100100 
   ChainTitle.tsx100100100100 
entities/contact/ui78.2633.334080 
   ContactRow.tsx60007520
   EmptyContactList.tsx75505072.7216–19
   EmptyFilteredContacts.tsx100100100100 
entities/network100100100100 
   index.ts100100100100 
entities/signatory/ui/SelectableSignatory45.450050 
   SelectableSignatory.tsx45.45005026–36
entities/signatory/ui/SignatoryCard90.971.4210088.88 
   SignatoryCard.tsx90.971.4210088.8833
entities/transaction/ui/DepositWithLabel100100100100 
   DepositWithLabel.tsx100100100100 
entities/transaction/ui/OperationResult/common62.5100100100 
   constants.ts62.5100100100 
features/contacts/ContactFilter/model57.1402570.58 
   contact-filter.ts57.1402570.5822–28
features/contacts/ContactFilter/ui55.55100062.5 
   ContactFilter.tsx55.55100062.58–11
features/contacts/CreateContactForm/ui36.840038.88 
   CreateContactForm.tsx36.840038.8811–34
features/contacts/EditContactForm/ui40.740044 
   EditContactForm.tsx36.840038.8814–37
   EditContactNavigation.tsx50100057.1410–13
pages/AddressBook/Contacts61.530058.33 
   Contacts.tsx61.530058.3321–47
pages/Assets84.7272.2276.4783.58 
   Assets.tsx84.7272.2276.4783.5867–68, 82–84, 88–90, 94–97
pages/Assets/components/AssetsFilter100100100100 
   AssetsFilters.tsx100100100100 
pages/Assets/components/Modals/ReceiveModal97.2288.888096.96 
   ReceiveModal.tsx97.2288.888096.96122
pages/Assets/components/Modals/SelectShardModal9.570012.32 
   SelectShardModal.tsx9.570012.3230–190
pages/Assets/components/NetworkAssets8842.8585.7186.66 
   NetworkAssets.tsx8842.8585.7186.6673–77, 127–128
pages/Notifications/components71.42100083.33 
   EmptyNotifications.tsx71.42100083.336
pages/Onboarding/Vault/KeyQrReader83.3375.8658.3383.63 
   KeyQrReader.tsx83.3375.8658.3383.6370, 81–93, 193
pages/Onboarding/Vault/ManageStep13.110014.28 
   ManageStep.tsx13.110014.2843–349
pages/Onboarding/Vault/ManageStepSingle34.370037.93 
   ManageStepSingle.tsx34.370037.9325–64
pages/Onboarding/Vault/ScanStep77.77100087.5 
   ScanStep.tsx77.77100087.514
pages/Onboarding/WatchOnly41.460044.73 
   EmptyState.tsx71.42100083.336
   WatchOnly.tsx35.290037.536–80
pages/Onboarding/Welcome47.610048.71 
   Welcome.tsx44.440044.1119–51
   WelcomeCard.tsx66.66008015
pages/Operations/common36.043.572046.66 
   utils.ts36.043.572046.6668, 72, 82, 89, 92, 95–99, 108–114, 118, 148, 213–230, 240–254
pages/Operations/components30.270034.03 
   Details.tsx39.390041.9323–170
   Filters.tsx14.70017.8535–136
   Log.tsx400042.4238–102
   OperationFullInfo.tsx25.370029.3127–153
   OperationModalTitle.tsx100100100100 
   OperationStatus.tsx72.72008035–37
pages/Operations/components/ActionSteps800088.88 
   Confirmation.tsx800088.8818
pages/Operations/components/EmptyState10075100100 
   EmptyOperations.tsx1007510010015
pages/Operations/components/TransactionTitle100100100100 
   TransactionTitle.tsx100100100100 
pages/Operations/components/modals24.754.216.0623.33 
   ApproveTx.tsx22.413.55.2621.3547–229
   RejectTx.tsx27.95.267.1425.9739–185
pages/Settings/Networks65.3261.5351.8565.21 
   Networks.tsx65.3261.5351.8565.2140–41, 61, 81, 107–113, 122–125, 132–135, 141–149, 158–161, 175–193, 217, 222–223
pages/Settings/Networks/components/CustomRpcModal91.6689.1886.6693.33 
   CustomRpcModal.tsx91.6689.1886.6693.3390, 113, 115, 131
pages/Settings/Networks/components/NetworkItem93.3310066.6692.85 
   NetworkItem.tsx93.3310066.6692.8524
pages/Settings/Networks/components/NetworkSelector848476.9282.6 
   NetworkSelector.tsx848476.9282.619, 66–67, 78–83
pages/Settings/Overview/components/GeneralActions100100100100 
   GeneralActions.tsx100100100100 
pages/Settings/Overview/components/MatrixAction10060100100 
   MatrixAction.tsx1006010010033–35
pages/Settings/Overview/components/SocialLinks100100100100 
   SocialLinks.tsx100100100100 
pages/Settings/Overview/components/Version100100100100 
   Version.tsx100100100100 
pages/Staking/Operations/Bond75.8357.1447.8276.14 
   Bond.tsx75.8357.1447.8276.1482–85, 90–91, 139–140, 153–154, 164–183, 196–206, 296–311, 325–330
pages/Staking/Operations/Bond/InitOperation7028.2659.3775.7 
   InitOperation.tsx7028.2659.3775.796–102, 121–136, 180–183, 195, 199–205, 209–212, 226
pages/Staking/Operations/ChangeValidators76.856047.8277.31 
   ChangeValidators.tsx76.856047.8277.3178–81, 86–87, 131–132, 143–144, 154, 168–178, 260–275, 290–294
pages/Staking/Operations/ChangeValidators/InitOperation75.9228.5776.9279.54 
   InitOperation.tsx75.9228.5776.9279.5494–109, 137–140, 154–156, 161–163, 169
pages/Staking/Operations/Destination74.0354.5440.975.26 
   Destination.tsx74.0354.5440.975.2661–62, 76–79, 84–85, 135–138, 161–171, 235–250, 265–269
pages/Staking/Operations/Destination/InitOperation752576.9278.31 
   InitOperation.tsx752576.9278.3191–106, 128–131, 150–152, 157–159, 165
pages/Staking/Operations/Redeem20.585.264.5416.12 
   Redeem.tsx20.585.264.5416.1227–271
pages/Staking/Operations/Redeem/InitOperation72.223065.6274.76 
   InitOperation.tsx72.223065.6274.76118–124, 130–145, 173–186, 196–202, 206–209, 215
pages/Staking/Operations/Restake75.9660.9745.4577.41 
   Restake.tsx75.9660.9745.4577.4175–78, 83–84, 130–133, 156–166, 236–251, 266–270
pages/Staking/Operations/Restake/InitOperation68.6526.3163.8872.07 
   InitOperation.tsx68.6526.3163.8872.07100–112, 130–145, 169–172, 183–186, 191–197, 201–204, 216
pages/Staking/Operations/StakeMore75.9660.9745.4577.41 
   StakeMore.tsx75.9660.9745.4577.4175–78, 83–84, 140–150, 168–171, 239–254, 269–273
pages/Staking/Operations/StakeMore/InitOperation68.2930.9559.3774 
   InitOperation.tsx68.2930.9559.377491–97, 114–129, 155–158, 170, 174–180, 184–187, 199
pages/Staking/Operations/Unstake72.0759.5245.4573 
   Unstake.tsx72.0759.5245.457376–79, 84–85, 131–134, 145–162, 175–185, 264–279, 294–298
pages/Staking/Operations/Unstake/InitOperation66.1923.860.5268.9 
   InitOperation.tsx66.1923.860.5268.9106–118, 136–151, 163, 175–186, 198–201, 206–212, 216–219, 231
pages/Staking/Operations/common65.2635.7157.1467.07 
   utils.tsx65.2635.7157.1467.0730–32, 41–48, 52–54, 58–60, 99, 117, 130–135, 160–162, 180–182, 195–200
pages/Staking/Operations/components/Confirmation87.8772.224090 
   Confirmation.tsx87.8772.22409074–82
pages/Staking/Operations/components/NoAsset66.66100080 
   NoAsset.tsx66.6610008012
pages/Staking/Operations/components/OperationForm25.920028.98 
   OperationFooter.tsx87.50085.7130
   OperationForm.tsx19.170022.5817–22, 72–249
pages/Staking/Operations/components/Validators84.2161.964.788 
   Validators.tsx84.2161.964.78892, 96–102, 159
pages/Staking/Overview/components/AboutStaking100100100100 
   AboutStaking.tsx100100100100 
pages/Staking/Overview/components/Actions65.5554.943.7565.27 
   Actions.tsx65.5554.943.7565.27114, 118, 122–129, 133–137, 141–152, 157–166, 204
pages/Staking/Overview/components/EmptyState100100100100 
   NoValidators.tsx100100100100 
pages/Staking/Overview/components/NetworkInfo10092.85100100 
   NetworkInfo.tsx10092.8510010015
pages/Staking/Overview/components/NominatorsList48.38011.1156 
   NominatorsList.tsx48.38011.115616–20, 24–26, 64–131
pages/Staking/Overview/components/ValidatorsModal86.48658090.9 
   ValidatorsModal.tsx86.48658090.983–88, 94
pages/Transfer23.886.455.8818.64 
   Transfer.tsx23.886.455.8818.6431–168
pages/Transfer/common29.410032.25 
   utils.tsx29.410032.2521, 36, 40–44, 51–62, 69–85
pages/Transfer/components11.30012.26 
   TransferForm.tsx11.30012.2667–322
pages/Transfer/components/ActionSteps21.270024.09 
   Confirmation.tsx52.630058.8226–65
   InitOperation.tsx13.330015.1539–135
shared/lib/hooks100100100100 
   index.ts100100100100 
shared/lib/utils1001000100 
   index.ts100100100100 
   storybook.tsx1001000100 
shared/ui90.7810010093.18 
   index.ts90.7810010093.183, 6, 20
shared/ui/Accordion100100100100 
   Accordion.tsx100100100100 
shared/ui/Alert10083.33100100 
   Alert.tsx1007510010027
   AlertItem.tsx100100100100 
shared/ui/Alert/common100100100100 
   constants.ts100100100100 
shared/ui/BlockExplorer100100100100 
   BlockExplorer.tsx100100100100 
   constants.ts100100100100 
shared/ui/Buttons100100100100 
   index.ts100100100100 
shared/ui/Buttons/Button100100100100 
   Button.tsx100100100100 
shared/ui/Buttons/Button/common100100100100 
   constants.ts100100100100 
shared/ui/Buttons/ButtonDropdown100100100100 
   ButtonDropdown.tsx100100100100 
   ButtonDropdownItem.tsx100100100100 
shared/ui/Buttons/ButtonIcon10071.42100100 
   ButtonIcon.tsx10071.4210010023–24
shared/ui/Buttons/ButtonIcon/common81.81100100100 
   constants.ts81.81100100100 
shared/ui/Buttons/ButtonLink10088.88100100 
   ButtonLink.tsx10088.8810010042
shared/ui/Buttons/ButtonLink/common90100100100 
   constants.ts90100100100 
shared/ui/Buttons/ButtonText100100100100 
   ButtonText.tsx100100100100 
shared/ui/Buttons/ButtonText/common100100100100 
   constants.ts100100100100 
shared/ui/Checkbox10086.66100100 
   Checkbox.tsx10086.6610010034–47
shared/ui/Counter10050100100 
   Counter.tsx1005010010015
shared/ui/DetailRow1000100100 
   DetailRow.tsx100010010015–23
shared/ui/Duration1000100100 
   Duration.tsx100010010017
shared/ui/Icon100100100100 
   Icon.tsx100100100100 
shared/ui/Icon/data100100100100 
   arrows.ts100100100100 
   derivations.ts100100100100 
   explorers.ts100100100100 
   index.ts100100100100 
   languages.ts100100100100 
   product.ts100100100100 
   service.ts100100100100 
   social.ts100100100100 
   staking.ts100100100100 
   status.ts100100100100 
   walletTypes.ts100100100100 
shared/ui/Identicon8086.6666.6684.61 
   Identicon.tsx8086.6666.6684.6136–37
shared/ui/InfoLink10083.33100100 
   InfoLink.tsx10083.3310010024
shared/ui/InputHint100100100100 
   InputHint.tsx100100100100 
shared/ui/InputHint/common100100100100 
   contants.ts100100100100 
shared/ui/Inputs88.88100100100 
   index.ts88.88100100100 
shared/ui/Inputs/Combobox81.2561.535080 
   Combobox.tsx81.2561.53508038, 65, 75
shared/ui/Inputs/Input100100100100 
   Input.tsx100100100100 
shared/ui/Inputs/InputAmount38.880043.75 
   InputAmount.tsx38.880043.7535–50
shared/ui/Inputs/InputArea10075100100 
   InputArea.tsx1007510010020–21
shared/ui/Inputs/InputFile93.3370100100 
   InputFile.tsx93.337010010020, 31–36
shared/ui/Inputs/InputPassword100100100100 
   InputPassword.tsx100100100100 
shared/ui/Inputs/InputSearch85.71100085.71 
   InputSearch.tsx85.71100085.7120
shared/ui/Inputs/MultiSelect10078.26100100 
   MultiSelect.tsx10078.2610010062–73, 90, 122
shared/ui/Inputs/Select10090.47100100 
   Select.tsx10090.4710010061–69
shared/ui/Inputs/common92255093.33 
   constants.ts92255093.3351
shared/ui/Label100100100100 
   Label.tsx100100100100 
   constants.ts100100100100 
shared/ui/LabelHelpbox10066.66100100 
   LabelHelpBox.tsx10066.6610010022
shared/ui/LanguageSwitcher10066.66100100 
   LanguageSwitcher.tsx10066.6610010017–19, 37, 49
shared/ui/Loader10066.66100100 
   Loader.tsx10066.6610010010
shared/ui/Modals100100100100 
   index.ts100100100100 
shared/ui/Modals/BaseModal100100100100 
   BaseModal.tsx100100100100 
shared/ui/Modals/ConfirmModal100100100100 
   ConfirmModal.tsx100100100100 
shared/ui/Plate100100100100 
   Plate.tsx100100100100 
shared/ui/Popovers100100100100 
   index.ts100100100100 
shared/ui/Popovers/InfoPopover100100100100 
   InfoPopover.tsx100100100100 
shared/ui/Popovers/MenuPopover100100100100 
   MenuPopover.tsx100100100100 
shared/ui/Popovers/Popover77.7710055.5576.47 
   Popover.tsx77.7710055.5576.4762–65
shared/ui/Popovers/Tooltip100100100100 
   Tooltip.tsx100100100100 
shared/ui/RadioGroup100100100100 
   RadioGroup.tsx100100100100 
   RadioOption.tsx100100100100 
shared/ui/Shimmering10050100100 
   Shimmering.tsx1005010010014–15
shared/ui/StatusMark10066.66100100 
   StatusMark.tsx10066.6610010020
shared/ui/StatusMark/common100100100100 
   constants.ts100100100100 
shared/ui/Switch10076.47100100 
   Switch.tsx10076.4710010039–54
shared/ui/Tabs100100100100 
   Tabs.tsx100100100100 
shared/ui/Typography94.44100100100 
   index.ts94.44100100100 
shared/ui/Typography/common100100100100 
   TextBase.ts100100100100 
shared/ui/Typography/components95.837510095.83 
   BodyText.tsx100100100100 
   CaptionText.tsx100100100100 
   FootnoteText.tsx100100100100 
   HelpText.tsx100100100100 
   LargeTitleText.tsx66.66010066.665
   MediumTitleText.tsx100100100100 
   SmallTitleText.tsx100100100100 
   TitleText.tsx10001001005

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2023

Jest Unit tests results

Generic badge

Duration: 216.355 seconds
Start: 2023-08-31 13:11:08.446 UTC
Finish: 2023-08-31 13:14:44.801 UTC
Duration: 216.355 seconds
Outcome: Passed | Total Tests: 315 | Passed: 315 | Failed: 0
Total Test Suites: 135
Total Tests: 315
Failed Test Suites: 0
Failed Tests: 0
Passed Test Suites: 135
Passed Tests: 315

Copy link
Contributor

@tuul-wq tuul-wq left a comment

Choose a reason for hiding this comment

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

Nice!


import { BlockExplorer } from './BlockExplorer';

export default {
Copy link
Contributor

Choose a reason for hiding this comment

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

Storybook declaration has changed, take a look at Buttons

parameters: { actions: { argTypesRegex: '^on.*' } },
} as ComponentMeta<typeof Label>;

const Template: ComponentStory<typeof Label> = (args) => <Label {...args} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Storybook declaration has changed


import { Label } from './Label';

describe('ui/LabelHelpBox', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
describe('ui/LabelHelpBox', () => {
describe('ui/Label', () => {

@@ -0,0 +1,17 @@
export type LabelPallet = 'default' | 'accent' | 'positive' | 'negative' | 'shade';

export const LabelStyle: Record<LabelPallet, string> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like text color on parent component is redundant, because we redeclare text color on <CaptionText />


export const Label = ({ className, children, pallet = 'default' }: PropsWithChildren<Props>) => (
<div className={cnTw('rounded-lg py-0.5 px-2 group w-fit', LabelStyle[pallet], className)} data-testid="label">
<CaptionText className={cnTw('uppercase', LabelTextStyle[pallet])}>{children}</CaptionText>
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume it's better to declare children: string, so nobody provides ReactNode in here
Like you did in <BlockExplorer /> 👍

};

export const LabelHelpBox = ({ className, children }: PropsWithChildren<Props>) => (
<div
export const LabelHelpBox = ({ className, children, disabled = false, ...props }: PropsWithChildren<Props>) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of props might come here? Without explicit declaration in Props it's not clear
Maybe it's not needed at all?
Also I would add children: string as well 😉

<BodyText>{children}</BodyText>
<Icon name="learn-more" className="group-hover:text-icon-hover group-active:text-icon-active" size={16} />
</div>
<FootnoteText className={cnTw('text-text-primary', disabled && 'text-text-tertiary')}>{children}</FootnoteText>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is optional, could leave as you've done

Suggested change
<FootnoteText className={cnTw('text-text-primary', disabled && 'text-text-tertiary')}>{children}</FootnoteText>
<FootnoteText className={disabled ? 'text-text-tertiary' : 'text-text-primary'}>{children}</FootnoteText>

type PopoverProps = ComponentProps<typeof Popover> & { pointer?: 'up' | 'down' };
type PointerDirection = 'up' | 'down';
type PointerPosition = 'start' | 'center' | 'end';
type PopoverProps = ComponentProps<typeof Popover> & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just Props?

@pgolovkin pgolovkin marked this pull request as draft November 28, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants