2021-05-27 11:20:34 +03:00
|
|
|
import * as React from "react";
|
|
|
|
|
|
|
|
import { css } from "@emotion/react";
|
|
|
|
|
|
|
|
import {
|
|
|
|
ActivityFileGroup,
|
|
|
|
ActivityCollectionGroup,
|
|
|
|
ActivityProfileGroup,
|
|
|
|
} from "~/components/core/ActivityGroup/components";
|
|
|
|
|
|
|
|
const STYLES_GROUP_GRID = (theme) => css`
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 260px 1fr;
|
|
|
|
grid-row-gap: 32px;
|
|
|
|
border-bottom: 1px solid ${theme.semantic.bgLight};
|
|
|
|
padding-bottom: 24px;
|
|
|
|
`;
|
|
|
|
|
2021-07-28 16:56:05 +03:00
|
|
|
export default function ActivityGroup({
|
|
|
|
onAction,
|
|
|
|
viewer,
|
|
|
|
onFileClick,
|
|
|
|
external,
|
|
|
|
group,
|
|
|
|
nbrOfCardsPerRow,
|
|
|
|
}) {
|
2021-05-27 11:20:34 +03:00
|
|
|
const { type } = group;
|
|
|
|
if (
|
|
|
|
type === "CREATE_FILE" ||
|
|
|
|
type === "CREATE_SLATE_OBJECT" ||
|
|
|
|
type === "LIKE_FILE" ||
|
|
|
|
type === "SAVE_COPY"
|
|
|
|
) {
|
2021-07-14 13:16:52 +03:00
|
|
|
return (
|
|
|
|
<ActivityFileGroup
|
|
|
|
nbrOfObjectsPerRow={nbrOfCardsPerRow.object}
|
|
|
|
viewer={viewer}
|
|
|
|
onAction={onAction}
|
|
|
|
group={group}
|
2021-07-28 16:56:05 +03:00
|
|
|
onFileClick={onFileClick}
|
2021-07-14 13:16:52 +03:00
|
|
|
/>
|
|
|
|
);
|
2021-05-27 11:20:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (type === "CREATE_SLATE" || type === "SUBSCRIBE_SLATE") {
|
2021-07-14 13:16:52 +03:00
|
|
|
return (
|
|
|
|
<ActivityCollectionGroup
|
|
|
|
onAction={onAction}
|
|
|
|
viewer={viewer}
|
|
|
|
group={group}
|
|
|
|
nbrOfCollectionsPerRow={nbrOfCardsPerRow.collection}
|
|
|
|
/>
|
|
|
|
);
|
2021-05-27 11:20:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (type === "SUBSCRIBE_USER") {
|
|
|
|
return (
|
2021-07-14 13:16:52 +03:00
|
|
|
<ActivityProfileGroup
|
|
|
|
nbrOfProfilesPerRow={nbrOfCardsPerRow.profile}
|
|
|
|
onAction={onAction}
|
|
|
|
viewer={viewer}
|
|
|
|
external={external}
|
|
|
|
group={group}
|
|
|
|
/>
|
2021-05-27 11:20:34 +03:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(amine): grouping for making files/slate public
|
|
|
|
return (
|
|
|
|
<div css={STYLES_GROUP_GRID}>
|
|
|
|
<div>{type}</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|