@soul-refiner/design-system 0.2.72 → 0.2.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,4 +14,4 @@ export interface PostProps extends React.PropsWithChildren {
|
|
|
14
14
|
isPaywalled?: boolean;
|
|
15
15
|
onJoin?: () => void;
|
|
16
16
|
}
|
|
17
|
-
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, content, createdDate, dropdown, id, images, isPaywalled, onJoin, }: PostProps) => React.JSX.Element;
|
|
17
|
+
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled, onJoin, }: PostProps) => React.JSX.Element;
|
|
@@ -6,9 +6,10 @@ import { Button } from '../../actions/button';
|
|
|
6
6
|
import { Avatar } from '../../iconography/avatar';
|
|
7
7
|
import { Lock } from '../../../icons';
|
|
8
8
|
import { abbrTimeBeforeDate } from './helpers';
|
|
9
|
-
export const Post = ({ actions, author, authorActive, authorHref, authorImage, content, createdDate, dropdown, id, images, isPaywalled = false, onJoin, }) => {
|
|
9
|
+
export const Post = ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled = false, onJoin, }) => {
|
|
10
10
|
const componentId = React.useId();
|
|
11
11
|
const _actions = React.Children.toArray(actions);
|
|
12
|
+
const _comments = React.Children.toArray(children);
|
|
12
13
|
const subtitle = abbrTimeBeforeDate(new Date(createdDate));
|
|
13
14
|
return (React.createElement(Wrapper, { id: id },
|
|
14
15
|
React.createElement(Header, null,
|
|
@@ -29,7 +30,8 @@ export const Post = ({ actions, author, authorActive, authorHref, authorImage, c
|
|
|
29
30
|
React.createElement("br", null),
|
|
30
31
|
"to unlock this post"),
|
|
31
32
|
React.createElement(Button, { onClick: onJoin, size: "small", sx: "width: 213px;", type: "outlined" }, "Join now"))),
|
|
32
|
-
!!_actions.length && (React.createElement(ActionsWrapper, null, !isPaywalled && _actions))
|
|
33
|
+
!!_actions.length && (React.createElement(ActionsWrapper, null, !isPaywalled && _actions)),
|
|
34
|
+
hasComments && !!_comments.length && (React.createElement(CommentWrapper, null, _comments))));
|
|
33
35
|
};
|
|
34
36
|
const Wrapper = styled.div `
|
|
35
37
|
position: relative;
|
|
@@ -118,3 +120,9 @@ const ActionsWrapper = styled.div `
|
|
|
118
120
|
align-items: center;
|
|
119
121
|
padding: 24px;
|
|
120
122
|
`;
|
|
123
|
+
const CommentWrapper = styled.div `
|
|
124
|
+
padding: 24px;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-flow: column nowrap;
|
|
127
|
+
gap: 24px;
|
|
128
|
+
`;
|