Skip to content

Commit 83f0e9d

Browse files
authored
fix: enable Web2 User to Create Exclusive Content when post a comment (#1727)
* fix: enable Web2 User to Create Exclusive Content when post a comment * fix: change experience to timeline when add, update, and clone
1 parent 5706ae6 commit 83f0e9d

7 files changed

Lines changed: 24 additions & 80 deletions

File tree

src/components/CommentEditor/CommentAction.tsx

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {EmojiPickerToolbarButton} from 'components/common/Editor/render/Toolbar/
2222
import {formatToString} from 'components/common/NodeViewer/formatter';
2323
import ShowIf from 'components/common/show-if.component';
2424
import {ExclusiveContentPost} from 'src/interfaces/exclusive';
25-
import {User} from 'src/interfaces/user';
2625
import i18n from 'src/locale';
2726

2827
type CommentActionProps = {
@@ -33,7 +32,6 @@ type CommentActionProps = {
3332
exclusiveContent?: ExclusiveContentPost;
3433
handleRemoveExclusiveContent: () => void;
3534
handleOpenExclusiveContent: () => void;
36-
user: User;
3735
};
3836

3937
export const CommentAction: React.FC<CommentActionProps> = props => {
@@ -44,7 +42,6 @@ export const CommentAction: React.FC<CommentActionProps> = props => {
4442
exclusiveContent,
4543
handleRemoveExclusiveContent,
4644
handleOpenExclusiveContent,
47-
user,
4845
} = props;
4946

5047
const styles = useStyles({mobile: false});
@@ -78,38 +75,15 @@ export const CommentAction: React.FC<CommentActionProps> = props => {
7875
</ButtonGroup>
7976
<ButtonGroup color="primary">
8077
{!exclusiveContent ? (
81-
<>
82-
{user.fullAccess ? (
83-
<IconButton
84-
onClick={handleOpenExclusiveContent}
85-
disabled={length === 0}
86-
className={styles.attachButton}>
87-
<SvgIcon component={PaperClipIcon} viewBox="0 0 24 24" color="primary" />
88-
<Typography component="span" color="primary" variant="body1">
89-
{i18n.t('ExclusiveContent.Attach')}
90-
</Typography>
91-
</IconButton>
92-
) : (
93-
<Tooltip
94-
title={<Typography>{i18n.t('ExclusiveContent.Text.Tooltip')}</Typography>}
95-
aria-label="exclusive-content">
96-
<IconButton aria-label="exclusive-content" onClick={null}>
97-
<SvgIcon
98-
component={PaperClipIcon}
99-
viewBox="0 0 24 24"
100-
className={styles.giftIconGray}
101-
/>
102-
<Typography
103-
component="span"
104-
color={'#C2C2C2' as never}
105-
variant="body1"
106-
style={{lineHeight: 1.8}}>
107-
{i18n.t('ExclusiveContent.Add')}
108-
</Typography>
109-
</IconButton>
110-
</Tooltip>
111-
)}
112-
</>
78+
<IconButton
79+
onClick={handleOpenExclusiveContent}
80+
disabled={length === 0}
81+
className={styles.attachButton}>
82+
<SvgIcon component={PaperClipIcon} viewBox="0 0 24 24" color="primary" />
83+
<Typography component="span" color="primary" variant="body1">
84+
{i18n.t('ExclusiveContent.Attach')}
85+
</Typography>
86+
</IconButton>
11387
) : (
11488
<IconButton
11589
onClick={handleRemoveExclusiveContent}

src/components/CommentEditor/CommentActionMobile.tsx

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
import {useStyles} from './CommentEditor.style';
1818

1919
import {ExclusiveContentPost} from 'src/interfaces/exclusive';
20-
import {User} from 'src/interfaces/user';
2120
import i18n from 'src/locale';
2221

2322
type CommentActionProps = {
@@ -28,7 +27,6 @@ type CommentActionProps = {
2827
exclusiveContent?: ExclusiveContentPost;
2928
handleRemoveExclusiveContent: () => void;
3029
handleOpenExclusiveContent: () => void;
31-
user: User;
3230
};
3331

3432
export const CommentActionMobile: React.FC<CommentActionProps> = props => {
@@ -39,7 +37,6 @@ export const CommentActionMobile: React.FC<CommentActionProps> = props => {
3937
exclusiveContent,
4038
handleRemoveExclusiveContent,
4139
handleOpenExclusiveContent,
42-
user,
4340
} = props;
4441

4542
const styles = useStyles({mobile: false});
@@ -63,38 +60,15 @@ export const CommentActionMobile: React.FC<CommentActionProps> = props => {
6360
</ButtonGroup>
6461
<ButtonGroup color="primary">
6562
{!exclusiveContent ? (
66-
<>
67-
{user.fullAccess ? (
68-
<IconButton
69-
onClick={handleOpenExclusiveContent}
70-
disabled={length === 0}
71-
className={styles.attachButton}>
72-
<SvgIcon component={PaperClipIcon} viewBox="0 0 24 24" color="primary" />
73-
<Typography component="span" color="primary" variant="body1">
74-
{i18n.t('ExclusiveContent.Attach')}
75-
</Typography>
76-
</IconButton>
77-
) : (
78-
<Tooltip
79-
title={<Typography>{i18n.t('ExclusiveContent.Text.Tooltip')}</Typography>}
80-
aria-label="exclusive-content">
81-
<IconButton aria-label="exclusive-content" onClick={null}>
82-
<SvgIcon
83-
component={PaperClipIcon}
84-
viewBox="0 0 24 24"
85-
className={styles.giftIconGray}
86-
/>
87-
<Typography
88-
component="span"
89-
color={'#C2C2C2' as never}
90-
variant="body1"
91-
style={{lineHeight: 1.8}}>
92-
{i18n.t('ExclusiveContent.Add')}
93-
</Typography>
94-
</IconButton>
95-
</Tooltip>
96-
)}
97-
</>
63+
<IconButton
64+
onClick={handleOpenExclusiveContent}
65+
disabled={length === 0}
66+
className={styles.attachButton}>
67+
<SvgIcon component={PaperClipIcon} viewBox="0 0 24 24" color="primary" />
68+
<Typography component="span" color="primary" variant="body1">
69+
{i18n.t('ExclusiveContent.Attach')}
70+
</Typography>
71+
</IconButton>
9872
) : (
9973
<IconButton
10074
onClick={handleRemoveExclusiveContent}

src/components/CommentEditor/CommentEditor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ const CommentEditor = (props: CommentEditorProps, ref: React.ForwardedRef<HTMLDi
197197
exclusiveContent={exclusiveContent}
198198
handleOpenExclusiveContent={handleOpenExclusiveContent}
199199
handleRemoveExclusiveContent={handleRemoveExclusiveContent}
200-
user={user}
201200
/>
202201
</Editor>
203202
</div>

src/hooks/use-experience-hook.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const useExperienceHook = () => {
146146

147147
enqueueSnackbar({
148148
variant: 'success',
149-
message: 'Experience successfully cloned!',
149+
message: 'Timeline successfully cloned!',
150150
});
151151
}),
152152
);
@@ -174,7 +174,7 @@ export const useExperienceHook = () => {
174174

175175
enqueueSnackbar({
176176
variant: 'success',
177-
message: 'experience succesfully updated!',
177+
message: 'Timeline successfully updated!',
178178
});
179179
}),
180180
);
@@ -187,7 +187,7 @@ export const useExperienceHook = () => {
187187

188188
enqueueSnackbar({
189189
variant: 'success',
190-
message: 'Experience succesfully created!',
190+
message: 'Timeline successfully created!',
191191
});
192192
}),
193193
);

src/locale/en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,7 @@
12521252
"Text" : {
12531253
"NetworkError" : "Payment only available in {{accept}} now you are in {{current}}. Switch network to proceed",
12541254
"NotLogin" : "This is paid content. Sign in with your crypto wallet to view it.",
1255-
"Web2User" : "You don’t have any wallet connected to your account. Let’s try to connect your wallet to reveal this exclusive content.",
1256-
"Tooltip" : "Connect your wallet to use this feature."
1255+
"Web2User" : "You don’t have any wallet connected to your account. Let’s try to connect your wallet to reveal this exclusive content."
12571256
},
12581257
"Prompt_Success" : {
12591258
"Title" : "Unlock Content Success"

src/locale/id.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,8 +1248,7 @@
12481248
"Text" : {
12491249
"NetworkError" : "Pembayaran hanya berlaku di jaringan {{accept}} saat ini anda berada di jaringan {{current}}. Ubah jaringan untuk memproses pembayaran",
12501250
"NotLogin" : "Ini adalah konten berbayar. Masuk dengan dompet kripto Anda untuk melihatnya.",
1251-
"Web2User" : "Anda tidak memiliki dompet yang terhubung ke akun Anda. Mari coba sambungkan dompet Anda untuk membuka konten eksklusif ini.",
1252-
"Tooltip" : "Hubungkan dompet kripto Anda untuk menggunakan fitur ini."
1251+
"Web2User" : "Anda tidak memiliki dompet yang terhubung ke akun Anda. Mari coba sambungkan dompet Anda untuk membuka konten eksklusif ini."
12531252
},
12541253
"Prompt_Success" : {
12551254
"Title" : "Konten Berhasil Dibuka"

src/locale/ru.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,7 @@
12381238
"Text" : {
12391239
"NetworkError" : "Оплата доступна только в {{accept}}, теперь вы находитесь в {{current}}. Переключите сеть, чтобы продолжить",
12401240
"NotLogin" : "Это платный контент. Войдите в свой крипто-кошелек, чтобы просмотреть его.",
1241-
"Web2User" : "У вас нет кошелька, подключенного к вашей учетной записи. Давайте попробуем подключить ваш кошелек, чтобы открыть этот эксклюзивный контент.",
1242-
"Tooltip" : "Подключите свой кошелек, чтобы использовать эту функцию."
1241+
"Web2User" : "У вас нет кошелька, подключенного к вашей учетной записи. Давайте попробуем подключить ваш кошелек, чтобы открыть этот эксклюзивный контент."
12431242
},
12441243
"Prompt_Success" : {
12451244
"Title" : "Разблокируйте успех контента"

0 commit comments

Comments
 (0)