@@ -16,7 +16,7 @@ const MAX_COUNT = 5;
1616 * Renders a Resource and all its Properties in a random order. Title
1717 * (shortname) is rendered prominently at the top.
1818 */
19- function CollectionCard ( { resource, small } : CardViewProps ) : JSX . Element {
19+ function CollectionCard ( { resource } : CardViewProps ) : JSX . Element {
2020 const [ description ] = useString ( resource , core . properties . description ) ;
2121 const [ members ] = useArray ( resource , collections . properties . members ) ;
2222 const [ showAll , setShowMore ] = useState ( false ) ;
@@ -32,38 +32,32 @@ function CollectionCard({ resource, small }: CardViewProps): JSX.Element {
3232 < Column gap = '0.5rem' >
3333 < ResourceCardTitle resource = { resource } />
3434 { description && < Markdown text = { description } /> }
35- < Show show = { ! small } >
36- { subjects . length === 0 ? (
37- < Empty > No resources</ Empty >
38- ) : (
39- < CardInsideFull >
40- { subjects . map ( member => {
41- return (
42- < CardRow key = { member } >
43- < ResourceInline subject = { member } />
44- </ CardRow >
45- ) ;
46- } ) }
47- { tooMany && (
48- < CardRow >
49- < Button clean onClick = { ( ) => setShowMore ( ! showAll ) } >
50- { showAll
51- ? 'show less'
52- : `show ${ members . length - MAX_COUNT } more` }
53- </ Button >
35+ { subjects . length === 0 ? (
36+ < Empty > No resources</ Empty >
37+ ) : (
38+ < CardInsideFull >
39+ { subjects . map ( member => {
40+ return (
41+ < CardRow key = { member } >
42+ < ResourceInline subject = { member } />
5443 </ CardRow >
55- ) }
56- </ CardInsideFull >
57- ) }
58- </ Show >
44+ ) ;
45+ } ) }
46+ { tooMany && (
47+ < CardRow >
48+ < Button clean onClick = { ( ) => setShowMore ( ! showAll ) } >
49+ { showAll
50+ ? 'show less'
51+ : `show ${ members . length - MAX_COUNT } more` }
52+ </ Button >
53+ </ CardRow >
54+ ) }
55+ </ CardInsideFull >
56+ ) }
5957 </ Column >
6058 ) ;
6159}
6260
63- const Show : FC < PropsWithChildren < { show : boolean } > > = ( { show, children } ) => {
64- return show ? children : null ;
65- } ;
66-
6761const Empty = styled . span `
6862 color: ${ ( { theme } ) => theme . colors . textLight } ;
6963` ;
0 commit comments