update AllCollectionCard
This commit is contained in:
parent
34fee57dd7
commit
e82d961d4c
|
@ -2,18 +2,26 @@ import { Typography } from '@mui/material';
|
||||||
import constants from 'utils/strings/constants';
|
import constants from 'utils/strings/constants';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import CollectionCard from '../CollectionCard';
|
import CollectionCard from '../CollectionCard';
|
||||||
|
import { CollectionSummary } from 'types/collection';
|
||||||
|
|
||||||
|
interface Iprops {
|
||||||
|
collectionTile: any;
|
||||||
|
collectionSummary: CollectionSummary;
|
||||||
|
onCollectionClick: (collectionID: number) => void;
|
||||||
|
}
|
||||||
|
|
||||||
export default function AllCollectionCard({
|
export default function AllCollectionCard({
|
||||||
|
collectionTile,
|
||||||
onCollectionClick,
|
onCollectionClick,
|
||||||
collectionAttributes,
|
collectionSummary,
|
||||||
latestFile,
|
}: Iprops) {
|
||||||
fileCount,
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<CollectionCard
|
<CollectionCard
|
||||||
large
|
collectionTile={collectionTile}
|
||||||
latestFile={latestFile}
|
latestFile={collectionSummary.latestFile}
|
||||||
onClick={() => onCollectionClick(collectionAttributes.id)}>
|
onClick={() =>
|
||||||
|
onCollectionClick(collectionSummary.collectionAttributes.id)
|
||||||
|
}>
|
||||||
<div>
|
<div>
|
||||||
<Typography
|
<Typography
|
||||||
css={`
|
css={`
|
||||||
|
@ -21,7 +29,7 @@ export default function AllCollectionCard({
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
`}>
|
`}>
|
||||||
{collectionAttributes.name}
|
{collectionSummary.collectionAttributes.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
css={`
|
css={`
|
||||||
|
@ -29,7 +37,7 @@ export default function AllCollectionCard({
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
`}>
|
`}>
|
||||||
{fileCount} {constants.PHOTOS}
|
{collectionSummary.fileCount} {constants.PHOTOS}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</CollectionCard>
|
</CollectionCard>
|
||||||
|
|
|
@ -7,10 +7,12 @@ import { CollectionSummary } from 'types/collection';
|
||||||
interface Iprops {
|
interface Iprops {
|
||||||
collectionSummaries: CollectionSummary[];
|
collectionSummaries: CollectionSummary[];
|
||||||
onCollectionClick: (id?: number) => void;
|
onCollectionClick: (id?: number) => void;
|
||||||
|
collectionTile: any;
|
||||||
}
|
}
|
||||||
export default function AllCollectionContent({
|
export default function AllCollectionContent({
|
||||||
collectionSummaries,
|
collectionSummaries,
|
||||||
onCollectionClick,
|
onCollectionClick,
|
||||||
|
collectionTile,
|
||||||
}: Iprops) {
|
}: Iprops) {
|
||||||
return (
|
return (
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
|
@ -18,17 +20,14 @@ export default function AllCollectionContent({
|
||||||
style={{
|
style={{
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
}}>
|
}}>
|
||||||
{collectionSummaries.map(
|
{collectionSummaries.map((collectionSummary) => (
|
||||||
({ latestFile, collectionAttributes, fileCount }) => (
|
<AllCollectionCard
|
||||||
<AllCollectionCard
|
collectionTile={collectionTile}
|
||||||
onCollectionClick={onCollectionClick}
|
onCollectionClick={onCollectionClick}
|
||||||
collectionAttributes={collectionAttributes}
|
collectionSummary={collectionSummary}
|
||||||
key={collectionAttributes.id}
|
key={collectionSummary.collectionAttributes.id}
|
||||||
latestFile={latestFile}
|
/>
|
||||||
fileCount={fileCount}
|
))}
|
||||||
/>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</FlexWrapper>
|
</FlexWrapper>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue