Skip to content

Commit cb16b53

Browse files
committed
[B] Correct resource comment message for unverified users
1 parent f42aafe commit cb16b53

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

client/src/config/app/locale/en-US/json/frontend/placeholders.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"discuss_entity": "Discuss this {{entity}}…",
1717
"unauthenticated": "Log in to post a comment",
1818
"unauthenticated_full": "<0>Log in</0> to view and add comments.",
19+
"unverified": "You must verify your account before viewing or adding comments. You can resend the verification email from your <0>profile page</0>.",
1920
"deleted": "This comment was deleted."
2021
},
2122
"my_starred": {

client/src/frontend/components/resource/Detail/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import VariantList from "../VariantList";
1111
import Share from "../Share";
1212
import Annotations from "./Annotations";
1313
import { uiVisibilityActions } from "actions";
14+
import { useAuthentication } from "hooks";
1415
import * as Styled from "./styles";
1516
import * as StyledLink from "../Link/styles";
1617

1718
export default function ResourceDetail({ resource, projectTitle }) {
1819
const { t } = useTranslation();
1920
const dispatch = useDispatch();
21+
const authentication = useAuthentication();
2022

2123
if (!resource) return null;
2224

@@ -75,7 +77,11 @@ export default function ResourceDetail({ resource, projectTitle }) {
7577
) : (
7678
<Styled.EmptyMessage>
7779
<Trans
78-
i18nKey="placeholders.comments.unauthenticated_full"
80+
i18nKey={
81+
authentication?.authenticated
82+
? "placeholders.comments.unverified"
83+
: "placeholders.comments.unauthenticated_full"
84+
}
7985
components={[
8086
<Styled.LoginButton type="button" onClick={onLoginClick} />
8187
]}

0 commit comments

Comments
 (0)