@@ -8,7 +8,7 @@ import ContentContainer from '~/components/ContentContainer';
88import MetaData from '~/components/Library/MetaData' ;
99import TrendingMark from '~/components/Library/TrendingMark' ;
1010import UpdatedAtView from '~/components/Library/UpdateAtView' ;
11- import DependencyRow from '~/components/Package/DependencyRow ' ;
11+ import CollapsibleSection from '~/components/Package/CollapsibleSection ' ;
1212import DetailsNavigation from '~/components/Package/DetailsNavigation' ;
1313import EntityCounter from '~/components/Package/EntityCounter' ;
1414import ExampleBox from '~/components/Package/ExampleBox' ;
@@ -19,7 +19,6 @@ import ReadmeBox from '~/components/Package/ReadmeBox';
1919import PageMeta from '~/components/PageMeta' ;
2020import { type NpmUser } from '~/types' ;
2121import { type PackageOverviewPageProps } from '~/types/pages' ;
22- import mapDependencies from '~/util/mapDependencies' ;
2322import tw from '~/util/tailwind' ;
2423
2524const ReadmeBoxWithLoading = dynamic ( ( ) => import ( '~/components/Package/ReadmeBox' ) , {
@@ -184,55 +183,10 @@ export default function PackageOverviewScene({
184183 </ ul >
185184 </ >
186185 ) }
187- { dependencies && Object . keys ( dependencies ) . length > 0 && (
188- < >
189- < H6 style = { tw `flex gap-1.5 text-[16px] text-secondary` } >
190- Dependencies
191- < EntityCounter count = { Object . keys ( dependencies ) . length } />
192- </ H6 >
193- < View >
194- { mapDependencies ( dependencies , ( [ name , version ] : [ string , string ] ) => (
195- < DependencyRow key = { `dep-${ name } ` } name = { name } version = { version } />
196- ) ) }
197- </ View >
198- </ >
199- ) }
200- { peerDependencies && Object . keys ( peerDependencies ) . length > 0 && (
201- < >
202- < H6 style = { tw `flex gap-1.5 text-[16px] text-secondary` } >
203- Peer dependencies
204- < EntityCounter count = { Object . keys ( peerDependencies ) . length } />
205- </ H6 >
206- < View >
207- { mapDependencies ( peerDependencies , ( [ name , version ] : [ string , string ] ) => (
208- < DependencyRow key = { `peer-dep-${ name } ` } name = { name } version = { version } />
209- ) ) }
210- </ View >
211- </ >
212- ) }
213- { devDependencies && Object . keys ( devDependencies ) . length > 0 && (
214- < >
215- < H6 style = { tw `flex gap-1.5 text-[16px] text-secondary` } >
216- Development dependencies
217- < EntityCounter count = { Object . keys ( devDependencies ) . length } />
218- </ H6 >
219- < View >
220- { mapDependencies ( devDependencies , ( [ name , version ] : [ string , string ] ) => (
221- < DependencyRow key = { `dev-dep-${ name } ` } name = { name } version = { version } />
222- ) ) }
223- </ View >
224- </ >
225- ) }
226- { engines && Object . keys ( engines ) . length > 0 && (
227- < >
228- < H6 style = { tw `text-[16px] text-secondary` } > Engines</ H6 >
229- < View >
230- { mapDependencies ( engines , ( [ name , version ] : [ string , string ] ) => (
231- < DependencyRow key = { `engine-${ name } ` } name = { name } version = { version } />
232- ) ) }
233- </ View >
234- </ >
235- ) }
186+ < CollapsibleSection title = "Dependencies" data = { dependencies } />
187+ < CollapsibleSection title = "Peer dependencies" data = { peerDependencies } />
188+ < CollapsibleSection title = "Development dependencies" data = { devDependencies } />
189+ < CollapsibleSection title = "Engines" data = { engines } />
236190 </ View >
237191 </ View >
238192 </ ContentContainer >
0 commit comments