-
Notifications
You must be signed in to change notification settings - Fork 1
/
Collection.tsx
47 lines (42 loc) · 1.12 KB
/
Collection.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { ReactElement } from 'react'
import CollectionItemComponent from './CollectionItem';
import { Grid, makeStyles, createStyles, Theme } from '@material-ui/core';
import { getCollection_user_collection } from '../../../__generated__/getCollection';
type CollectionItem = Omit<getCollection_user_collection, '__typename'>;
interface Props {
collection: Array<CollectionItem>
filters?: {}
}
const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
flexGrow: 1,
},
paper: {
height: 140,
width: 100,
},
control: {
padding: theme.spacing(2),
},
}),
);
const data = [1, 2, 3];
export default function CollectionComponent({ collection }: Props): ReactElement {
const classes = useStyles();
return (
<div>
<Grid container spacing={2}>
<Grid item xs={12}>
<Grid container spacing={2}>
{collection.map((item, itemIndex) => (
<Grid key={itemIndex} item>
<CollectionItemComponent item={item} />
</Grid>
))}
</Grid>
</Grid>
</Grid>
</div>
)
}