| skipped 6 lines |
7 | 7 | | import ChipGroup from '../../ui/ChipGroup/ChipGroup'; |
8 | 8 | | import PackagePreview from '../../ui/PackagePreview/PackagePreview'; |
9 | 9 | | import SearchBar from '../../ui/SearchBar/SearchBar'; |
| 10 | + | import Badge from '../../ui/Badge/Badge'; |
| 11 | + | import Person from 'components/ui/Person/Person'; |
| 12 | + | import Checkbox from '../../ui/Checkbox/Checkbox'; |
| 13 | + | import SearchedResource from '../../ui/SearchedResource/SearchedResource'; |
| 14 | + | import { CardProps } from '../../ui/Card/Card'; |
| 15 | + | import CardGroup from '../../ui/CardGroup/CardGroup'; |
| 16 | + | import CardList from '../../ui/CardList/CardList'; |
| 17 | + | import CardGroups from 'components/ui/CardGroups/CardGroups'; |
10 | 18 | | |
11 | | - | type Props = {}; |
| 19 | + | export default function SearchResults() { |
| 20 | + | // TODO: mock date, remove later |
| 21 | + | const similarCards: CardProps[] = [ |
| 22 | + | { |
| 23 | + | id: 'uExBVGuF', |
| 24 | + | title: 'github.com', |
| 25 | + | icon: 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 26 | + | packageTags: { |
| 27 | + | featuredPackages: ['mdast-util-from-markdown', 'react', 'react-dom'], |
| 28 | + | restPackages: 45, |
| 29 | + | }, |
| 30 | + | }, |
| 31 | + | { |
| 32 | + | id: '1EkL1u5g', |
| 33 | + | title: 'fingerprint.com', |
| 34 | + | icon: 'https://avatars.githubusercontent.com/u/67208791?s=200&v=4', |
| 35 | + | packageTags: { |
| 36 | + | featuredPackages: ['mdast-util-from-markdown', 'react', 'react-dom'], |
| 37 | + | restPackages: 45, |
| 38 | + | }, |
| 39 | + | }, |
| 40 | + | { |
| 41 | + | id: 'mhwO2bPM', |
| 42 | + | title: 'facebook.com', |
| 43 | + | icon: 'https://avatars.githubusercontent.com/u/69631?s=200&v=4', |
| 44 | + | packageTags: { |
| 45 | + | featuredPackages: ['react'], |
| 46 | + | restPackages: 45, |
| 47 | + | }, |
| 48 | + | }, |
| 49 | + | ]; |
| 50 | + | |
| 51 | + | // TODO: mock date, remove later |
| 52 | + | const popularPackages: CardProps[] = [ |
| 53 | + | { |
| 54 | + | id: 'FPsBcl8R', |
| 55 | + | title: '@team-griffin/react-heading-section', |
| 56 | + | description: "This package's job is to automatically determine...", |
| 57 | + | featuredSites: { |
| 58 | + | iconList: [ |
| 59 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 60 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 61 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 62 | + | ], |
| 63 | + | numberOfUses: 5265, |
| 64 | + | }, |
| 65 | + | }, |
| 66 | + | { |
| 67 | + | id: 'emtYcsUh', |
| 68 | + | title: 'unist-util-generated', |
| 69 | + | description: 'unist utility to check if a node is generated', |
| 70 | + | featuredSites: { |
| 71 | + | iconList: [ |
| 72 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 73 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 74 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 75 | + | ], |
| 76 | + | numberOfUses: 5265, |
| 77 | + | }, |
| 78 | + | }, |
| 79 | + | { |
| 80 | + | id: 'TYIwvAfy', |
| 81 | + | title: 'react-smooth', |
| 82 | + | description: 'is a animation library work on React', |
| 83 | + | featuredSites: { |
| 84 | + | iconList: [ |
| 85 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 86 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 87 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 88 | + | ], |
| 89 | + | numberOfUses: 5265, |
| 90 | + | }, |
| 91 | + | }, |
| 92 | + | { |
| 93 | + | id: 'Lq1pEEX7', |
| 94 | + | title: 'unist-util-position', |
| 95 | + | description: 'unist utility to get the positional info of nodes', |
| 96 | + | featuredSites: { |
| 97 | + | iconList: [ |
| 98 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 99 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 100 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 101 | + | ], |
| 102 | + | numberOfUses: 5265, |
| 103 | + | }, |
| 104 | + | }, |
| 105 | + | { |
| 106 | + | id: 'cWOgIbmp', |
| 107 | + | title: 'vfile-message', |
| 108 | + | description: 'Create vfile messages', |
| 109 | + | featuredSites: { |
| 110 | + | iconList: [ |
| 111 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 112 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 113 | + | 'https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg', |
| 114 | + | ], |
| 115 | + | numberOfUses: 5265, |
| 116 | + | }, |
| 117 | + | }, |
| 118 | + | { |
| 119 | + | id: 'UT97Vpoi', |
| 120 | + | title: 'Go to all Popular packages', |
| 121 | + | variant: 'toAll', |
| 122 | + | }, |
| 123 | + | ]; |
12 | 124 | | |
13 | | - | export default function SearchResults(props: Props) { |
14 | 125 | | return ( |
15 | 126 | | <> |
16 | 127 | | <Header> |
| skipped 2 lines |
19 | 130 | | |
20 | 131 | | <Container> |
21 | 132 | | <div className={styles.searchResults}> |
22 | | - | <div className={styles.searchedPackage}> |
23 | | - | <div className={styles.searchedPackageImageWrapper}> |
24 | | - | <img |
25 | | - | className={styles.searchedPackageImage} |
26 | | - | src='https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg' |
27 | | - | alt='' |
28 | | - | /> |
29 | | - | </div> |
30 | | - | <div className={styles.searchedPackageContent}> |
31 | | - | <h3 className={styles.searchedPackageTitle}> |
32 | | - | pinterest.com <span className={styles.searchedPackageHighlight}>6 packages</span> |
33 | | - | </h3> |
34 | | - | <div className={styles.searchedPackageSubtitle}>Last scanning 21 feb in 21:30</div> |
35 | | - | </div> |
36 | | - | </div> |
| 133 | + | <SearchedResource |
| 134 | + | image='https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg' |
| 135 | + | name='pinterest.com' |
| 136 | + | totalPackages={6} |
| 137 | + | lastScanDate='21 feb in 21:30' |
| 138 | + | /> |
37 | 139 | | |
38 | 140 | | <aside className={styles.sidebar}> |
39 | 141 | | <div className={styles.sidebarItem}> |
| skipped 47 lines |
87 | 189 | | |
88 | 190 | | <div className={styles.sidebarItem}> |
89 | 191 | | <div className={styles.sidebarItemTop}> |
90 | | - | <div className={styles.sidebarItemTitle}>Problem</div> |
| 192 | + | <div className={styles.sidebarItemTitle}> |
| 193 | + | Problem |
| 194 | + | <span className={styles.sidebarItemCounter}> |
| 195 | + | <Badge content={1} /> |
| 196 | + | </span> |
| 197 | + | </div> |
91 | 198 | | </div> |
92 | 199 | | |
93 | 200 | | <div className={styles.checkboxGroup}> |
94 | | - | <label className={styles.checkbox}> |
95 | | - | <input type='checkbox' className={styles.checkboxInput} /> |
96 | | - | <span className={styles.checkboxName}>Vulnerabilities</span> |
97 | | - | </label> |
98 | | - | <label className={styles.checkbox}> |
99 | | - | <input type='checkbox' className={styles.checkboxInput} /> |
100 | | - | <span className={styles.checkboxName}>Outdated</span> |
101 | | - | </label> |
102 | | - | <label className={styles.checkbox}> |
103 | | - | <input type='checkbox' className={styles.checkboxInput} /> |
104 | | - | <span className={styles.checkboxName}>Duplicate</span> |
105 | | - | </label> |
| 201 | + | <Checkbox label='Vulnerabilities' checked /> |
| 202 | + | <Checkbox label='Outdated' /> |
| 203 | + | <Checkbox label='Duplicate' /> |
106 | 204 | | </div> |
107 | 205 | | </div> |
108 | 206 | | |
| skipped 6 lines |
115 | 213 | | </div> |
116 | 214 | | |
117 | 215 | | <div className={styles.authors}> |
118 | | - | <div className={styles.author}> |
119 | | - | <div className={styles.authorImageWrapper}> |
120 | | - | <img |
121 | | - | className={styles.authorImage} |
122 | | - | src='https://via.placeholder.com/36' |
123 | | - | alt='' |
124 | | - | /> |
125 | | - | </div> |
126 | | - | <div className={styles.authorName}>acdlite</div> |
127 | | - | </div> |
128 | | - | |
129 | | - | <div className={styles.author}> |
130 | | - | <div className={styles.authorImageWrapper}> |
131 | | - | <img |
132 | | - | className={styles.authorImage} |
133 | | - | src='https://via.placeholder.com/36' |
134 | | - | alt='' |
135 | | - | /> |
136 | | - | </div> |
137 | | - | <div className={styles.authorName}>gaearon</div> |
138 | | - | </div> |
139 | | - | |
140 | | - | <div className={styles.author}> |
141 | | - | <div className={styles.authorImageWrapper}> |
142 | | - | <img |
143 | | - | className={styles.authorImage} |
144 | | - | src='https://via.placeholder.com/36' |
145 | | - | alt='' |
146 | | - | /> |
147 | | - | </div> |
148 | | - | <div className={styles.authorName}>sophiebits</div> |
149 | | - | </div> |
150 | | - | |
151 | | - | <div className={styles.author}> |
152 | | - | <div className={styles.authorImageWrapper}> |
153 | | - | <img |
154 | | - | className={styles.authorImage} |
155 | | - | src='https://via.placeholder.com/36' |
156 | | - | alt='' |
157 | | - | /> |
158 | | - | </div> |
159 | | - | <div className={styles.authorName}>trueadm</div> |
160 | | - | </div> |
| 216 | + | <Person image='https://via.placeholder.com/36' name='acdlite' checked /> |
| 217 | + | <Person image='https://via.placeholder.com/36' name='gaearon' /> |
| 218 | + | <Person image='https://via.placeholder.com/36' name='sophiebits' /> |
| 219 | + | <Person image='https://via.placeholder.com/36' name='trueadm' /> |
161 | 220 | | </div> |
162 | 221 | | |
163 | 222 | | <span role='button' className={styles.viewAll}> |
| skipped 9 lines |
173 | 232 | | /> |
174 | 233 | | </div> |
175 | 234 | | </div> |
| 235 | + | |
| 236 | + | <CardGroups> |
| 237 | + | <CardGroup title='Similar sites'> |
| 238 | + | <CardList cards={similarCards} /> |
| 239 | + | </CardGroup> |
| 240 | + | |
| 241 | + | <CardGroup title='Popular packages'> |
| 242 | + | <CardList cards={popularPackages} /> |
| 243 | + | </CardGroup> |
| 244 | + | </CardGroups> |
176 | 245 | | </Container> |
177 | 246 | | |
178 | 247 | | <Footer /> |
| skipped 4 lines |