@soul-refiner/design-system 0.0.5 → 0.0.6
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.
- package/package.json +5 -1
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -12
- package/.turbo/turbo-test.log +0 -4417
- package/CHANGELOG.md +0 -7
- package/babel.config.js +0 -6
- package/custom.d.ts +0 -4
- package/src/actions/Button/Button.module.scss +0 -205
- package/src/actions/Button/Button.spec.js +0 -56
- package/src/actions/Button/Button.tsx +0 -143
- package/src/actions/Button/index.ts +0 -1
- package/src/actions/Dropdown/Dropdown.module.scss +0 -77
- package/src/actions/Dropdown/Dropdown.spec.js +0 -149
- package/src/actions/Dropdown/Dropdown.tsx +0 -224
- package/src/actions/Dropdown/index.ts +0 -6
- package/src/actions/Dropzone/Dropzone.module.scss +0 -48
- package/src/actions/Dropzone/Dropzone.spec.js +0 -60
- package/src/actions/Dropzone/Dropzone.tsx +0 -191
- package/src/actions/Dropzone/index.ts +0 -1
- package/src/actions/Rate/Rate.module.scss +0 -17
- package/src/actions/Rate/Rate.tsx +0 -53
- package/src/actions/Rate/index.ts +0 -1
- package/src/actions/Switch/Switch.module.scss +0 -35
- package/src/actions/Switch/Switch.spec.js +0 -31
- package/src/actions/Switch/Switch.tsx +0 -34
- package/src/actions/Switch/index.ts +0 -1
- package/src/actions/index.ts +0 -5
- package/src/cards/CourseCard/CourseCard.module.scss +0 -219
- package/src/cards/CourseCard/CourseCard.spec.js +0 -60
- package/src/cards/CourseCard/CourseCard.tsx +0 -145
- package/src/cards/CourseCard/index.ts +0 -1
- package/src/cards/EpisodeCard/EpisodeCard.module.scss +0 -69
- package/src/cards/EpisodeCard/EpisodeCard.tsx +0 -53
- package/src/cards/EpisodeCard/index.ts +0 -1
- package/src/cards/FeatureCard/FeatureCard.module.scss +0 -116
- package/src/cards/FeatureCard/FeatureCard.spec.js +0 -70
- package/src/cards/FeatureCard/FeatureCard.tsx +0 -123
- package/src/cards/FeatureCard/index.ts +0 -1
- package/src/cards/index.ts +0 -3
- package/src/data/Bar/Bar.module.scss +0 -105
- package/src/data/Bar/Bar.tsx +0 -161
- package/src/data/Bar/index.ts +0 -1
- package/src/data/Line/Line.module.scss +0 -102
- package/src/data/Line/Line.tsx +0 -162
- package/src/data/Line/index.ts +0 -1
- package/src/data/Pie/Pie.module.scss +0 -56
- package/src/data/Pie/Pie.spec.js +0 -72
- package/src/data/Pie/Pie.tsx +0 -111
- package/src/data/Pie/index.ts +0 -1
- package/src/data/index.ts +0 -3
- package/src/editor/Editor.module.scss +0 -125
- package/src/editor/Editor.tsx +0 -327
- package/src/editor/common/elements.ts +0 -50
- package/src/editor/common/index.ts +0 -2
- package/src/editor/common/marks.ts +0 -27
- package/src/editor/components/MediaDrawer/MediaDrawer.module.scss +0 -316
- package/src/editor/components/MediaDrawer/MediaDrawer.tsx +0 -457
- package/src/editor/components/MediaDrawer/index.ts +0 -1
- package/src/editor/components/index.ts +0 -1
- package/src/editor/config/default.ts +0 -213
- package/src/editor/config/index.ts +0 -2
- package/src/editor/config/props.ts +0 -9
- package/src/editor/index.ts +0 -2
- package/src/editor/plateUI.ts +0 -82
- package/src/editor/plugins/blocks.tsx +0 -71
- package/src/editor/plugins/custom/assets/DefaultThumbnail.tsx +0 -57
- package/src/editor/plugins/custom/assets/index.ts +0 -1
- package/src/editor/plugins/custom/buttons.tsx +0 -289
- package/src/editor/plugins/custom/example.tsx +0 -64
- package/src/editor/plugins/custom/exitBreak.ts +0 -41
- package/src/editor/plugins/custom/footnote.tsx +0 -185
- package/src/editor/plugins/custom/index.ts +0 -14
- package/src/editor/plugins/custom/paywall.tsx +0 -156
- package/src/editor/plugins/custom/qa.tsx +0 -390
- package/src/editor/plugins/custom/resetBlockType.ts +0 -29
- package/src/editor/plugins/custom/selectOnBackspace.ts +0 -7
- package/src/editor/plugins/custom/softBreak.ts +0 -20
- package/src/editor/plugins/custom/styles/Button.module.scss +0 -51
- package/src/editor/plugins/custom/styles/Footnote.module.scss +0 -58
- package/src/editor/plugins/custom/styles/Paywall.module.scss +0 -67
- package/src/editor/plugins/custom/styles/QA.module.scss +0 -140
- package/src/editor/plugins/custom/styles/Video.module.scss +0 -79
- package/src/editor/plugins/custom/video.tsx +0 -163
- package/src/editor/plugins/index.ts +0 -18
- package/src/editor/plugins/inline.ts +0 -46
- package/src/editor/plugins/marks.ts +0 -25
- package/src/editor/plugins/utils.ts +0 -22
- package/src/feedback/Chip/Chip.module.scss +0 -23
- package/src/feedback/Chip/Chip.tsx +0 -58
- package/src/feedback/Chip/index.ts +0 -1
- package/src/feedback/Loader/Loader.module.scss +0 -18
- package/src/feedback/Loader/Loader.spec.js +0 -18
- package/src/feedback/Loader/Loader.tsx +0 -53
- package/src/feedback/Loader/index.ts +0 -1
- package/src/feedback/ProgressBar/ProgressBar.module.scss +0 -13
- package/src/feedback/ProgressBar/ProgressBar.tsx +0 -32
- package/src/feedback/ProgressBar/index.ts +0 -1
- package/src/feedback/Toast/Toast.module.scss +0 -44
- package/src/feedback/Toast/Toast.tsx +0 -76
- package/src/feedback/Toast/index.ts +0 -1
- package/src/feedback/Tooltip/Tooltip.module.scss +0 -47
- package/src/feedback/Tooltip/Tooltip.tsx +0 -10
- package/src/feedback/Tooltip/index.ts +0 -1
- package/src/feedback/index.ts +0 -5
- package/src/global.d.ts +0 -6
- package/src/iconography/Avatar/Avatar.module.scss +0 -90
- package/src/iconography/Avatar/Avatar.spec.js +0 -75
- package/src/iconography/Avatar/Avatar.tsx +0 -96
- package/src/iconography/Avatar/DefaultIcon.svg +0 -4
- package/src/iconography/Avatar/DefaultIcon.tsx +0 -12
- package/src/iconography/Avatar/iconHelpers.tsx +0 -186
- package/src/iconography/Avatar/index.ts +0 -1
- package/src/iconography/ColoredIcon/ColoredIcon.module.scss +0 -40
- package/src/iconography/ColoredIcon/ColoredIcon.tsx +0 -30
- package/src/iconography/ColoredIcon/index.ts +0 -5
- package/src/iconography/DevicePreview/DevicePreview.module.scss +0 -143
- package/src/iconography/DevicePreview/DevicePreview.tsx +0 -592
- package/src/iconography/DevicePreview/index.ts +0 -1
- package/src/iconography/IconHeader/IconHeader.module.scss +0 -42
- package/src/iconography/IconHeader/IconHeader.tsx +0 -42
- package/src/iconography/IconHeader/index.ts +0 -1
- package/src/iconography/StarRating/StarRating.tsx +0 -99
- package/src/iconography/StarRating/index.ts +0 -1
- package/src/iconography/index.ts +0 -5
- package/src/implementations/BodyContent/BodyContent.module.scss +0 -38
- package/src/implementations/BodyContent/BodyContent.tsx +0 -78
- package/src/implementations/BodyContent/index.ts +0 -2
- package/src/implementations/JoinGroupModal/JoinGroupModal.module.scss +0 -83
- package/src/implementations/JoinGroupModal/JoinGroupModal.tsx +0 -176
- package/src/implementations/JoinGroupModal/index.ts +0 -1
- package/src/implementations/index.ts +0 -2
- package/src/index.ts +0 -149
- package/src/inputs/CalendarInput/CalendarInput.module.scss +0 -38
- package/src/inputs/CalendarInput/CalendarInput.spec.js +0 -19
- package/src/inputs/CalendarInput/CalendarInput.tsx +0 -29
- package/src/inputs/CalendarInput/index.ts +0 -1
- package/src/inputs/CheckboxInput/CheckboxInput.module.scss +0 -23
- package/src/inputs/CheckboxInput/CheckboxInput.tsx +0 -39
- package/src/inputs/CheckboxInput/index.ts +0 -1
- package/src/inputs/FeedInput/FeedInput.module.scss +0 -48
- package/src/inputs/FeedInput/FeedInput.spec.js +0 -16
- package/src/inputs/FeedInput/FeedInput.tsx +0 -197
- package/src/inputs/FeedInput/index.ts +0 -1
- package/src/inputs/InboxInput/InboxInput.module.scss +0 -48
- package/src/inputs/InboxInput/InboxInput.spec.js +0 -19
- package/src/inputs/InboxInput/InboxInput.tsx +0 -97
- package/src/inputs/InboxInput/index.ts +0 -1
- package/src/inputs/PostInput/PostInput.module.scss +0 -49
- package/src/inputs/PostInput/PostInput.spec.js +0 -19
- package/src/inputs/PostInput/PostInput.tsx +0 -54
- package/src/inputs/PostInput/index.ts +0 -1
- package/src/inputs/RadioInput/RadioInput.module.scss +0 -68
- package/src/inputs/RadioInput/RadioInput.tsx +0 -55
- package/src/inputs/RadioInput/index.ts +0 -1
- package/src/inputs/SearchInput/SearchInput.module.scss +0 -40
- package/src/inputs/SearchInput/SearchInput.tsx +0 -61
- package/src/inputs/SearchInput/index.ts +0 -1
- package/src/inputs/SelectInput/SelectInput.module.scss +0 -66
- package/src/inputs/SelectInput/SelectInput.tsx +0 -145
- package/src/inputs/SelectInput/index.ts +0 -1
- package/src/inputs/TagInput/TagInput.module.scss +0 -75
- package/src/inputs/TagInput/TagInput.tsx +0 -115
- package/src/inputs/TagInput/index.ts +0 -1
- package/src/inputs/TextInput/TextInput.module.scss +0 -35
- package/src/inputs/TextInput/TextInput.tsx +0 -46
- package/src/inputs/TextInput/index.ts +0 -1
- package/src/inputs/index.ts +0 -10
- package/src/lists/ContactDetails/ContactDetails.module.scss +0 -70
- package/src/lists/ContactDetails/ContactDetails.spec.js +0 -69
- package/src/lists/ContactDetails/ContactDetails.tsx +0 -185
- package/src/lists/ContactDetails/index.ts +0 -1
- package/src/lists/index.ts +0 -1
- package/src/navigation/Breadcrumbs/Breadcrumbs.module.scss +0 -18
- package/src/navigation/Breadcrumbs/Breadcrumbs.spec.js +0 -38
- package/src/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -43
- package/src/navigation/Breadcrumbs/index.ts +0 -1
- package/src/navigation/Drawer/Drawer.module.scss +0 -104
- package/src/navigation/Drawer/Drawer.tsx +0 -177
- package/src/navigation/Drawer/index.ts +0 -1
- package/src/navigation/EditorBar/EditorBar.module.scss +0 -118
- package/src/navigation/EditorBar/EditorBar.tsx +0 -416
- package/src/navigation/EditorBar/components/AlignmentDropdown/AlignmentDropdown.tsx +0 -106
- package/src/navigation/EditorBar/components/AlignmentDropdown/index.ts +0 -1
- package/src/navigation/EditorBar/components/ButtonModal/ButtonModal.module.scss +0 -85
- package/src/navigation/EditorBar/components/ButtonModal/ButtonModal.tsx +0 -314
- package/src/navigation/EditorBar/components/ButtonModal/assets/Comment.tsx +0 -28
- package/src/navigation/EditorBar/components/ButtonModal/assets/GiftSubscription.tsx +0 -28
- package/src/navigation/EditorBar/components/ButtonModal/assets/Link.tsx +0 -28
- package/src/navigation/EditorBar/components/ButtonModal/assets/Share.tsx +0 -28
- package/src/navigation/EditorBar/components/ButtonModal/assets/ShareCommunity.tsx +0 -42
- package/src/navigation/EditorBar/components/ButtonModal/assets/Signup.tsx +0 -68
- package/src/navigation/EditorBar/components/ButtonModal/assets/Special.tsx +0 -24
- package/src/navigation/EditorBar/components/ButtonModal/assets/Subscribe.tsx +0 -28
- package/src/navigation/EditorBar/components/ButtonModal/assets/index.ts +0 -8
- package/src/navigation/EditorBar/components/ButtonModal/index.ts +0 -1
- package/src/navigation/EditorBar/components/FontDropdown/FontDropdown.module.scss +0 -16
- package/src/navigation/EditorBar/components/FontDropdown/FontDropdown.tsx +0 -137
- package/src/navigation/EditorBar/components/FontDropdown/index.ts +0 -1
- package/src/navigation/EditorBar/components/MoreDropdown/MoreDropdown.module.scss +0 -43
- package/src/navigation/EditorBar/components/MoreDropdown/MoreDropdown.tsx +0 -124
- package/src/navigation/EditorBar/components/MoreDropdown/index.ts +0 -1
- package/src/navigation/EditorBar/components/OutlineDropdown/OutlineDropdown.module.scss +0 -21
- package/src/navigation/EditorBar/components/OutlineDropdown/OutlineDropdown.tsx +0 -37
- package/src/navigation/EditorBar/components/OutlineDropdown/index.ts +0 -1
- package/src/navigation/EditorBar/components/TextTypeDropdown/TextTypeDropdown.module.scss +0 -51
- package/src/navigation/EditorBar/components/TextTypeDropdown/TextTypeDropdown.tsx +0 -80
- package/src/navigation/EditorBar/components/TextTypeDropdown/index.ts +0 -1
- package/src/navigation/EditorBar/components/VideoModal/VideoModal.module.scss +0 -150
- package/src/navigation/EditorBar/components/VideoModal/VideoModal.tsx +0 -163
- package/src/navigation/EditorBar/components/VideoModal/index.ts +0 -1
- package/src/navigation/EditorBar/components/index.ts +0 -7
- package/src/navigation/EditorBar/index.ts +0 -1
- package/src/navigation/MenuTabs/MenuTabs.module.scss +0 -34
- package/src/navigation/MenuTabs/MenuTabs.spec.js +0 -36
- package/src/navigation/MenuTabs/MenuTabs.tsx +0 -52
- package/src/navigation/MenuTabs/index.ts +0 -1
- package/src/navigation/Navigation/Navigation.module.scss +0 -92
- package/src/navigation/Navigation/Navigation.spec.js +0 -144
- package/src/navigation/Navigation/Navigation.tsx +0 -111
- package/src/navigation/Navigation/SubNavigation.module.scss +0 -255
- package/src/navigation/Navigation/SubNavigation.spec.js +0 -112
- package/src/navigation/Navigation/SubNavigation.tsx +0 -443
- package/src/navigation/Navigation/index.ts +0 -15
- package/src/navigation/Pagination/Pagination.module.scss +0 -49
- package/src/navigation/Pagination/Pagination.tsx +0 -115
- package/src/navigation/Pagination/index.ts +0 -1
- package/src/navigation/index.ts +0 -21
- package/src/surfaces/Comment/Comment.module.scss +0 -106
- package/src/surfaces/Comment/Comment.spec.js +0 -105
- package/src/surfaces/Comment/Comment.tsx +0 -157
- package/src/surfaces/Comment/index.ts +0 -1
- package/src/surfaces/Faq/Faq.module.scss +0 -91
- package/src/surfaces/Faq/Faq.spec.js +0 -38
- package/src/surfaces/Faq/Faq.tsx +0 -156
- package/src/surfaces/Faq/index.ts +0 -1
- package/src/surfaces/Message/Message.module.scss +0 -37
- package/src/surfaces/Message/Message.spec.js +0 -47
- package/src/surfaces/Message/Message.tsx +0 -54
- package/src/surfaces/Message/index.ts +0 -1
- package/src/surfaces/Modal/Modal.module.scss +0 -52
- package/src/surfaces/Modal/Modal.spec.js +0 -38
- package/src/surfaces/Modal/Modal.tsx +0 -131
- package/src/surfaces/Modal/index.ts +0 -5
- package/src/surfaces/Plan/Plan.module.scss +0 -79
- package/src/surfaces/Plan/Plan.tsx +0 -75
- package/src/surfaces/Plan/index.ts +0 -1
- package/src/surfaces/Post/Post.module.scss +0 -46
- package/src/surfaces/Post/Post.spec.js +0 -103
- package/src/surfaces/Post/Post.tsx +0 -185
- package/src/surfaces/Post/index.ts +0 -1
- package/src/surfaces/Post/postHelpers.ts +0 -20
- package/src/surfaces/ProfileHeader/ProfileHeader.module.scss +0 -202
- package/src/surfaces/ProfileHeader/ProfileHeader.tsx +0 -103
- package/src/surfaces/ProfileHeader/index.ts +0 -1
- package/src/surfaces/RatingsOverview/RatingsOverview.module.scss +0 -54
- package/src/surfaces/RatingsOverview/RatingsOverview.tsx +0 -69
- package/src/surfaces/RatingsOverview/index.ts +0 -1
- package/src/surfaces/Review/Review.module.scss +0 -73
- package/src/surfaces/Review/Review.tsx +0 -88
- package/src/surfaces/Review/index.ts +0 -1
- package/src/surfaces/index.ts +0 -9
- package/src/tables/Filter/Filter.module.scss +0 -34
- package/src/tables/Filter/Filter.tsx +0 -30
- package/src/tables/Filter/index.ts +0 -1
- package/src/tables/Table/Table.module.scss +0 -126
- package/src/tables/Table/Table.spec.js +0 -113
- package/src/tables/Table/Table.tsx +0 -251
- package/src/tables/Table/index.ts +0 -7
- package/src/tables/index.ts +0 -7
- package/tsconfig.json +0 -14
- package/vite.config.ts +0 -29
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import postStyles from "./Post.module.scss";
|
|
3
|
-
import { abbrRelativeTimeString } from "@soul-refiner/utils/src";
|
|
4
|
-
import { User } from "@soul-refiner/models";
|
|
5
|
-
import {
|
|
6
|
-
EllipsisHorizontal,
|
|
7
|
-
Like,
|
|
8
|
-
LikeOutline,
|
|
9
|
-
CommentOutline,
|
|
10
|
-
ShareOutline,
|
|
11
|
-
} from "@soul-refiner/icons/src";
|
|
12
|
-
import { Comment, CommentProps } from "../Comment";
|
|
13
|
-
import { Avatar } from "../../iconography";
|
|
14
|
-
import { Button } from "../../actions";
|
|
15
|
-
import { PostInput } from "../../inputs";
|
|
16
|
-
import { countComments } from "./postHelpers";
|
|
17
|
-
|
|
18
|
-
export interface PostProps extends React.PropsWithChildren {
|
|
19
|
-
comments: CommentProps[];
|
|
20
|
-
content: string;
|
|
21
|
-
created: Date;
|
|
22
|
-
hasReacted: boolean;
|
|
23
|
-
locked: boolean;
|
|
24
|
-
onComment: (comment: string) => void;
|
|
25
|
-
onReact: () => void;
|
|
26
|
-
onShare: () => void;
|
|
27
|
-
poster: User;
|
|
28
|
-
postId: string;
|
|
29
|
-
reactions: number;
|
|
30
|
-
shares?: number;
|
|
31
|
-
userAvatarSrc: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const Post = ({
|
|
35
|
-
comments,
|
|
36
|
-
children,
|
|
37
|
-
content,
|
|
38
|
-
created,
|
|
39
|
-
hasReacted,
|
|
40
|
-
onComment,
|
|
41
|
-
onReact,
|
|
42
|
-
onShare,
|
|
43
|
-
poster,
|
|
44
|
-
reactions,
|
|
45
|
-
shares,
|
|
46
|
-
userAvatarSrc,
|
|
47
|
-
}: PostProps) => {
|
|
48
|
-
const [comment, setComment] = React.useState("");
|
|
49
|
-
const [showComments, setShowComments] = React.useState(false);
|
|
50
|
-
|
|
51
|
-
const handleShowComments = () => setShowComments((prev) => !prev);
|
|
52
|
-
|
|
53
|
-
const handleChange = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
|
54
|
-
setComment((event.target as HTMLTextAreaElement).value);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const handleReplySubmit = (
|
|
58
|
-
event: React.KeyboardEvent<HTMLTextAreaElement>
|
|
59
|
-
) => {
|
|
60
|
-
if (event.key === "Enter") {
|
|
61
|
-
event.preventDefault();
|
|
62
|
-
onComment(comment);
|
|
63
|
-
handleShowComments();
|
|
64
|
-
setComment("");
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const commentCount = comments?.length ? countComments(comments) : 0;
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<section className={`${postStyles.post}`}>
|
|
72
|
-
<div className="post-header">
|
|
73
|
-
<Avatar
|
|
74
|
-
as="a"
|
|
75
|
-
data-testid="post-avatar"
|
|
76
|
-
href=""
|
|
77
|
-
size={64}
|
|
78
|
-
title={`${poster.firstName} ${poster.lastName}`}
|
|
79
|
-
subtitle={abbrRelativeTimeString(created)}
|
|
80
|
-
url={poster.avatar ? poster.avatar : ""}
|
|
81
|
-
/>
|
|
82
|
-
<EllipsisHorizontal
|
|
83
|
-
as="button"
|
|
84
|
-
size={24}
|
|
85
|
-
iconSize={19}
|
|
86
|
-
fill="var(--color-grey-4)"
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
<p className="body post-content body-large">{content}</p>
|
|
90
|
-
<div className="children">{children}</div>
|
|
91
|
-
<div className="action-bar">
|
|
92
|
-
<Button
|
|
93
|
-
bold={false}
|
|
94
|
-
buttonColor="white"
|
|
95
|
-
color="var(--color-grey-4)"
|
|
96
|
-
icon={
|
|
97
|
-
hasReacted ? (
|
|
98
|
-
<Like iconSize={20} size={21} fill="var(--colorify-blue-3)" />
|
|
99
|
-
) : (
|
|
100
|
-
<LikeOutline
|
|
101
|
-
iconSize={20}
|
|
102
|
-
size={21}
|
|
103
|
-
fill="var(--colorify-blue-3)"
|
|
104
|
-
/>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
onClick={onReact}
|
|
108
|
-
shape="rectangular"
|
|
109
|
-
style={
|
|
110
|
-
{
|
|
111
|
-
"--hover-color": "var(--color-grey-9)",
|
|
112
|
-
} as React.CSSProperties
|
|
113
|
-
}
|
|
114
|
-
uppercase={false}
|
|
115
|
-
>
|
|
116
|
-
{reactions ? reactions + " Likes" : "Like"}
|
|
117
|
-
</Button>
|
|
118
|
-
<Button
|
|
119
|
-
bold={false}
|
|
120
|
-
buttonColor="white"
|
|
121
|
-
color="var(--color-grey-4)"
|
|
122
|
-
icon={
|
|
123
|
-
<CommentOutline
|
|
124
|
-
iconSize={16}
|
|
125
|
-
size={21}
|
|
126
|
-
fill="var(--colorify-blue-3)"
|
|
127
|
-
/>
|
|
128
|
-
}
|
|
129
|
-
onClick={handleShowComments}
|
|
130
|
-
shape="rectangular"
|
|
131
|
-
style={
|
|
132
|
-
{
|
|
133
|
-
"--hover-color": "var(--color-grey-9)",
|
|
134
|
-
} as React.CSSProperties
|
|
135
|
-
}
|
|
136
|
-
uppercase={false}
|
|
137
|
-
>
|
|
138
|
-
{commentCount === 0
|
|
139
|
-
? "Comment"
|
|
140
|
-
: commentCount === 1
|
|
141
|
-
? "1 Comment"
|
|
142
|
-
: commentCount + " Comments"}
|
|
143
|
-
</Button>
|
|
144
|
-
<Button
|
|
145
|
-
bold={false}
|
|
146
|
-
buttonColor="white"
|
|
147
|
-
color="var(--color-grey-4)"
|
|
148
|
-
icon={
|
|
149
|
-
<ShareOutline
|
|
150
|
-
iconSize={21}
|
|
151
|
-
size={21}
|
|
152
|
-
fill="var(--colorify-blue-3)"
|
|
153
|
-
/>
|
|
154
|
-
}
|
|
155
|
-
onClick={onShare}
|
|
156
|
-
shape="rectangular"
|
|
157
|
-
style={
|
|
158
|
-
{
|
|
159
|
-
"--hover-color": "var(--color-grey-9)",
|
|
160
|
-
} as React.CSSProperties
|
|
161
|
-
}
|
|
162
|
-
uppercase={false}
|
|
163
|
-
>
|
|
164
|
-
{shares ? shares + " Shares" : "Share"}
|
|
165
|
-
</Button>
|
|
166
|
-
</div>
|
|
167
|
-
{showComments && !!comments.length && (
|
|
168
|
-
<div className="comments">
|
|
169
|
-
{comments.map((comment) => (
|
|
170
|
-
<Comment key={comment.id} {...comment} />
|
|
171
|
-
))}
|
|
172
|
-
</div>
|
|
173
|
-
)}
|
|
174
|
-
<form className="input-bar">
|
|
175
|
-
<Avatar size={40} url={userAvatarSrc} />
|
|
176
|
-
<PostInput
|
|
177
|
-
placeholder="Write a comment"
|
|
178
|
-
onChange={handleChange}
|
|
179
|
-
onKeyDown={handleReplySubmit}
|
|
180
|
-
value={comment}
|
|
181
|
-
/>
|
|
182
|
-
</form>
|
|
183
|
-
</section>
|
|
184
|
-
);
|
|
185
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Post, type PostProps } from "./Post";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CommentProps } from "../Comment";
|
|
2
|
-
|
|
3
|
-
export const countComments = (comments: CommentProps[]) => {
|
|
4
|
-
return comments.reduce((prev: number, current: CommentProps) => {
|
|
5
|
-
let currentNumber = 1;
|
|
6
|
-
if (!!current.replies) {
|
|
7
|
-
currentNumber = currentNumber + current.replies.length;
|
|
8
|
-
}
|
|
9
|
-
return prev + currentNumber;
|
|
10
|
-
}, 0);
|
|
11
|
-
|
|
12
|
-
// TODO: recursively return total of all comments
|
|
13
|
-
// return comments.reduce((prev: number, current: CommentProps) => {
|
|
14
|
-
// let currentNumber = 1;
|
|
15
|
-
// if (!!current.replies) {
|
|
16
|
-
// currentNumber = currentNumber + countComments(current.replies);
|
|
17
|
-
// }
|
|
18
|
-
// return prev + currentNumber;
|
|
19
|
-
// }, 0);
|
|
20
|
-
};
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
.header {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
position: relative;
|
|
5
|
-
border-radius: var(--border-radius-normal);
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
background-color: #FFF;
|
|
8
|
-
box-shadow: 0 -4px inset #F5F5F5;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.hero {
|
|
12
|
-
height: 640px;
|
|
13
|
-
background-color: black;
|
|
14
|
-
position: relative;
|
|
15
|
-
|
|
16
|
-
.heroImage {
|
|
17
|
-
height: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.editHeroButton {
|
|
21
|
-
position: absolute;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
right: 0;
|
|
24
|
-
bottom: 20px;
|
|
25
|
-
right: 20px;
|
|
26
|
-
background-color: var(--color-grey-7);
|
|
27
|
-
|
|
28
|
-
[class~=icon] {
|
|
29
|
-
background-color: transparent;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
& svg {
|
|
33
|
-
fill: var(--color-grey-2);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[class~=icon] {
|
|
37
|
-
background-color: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:active {
|
|
41
|
-
color: var(--color-grey-3);
|
|
42
|
-
& svg {
|
|
43
|
-
fill: var(--color-grey-3);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
span {
|
|
48
|
-
display: flex;
|
|
49
|
-
gap: 8px;
|
|
50
|
-
place-items: center;
|
|
51
|
-
place-content: center;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.details {
|
|
57
|
-
gap: 16px;
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
position: relative;
|
|
61
|
-
padding: 0 128px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
[class~=headerPadding] {
|
|
65
|
-
padding-top: 47px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
[class~=avatar] {
|
|
69
|
-
position: absolute;
|
|
70
|
-
left: 50%;
|
|
71
|
-
top: 0;
|
|
72
|
-
background-color: white;
|
|
73
|
-
border: 4px solid white;
|
|
74
|
-
height: 175px;
|
|
75
|
-
width: 175px;
|
|
76
|
-
border-radius: 100%;
|
|
77
|
-
transform: translateY(-50%) translateX(-50%);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.editAvatarButton {
|
|
81
|
-
background-color: var(--color-grey-7);
|
|
82
|
-
width: 40px;
|
|
83
|
-
height: 40px;
|
|
84
|
-
border-radius: 100%;
|
|
85
|
-
position: absolute;
|
|
86
|
-
bottom: 0;
|
|
87
|
-
right: 0;
|
|
88
|
-
display: flex;
|
|
89
|
-
place-items: center;
|
|
90
|
-
place-content: center;
|
|
91
|
-
& svg {
|
|
92
|
-
fill: var(--color-grey-2);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[class~=icon] {
|
|
96
|
-
background-color: transparent;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&:active {
|
|
100
|
-
& svg {
|
|
101
|
-
fill: var(--color-grey-3);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.avatar- {
|
|
107
|
-
|
|
108
|
-
&profile {
|
|
109
|
-
max-width: 140px;
|
|
110
|
-
max-height: 140px;
|
|
111
|
-
top: 50%;
|
|
112
|
-
img {
|
|
113
|
-
max-height: 100%;
|
|
114
|
-
max-width: 100%;
|
|
115
|
-
border-radius: 100%;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&group, &channel {
|
|
120
|
-
max-width: 175px;
|
|
121
|
-
max-height: 175px;
|
|
122
|
-
|
|
123
|
-
img {
|
|
124
|
-
max-height: 100%;
|
|
125
|
-
max-width: 100%;
|
|
126
|
-
border-radius: 100%;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.editAvatarButton:hover, .editHeroButton:hover {
|
|
133
|
-
background-color: var(--color-grey-8);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.upper {
|
|
137
|
-
display: flex;
|
|
138
|
-
flex-direction: row;
|
|
139
|
-
place-content: space-between;
|
|
140
|
-
place-items: flex-end;
|
|
141
|
-
|
|
142
|
-
.title {
|
|
143
|
-
font-size: var(--size-24);
|
|
144
|
-
color: var(--color-grey-0);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.subtitle {
|
|
148
|
-
font-size: var(--size-16);
|
|
149
|
-
color: var(--color-grey-6);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.stats {
|
|
153
|
-
display: flex;
|
|
154
|
-
flex-direction: row;
|
|
155
|
-
gap: 16px;
|
|
156
|
-
place-items: center;
|
|
157
|
-
font-size: var(--size-14);
|
|
158
|
-
color: var(--color-grey-6);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.lower {
|
|
163
|
-
border-top: 1px solid #e8e8e8;
|
|
164
|
-
display: flex;
|
|
165
|
-
flex-direction: row;
|
|
166
|
-
place-content: space-between;
|
|
167
|
-
height: 65px;
|
|
168
|
-
place-items: stretch;
|
|
169
|
-
padding-bottom: 4px;
|
|
170
|
-
|
|
171
|
-
.actions {
|
|
172
|
-
display: flex;
|
|
173
|
-
gap: 16px;
|
|
174
|
-
place-items: center;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
[class~=ctaButton] {
|
|
179
|
-
background-color: var(--color-blue-3);
|
|
180
|
-
color: #FFF;
|
|
181
|
-
font-size: var(--size-14);
|
|
182
|
-
font-weight: var(--weight-inter-semibold);
|
|
183
|
-
|
|
184
|
-
&:hover {
|
|
185
|
-
background-color: var(--color-blue-2);
|
|
186
|
-
|
|
187
|
-
[class~=icon] {
|
|
188
|
-
background-color: rgba(255 255 255 / 20%);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
[class~=icon] {
|
|
193
|
-
background-color: rgba(255 255 255 / 20%);
|
|
194
|
-
|
|
195
|
-
&>svg {
|
|
196
|
-
fill: #FFF;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Camera } from "@soul-refiner/icons/src";
|
|
3
|
-
import headerStyles from "./ProfileHeader.module.scss";
|
|
4
|
-
import { MenuTabs } from "../../navigation/MenuTabs";
|
|
5
|
-
import { Button } from "../../actions";
|
|
6
|
-
|
|
7
|
-
export interface ProfileHeaderProps {
|
|
8
|
-
avatarUrl: string;
|
|
9
|
-
heroUrl: string;
|
|
10
|
-
title: string;
|
|
11
|
-
subtitle: string;
|
|
12
|
-
isOwner: boolean;
|
|
13
|
-
menuItems: Array<React.ReactNode>;
|
|
14
|
-
activeMenuItem: number;
|
|
15
|
-
actionItems?: React.ReactNode;
|
|
16
|
-
statItems?: React.ReactNode;
|
|
17
|
-
onChangeAvatar: () => void;
|
|
18
|
-
onChangeHero: () => void;
|
|
19
|
-
onTabClick: (index: number) => void;
|
|
20
|
-
headerType: "group" | "channel" | "profile" | "course";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const ProfileHeader = ({
|
|
24
|
-
avatarUrl,
|
|
25
|
-
heroUrl,
|
|
26
|
-
title = "John Doe",
|
|
27
|
-
subtitle = "Subtitle",
|
|
28
|
-
isOwner = false,
|
|
29
|
-
headerType = "group",
|
|
30
|
-
menuItems = [],
|
|
31
|
-
activeMenuItem = 0,
|
|
32
|
-
actionItems,
|
|
33
|
-
statItems,
|
|
34
|
-
onChangeAvatar,
|
|
35
|
-
onChangeHero,
|
|
36
|
-
onTabClick,
|
|
37
|
-
}: ProfileHeaderProps) => {
|
|
38
|
-
return (
|
|
39
|
-
<div className={`${headerStyles.header}`}>
|
|
40
|
-
{headerType !== "course" && headerType !== "profile" && (
|
|
41
|
-
<div className={headerStyles.hero}>
|
|
42
|
-
<img src={heroUrl} className={headerStyles.heroImage} />
|
|
43
|
-
{isOwner && (
|
|
44
|
-
<Button
|
|
45
|
-
className={headerStyles.editHeroButton}
|
|
46
|
-
onClick={onChangeHero}
|
|
47
|
-
color="var(--color-grey-0)"
|
|
48
|
-
uppercase={false}
|
|
49
|
-
>
|
|
50
|
-
<Camera
|
|
51
|
-
fill="var(--color-grey-1)"
|
|
52
|
-
iconSize={21}
|
|
53
|
-
size={21}
|
|
54
|
-
inline={true}
|
|
55
|
-
style={{ margin: 0 }}
|
|
56
|
-
/>{" "}
|
|
57
|
-
Edit
|
|
58
|
-
</Button>
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
<div className={headerStyles.details}>
|
|
63
|
-
{headerType !== "course" && (
|
|
64
|
-
<>
|
|
65
|
-
<div className={`${headerStyles[`avatar-${headerType}`]} avatar`}>
|
|
66
|
-
<img src={avatarUrl} />
|
|
67
|
-
{isOwner && (
|
|
68
|
-
<Button
|
|
69
|
-
className={headerStyles.editAvatarButton}
|
|
70
|
-
onClick={onChangeAvatar}
|
|
71
|
-
padded={false}
|
|
72
|
-
>
|
|
73
|
-
<Camera
|
|
74
|
-
fill="var(--color-grey-1)"
|
|
75
|
-
iconSize={21}
|
|
76
|
-
size={21}
|
|
77
|
-
style={{ margin: 0 }}
|
|
78
|
-
/>
|
|
79
|
-
</Button>
|
|
80
|
-
)}
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div className={`${headerStyles.upper} headerPadding`}>
|
|
84
|
-
<div className={headerStyles.titles}>
|
|
85
|
-
<div className={headerStyles.title}>{title}</div>
|
|
86
|
-
<div className={headerStyles.subtitle}>{subtitle}</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div className={headerStyles.stats}>{statItems}</div>
|
|
89
|
-
</div>
|
|
90
|
-
</>
|
|
91
|
-
)}
|
|
92
|
-
<div className={headerStyles.lower}>
|
|
93
|
-
<MenuTabs
|
|
94
|
-
activeItem={activeMenuItem}
|
|
95
|
-
onTabClick={onTabClick}
|
|
96
|
-
tabItems={menuItems}
|
|
97
|
-
/>
|
|
98
|
-
<div className={headerStyles.actions}>{actionItems}</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProfileHeader, type ProfileHeaderProps } from "./ProfileHeader";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
.ratingsOverview {
|
|
2
|
-
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
gap: 16px;
|
|
6
|
-
|
|
7
|
-
[class~=upper] {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
place-items: center;
|
|
11
|
-
gap: 10px;
|
|
12
|
-
|
|
13
|
-
&>div {
|
|
14
|
-
color: var(--color-grey-3);
|
|
15
|
-
font-weight: var(--weight-inter-bold);
|
|
16
|
-
|
|
17
|
-
&:first-child {
|
|
18
|
-
font-size: 3.8em;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&:last-child {
|
|
22
|
-
font-size: var(--size-16);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ratingElement {
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: row;
|
|
30
|
-
gap: 16px;
|
|
31
|
-
flex: 1;
|
|
32
|
-
place-items: center;
|
|
33
|
-
|
|
34
|
-
.stat, .statPercent {
|
|
35
|
-
font-size: var(--size-18);
|
|
36
|
-
font-weight: var(--weight-inter-bold);
|
|
37
|
-
color: var(--color-grey-5);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[class~=rating] {
|
|
41
|
-
display: flex;
|
|
42
|
-
place-items: center;
|
|
43
|
-
width: 40px;
|
|
44
|
-
justify-content: space-between;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.statPercent {
|
|
48
|
-
font-size: var(--size-16);
|
|
49
|
-
place-content: flex-end;
|
|
50
|
-
width: 40px;
|
|
51
|
-
display: flex;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Star } from "@soul-refiner/icons/src";
|
|
3
|
-
import ratingsStyle from "./RatingsOverview.module.scss";
|
|
4
|
-
import { StarRating } from "../../iconography";
|
|
5
|
-
import { ProgressBar } from "../../feedback";
|
|
6
|
-
import { Button } from "../../actions";
|
|
7
|
-
|
|
8
|
-
export interface RatingsOverviewProps {
|
|
9
|
-
rating: number;
|
|
10
|
-
reviewCount: number;
|
|
11
|
-
stars: RatingInterface;
|
|
12
|
-
onWriteReview: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface RatingInterface {
|
|
16
|
-
one: number;
|
|
17
|
-
two: number;
|
|
18
|
-
three: number;
|
|
19
|
-
four: number;
|
|
20
|
-
five: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const RatingElement = (rating: number, percent: number) => {
|
|
24
|
-
return (
|
|
25
|
-
<div className={ratingsStyle.ratingElement}>
|
|
26
|
-
<div className="rating">
|
|
27
|
-
<div className={ratingsStyle.stat}>{rating}</div>
|
|
28
|
-
<div>
|
|
29
|
-
<Star fill="#D5A806" />
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<ProgressBar color="var(--color-yellow-4)" percent={percent} />
|
|
34
|
-
|
|
35
|
-
<div className={ratingsStyle.statPercent}>{percent}%</div>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const RatingsOverview = ({
|
|
41
|
-
rating = 4,
|
|
42
|
-
reviewCount = 4,
|
|
43
|
-
stars = { one: 1, two: 0, three: 0, four: 0, five: 50 },
|
|
44
|
-
onWriteReview = () => {
|
|
45
|
-
alert("On Write Review");
|
|
46
|
-
},
|
|
47
|
-
}: RatingsOverviewProps) => {
|
|
48
|
-
return (
|
|
49
|
-
<div className={ratingsStyle.ratingsOverview}>
|
|
50
|
-
<div className="upper">
|
|
51
|
-
<div>{rating}</div>
|
|
52
|
-
<div>
|
|
53
|
-
<StarRating rating={rating} width={147} />
|
|
54
|
-
</div>
|
|
55
|
-
<div>{reviewCount} reviews</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div>
|
|
58
|
-
<div>{RatingElement(5, stars.five)}</div>
|
|
59
|
-
<div>{RatingElement(4, stars.four)}</div>
|
|
60
|
-
<div>{RatingElement(3, stars.three)}</div>
|
|
61
|
-
<div>{RatingElement(2, stars.two)}</div>
|
|
62
|
-
<div>{RatingElement(1, stars.one)}</div>
|
|
63
|
-
</div>
|
|
64
|
-
<Button buttonType="secondary" onClick={onWriteReview} fluid={true}>
|
|
65
|
-
Write a review
|
|
66
|
-
</Button>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RatingsOverview, type RatingsOverviewProps } from "./RatingsOverview";
|