parent
d73bf5d37a
commit
4b90a7f745
3 changed files with 133 additions and 11 deletions
@ -0,0 +1,110 @@ |
|||||||
|
import React from 'react'; |
||||||
|
|
||||||
|
import { makeStyles } from '@material-ui/core/styles'; |
||||||
|
import Box from '@material-ui/core/Box'; |
||||||
|
import ImportContactsIcon from '@material-ui/icons/ImportContacts'; |
||||||
|
import Button from '@material-ui/core/Button'; |
||||||
|
import LabelIcon from '@material-ui/icons/Label'; |
||||||
|
|
||||||
|
import { GridGallery } from './gridgallery.js'; |
||||||
|
|
||||||
|
const useStyles = makeStyles(theme => ({ |
||||||
|
root: { |
||||||
|
width: "100%", |
||||||
|
}, |
||||||
|
albumscontainer: { |
||||||
|
}, |
||||||
|
albumitemcontainer: { |
||||||
|
display: "block", |
||||||
|
}, |
||||||
|
tagscontainer: { |
||||||
|
}, |
||||||
|
tagitemcontainer: { |
||||||
|
display: "block", |
||||||
|
}, |
||||||
|
})); |
||||||
|
|
||||||
|
export function AlbumItemView(props) { |
||||||
|
const { album } = props; |
||||||
|
|
||||||
|
return ( |
||||||
|
<Button |
||||||
|
variant="outlined" |
||||||
|
startIcon={<ImportContactsIcon />}> |
||||||
|
{album.state.relative_path} |
||||||
|
</Button> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
export function AlbumsView(props) { |
||||||
|
const classes = useStyles(); |
||||||
|
const { albums } = props; |
||||||
|
|
||||||
|
return ( |
||||||
|
<Box className={classes.albumscontainer}> |
||||||
|
{ |
||||||
|
albums.map(elem => { |
||||||
|
return ( |
||||||
|
<Box className={classes.albumitemcontainer}> |
||||||
|
<AlbumItemView album={elem} /> |
||||||
|
</Box> |
||||||
|
) |
||||||
|
}) |
||||||
|
} |
||||||
|
</Box> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
export function TagItemView(props) { |
||||||
|
const { tag } = props; |
||||||
|
|
||||||
|
return ( |
||||||
|
<Button |
||||||
|
variant="outlined" |
||||||
|
startIcon={<LabelIcon />}> |
||||||
|
{tag.state.name} |
||||||
|
</Button> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
export function TagsView(props) { |
||||||
|
const classes = useStyles(); |
||||||
|
const { tags } = props; |
||||||
|
|
||||||
|
return ( |
||||||
|
<Box className={classes.tagscontainer}> |
||||||
|
{ |
||||||
|
tags.map(elem => { |
||||||
|
return ( |
||||||
|
<Box className={classes.tagitemcontainer}> |
||||||
|
<TagItemView tag={elem} /> |
||||||
|
</Box> |
||||||
|
) |
||||||
|
}) |
||||||
|
} |
||||||
|
</Box> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
export function ImagesView(props) { |
||||||
|
return <GridGallery {...props} />; |
||||||
|
} |
||||||
|
|
||||||
|
export function ResultsView(props) { |
||||||
|
const classes = useStyles(); |
||||||
|
const { photos, albums, tags } = props; |
||||||
|
|
||||||
|
return ( |
||||||
|
<Box className={classes.root}> |
||||||
|
<Box className={classes.root}> |
||||||
|
<ImagesView className={classes.root} photos={photos} /> |
||||||
|
</Box> |
||||||
|
<Box className={classes.root}> |
||||||
|
<AlbumsView className={classes.root} albums={albums} /> |
||||||
|
</Box> |
||||||
|
<Box className={classes.root}> |
||||||
|
<TagsView className={classes.root} tags={tags} /> |
||||||
|
</Box> |
||||||
|
</Box> |
||||||
|
) |
||||||
|
} |
Loading…
Reference in new issue