From c0e7fc3db94610087598f21b16162949fb9171e8 Mon Sep 17 00:00:00 2001 From: Lauren Davidson <32903719+1aurend@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:53:05 -0800 Subject: [PATCH] [E] Update user verification BE messaging --- .../components/layout/DrawerHeader/styles.js | 21 ++++++- .../users/{Edit.js => Edit/index.js} | 59 +++++++++++++++---- .../backend/containers/users/Edit/styles.js | 25 ++++++++ .../__tests__/__snapshots__/Edit-test.js.snap | 2 +- .../locale/en-US/json/backend/records.json | 10 +++- 5 files changed, 101 insertions(+), 16 deletions(-) rename client/src/backend/containers/users/{Edit.js => Edit/index.js} (85%) create mode 100644 client/src/backend/containers/users/Edit/styles.js diff --git a/client/src/backend/components/layout/DrawerHeader/styles.js b/client/src/backend/components/layout/DrawerHeader/styles.js index 1c59e402af..a0fb8c45b5 100644 --- a/client/src/backend/components/layout/DrawerHeader/styles.js +++ b/client/src/backend/components/layout/DrawerHeader/styles.js @@ -2,7 +2,8 @@ import styled from "@emotion/styled"; import { fluidScale, headingQuaternary, - subtitlePrimary + subtitlePrimary, + respond } from "theme/styles/mixins"; import Utility from "global/components/utility"; @@ -41,5 +42,21 @@ export const ButtonGroup = styled.div` ${({ $grid }) => $grid && - `display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px;`} + ` + > *:not(:last-child) { + margin-right: 1em; + } + ${respond( + ` + display: grid; + grid-template-columns: 1.25fr 1fr; + grid-template-rows: 1fr 1fr; + gap: 12px; + + > *:not(:last-child) { + margin-right: 0; + } + `, + 40 + )}`} `; diff --git a/client/src/backend/containers/users/Edit.js b/client/src/backend/containers/users/Edit/index.js similarity index 85% rename from client/src/backend/containers/users/Edit.js rename to client/src/backend/containers/users/Edit/index.js index be485cca8e..5d14623e91 100644 --- a/client/src/backend/containers/users/Edit.js +++ b/client/src/backend/containers/users/Edit/index.js @@ -12,6 +12,7 @@ import FormContainer from "global/containers/form"; import get from "lodash/get"; import lh from "helpers/linkHandler"; import Layout from "backend/components/layout"; +import * as Styled from "./styles"; const { request, flush } = entityStoreActions; @@ -145,20 +146,55 @@ export class UsersEditContainer extends PureComponent { ); }; + humanReadableDate = date => { + return this.props.t("dates.date", { + val: new Date(date), + formatParams: { + val: { year: "numeric", month: "long", day: "numeric" } + } + }); + }; + + get noPublicEngagement() { + const attr = this.user.attributes; + return !(attr.trusted || attr.established); + } + + get userVerificationList() { + const t = this.props.t; + const attr = this.user.attributes; + + const emailMessage = attr.emailConfirmed + ? t("records.users.email_verified_at", { + date: this.humanReadableDate(attr.emailConfirmedAt) + }) + : t("records.users.email_not_verified"); + + return ( + <> +