@@ -16,7 +16,7 @@ const MAX_COUNT = 5;
16
16
* Renders a Resource and all its Properties in a random order. Title
17
17
* (shortname) is rendered prominently at the top.
18
18
*/
19
- function CollectionCard ( { resource, small } : CardViewProps ) : JSX . Element {
19
+ function CollectionCard ( { resource } : CardViewProps ) : JSX . Element {
20
20
const [ description ] = useString ( resource , core . properties . description ) ;
21
21
const [ members ] = useArray ( resource , collections . properties . members ) ;
22
22
const [ showAll , setShowMore ] = useState ( false ) ;
@@ -32,38 +32,32 @@ function CollectionCard({ resource, small }: CardViewProps): JSX.Element {
32
32
< Column gap = '0.5rem' >
33
33
< ResourceCardTitle resource = { resource } />
34
34
{ 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 } />
54
43
</ 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
+ ) }
59
57
</ Column >
60
58
) ;
61
59
}
62
60
63
- const Show : FC < PropsWithChildren < { show : boolean } > > = ( { show, children } ) => {
64
- return show ? children : null ;
65
- } ;
66
-
67
61
const Empty = styled . span `
68
62
color: ${ ( { theme } ) => theme . colors . textLight } ;
69
63
` ;
0 commit comments