Projects STRLCPY gradejs Commits b7fd09f7
🤬
  • fix: fix Chips types/props, replace header tag for cards with div, remove out old props from Home

  • Loading...
  • Dmitry Shakun committed 2 years ago
    b7fd09f7
    1 parent ab0b7d67
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    packages/web/src/components/layouts/Home/Home.tsx
    skipped 7 lines
    8 8  import CardGroup from '../../ui/CardGroup/CardGroup';
    9 9   
    10 10  type Props = {
    11  - suggestions: string[];
     11 + suggestions?: string[];
    12 12  };
    13 13   
    14 14  export default function Home({ suggestions }: Props) {
    skipped 163 lines
  • ■ ■ ■ ■
    packages/web/src/components/pages/Home.tsx
    skipped 41 lines
    42 42   }
    43 43   });
    44 44   
    45  - return <Home onSubmit={handleDetectStart} isLoading={state.isLoading} />;
     45 + return (
     46 + // TODO: pass proper props when API integration will take place
     47 + <Home />
     48 + );
    46 49  }
    47 50   
  • ■ ■ ■ ■ ■ ■
    packages/web/src/components/ui/Card/Card.tsx
    skipped 38 lines
    39 39   return (
    40 40   <div className={clsx(styles.card, variant && styles[variant])}>
    41 41   <div className={styles.cardTop}>
    42  - <header className={styles.header}>
     42 + <div className={styles.header}>
    43 43   {icon && (
    44 44   <div className={styles.iconWrapper}>
    45 45   <img className={styles.icon} src={icon} alt='' />
    skipped 1 lines
    47 47   )}
    48 48   
    49 49   <div className={styles.title}>{title}</div>
    50  - </header>
     50 + </div>
    51 51   
    52 52   {description && <div className={styles.description}>{description}</div>}
    53 53   </div>
    skipped 28 lines
  • ■ ■ ■ ■ ■ ■
    packages/web/src/components/ui/Chip/Chip.module.scss
    skipped 100 lines
    101 101   font-weight: 500;
    102 102  }
    103 103   
    104  -.red {
     104 +.vulnerability {
    105 105   background-color: $red-accent;
    106 106   color: $white;
    107 107  }
    108 108   
    109  -.orange {
     109 +.duplicate {
    110 110   background-color: $orange-accent;
    111 111   color: $white;
    112 112  }
    113 113   
    114  -.yellow {
     114 +.outdated {
    115 115   background-color: $yellow-accent;
    116 116   color: $white;
    117 117  }
    118 118   
    119  -.blueAdditional {
     119 +.info {
    120 120   background-color: $blue-additional;
    121 121   color: $blue-accent;
    122 122  }
    skipped 6 lines
  • ■ ■ ■ ■ ■
    packages/web/src/components/ui/Chip/Chip.tsx
    skipped 5 lines
    6 6  export type ChipProps = {
    7 7   children: React.ReactNode;
    8 8   className?: string;
    9  - variant?: 'primary' | 'secondary' | 'outlined' | 'suggest';
    10  - size?: 'default' | 'medium' | 'large';
     9 + variant?:
     10 + | 'primary'
     11 + | 'secondary'
     12 + | 'outlined'
     13 + | 'suggest'
     14 + | 'vulnerability'
     15 + | 'duplicate'
     16 + | 'outdated'
     17 + | 'info';
     18 + size?: 'badge' | 'default' | 'medium' | 'large';
    11 19   font?: 'sans-serif' | 'monospace';
    12 20   fontWeight?: 400 | 500;
    13 21   fontSize?: 'small' | 'regular';
    skipped 34 lines
  • ■ ■ ■ ■ ■ ■
    packages/web/src/components/ui/Hero/Hero.tsx
    skipped 7 lines
    8 8  export type HeroProps = {
    9 9   inputText?: string;
    10 10   loading?: boolean;
    11  - suggestions: string[];
     11 + suggestions?: string[];
    12 12  };
    13 13   
    14 14  export default function Hero({ inputText, suggestions, loading = false }: HeroProps) {
    skipped 32 lines
    47 47   </button>
    48 48   </div>
    49 49   
    50  - <div className={styles.suggestions}>
    51  - {suggestions.map((suggestion) => (
    52  - <Chip key={suggestion} variant='suggest' size='medium'>
    53  - {suggestion}
    54  - </Chip>
    55  - ))}
    56  - </div>
     50 + {suggestions && (
     51 + <div className={styles.suggestions}>
     52 + {suggestions.map((suggestion) => (
     53 + <Chip key={suggestion} variant='suggest' size='medium'>
     54 + {suggestion}
     55 + </Chip>
     56 + ))}
     57 + </div>
     58 + )}
    57 59   </div>
    58 60   </Container>
    59 61   </section>
    skipped 3 lines
  • ■ ■ ■ ■ ■ ■
    packages/web/src/components/ui/PackagePreview/PackagePreview.tsx
    skipped 76 lines
    77 77   </span>
    78 78   <span className={styles.problems}>
    79 79   <Chip
    80  - variant='red'
     80 + variant='vulnerability'
    81 81   size='badge'
    82 82   icon={<Icon kind='bug' width={24} height={24} color='white' />}
    83 83   >
    84 84   Vulnerabilities
    85 85   </Chip>
    86 86   <Chip
    87  - variant='orange'
     87 + variant='duplicate'
    88 88   size='badge'
    89 89   icon={<Icon kind='duplicate' width={24} height={24} color='white' />}
    90 90   >
    91 91   Duplicate
    92 92   </Chip>
    93 93   <Chip
    94  - variant='yellow'
     94 + variant='outdated'
    95 95   size='badge'
    96 96   icon={
    97 97   <Icon kind='outdated' width={24} height={24} color='white' stroke='#F1CE61' />
    skipped 210 lines
    308 308   <a href='#' className={styles.tag}>
    309 309   #format
    310 310   </a>
    311  - <Chip variant='blueAdditional' size='medium' fontWeight={500}>
     311 + <Chip variant='info' size='medium' fontWeight={500}>
    312 312   +45
    313 313   </Chip>
    314 314   </div>
    skipped 10 lines
Please wait...
Page is in error, reload to recover