A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
feat(app): add Operator Pass wall settings and wall name field
Hampus687523ff5ed4
diff --git a/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.module.css b/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.module.cssnew file mode 100644index 000000000..019d1bf79--- /dev/null+++ b/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.module.css@@ -0,0 +1,19 @@+/* SPDX-License-Identifier: AGPL-3.0-or-later */++.field {+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+}++.hint {+ color: var(--text-secondary);+ font-size: 0.8125rem;+ line-height: 1.125rem;+}++.optOutLabel {+ color: var(--text-primary);+ font-size: 0.875rem;+ line-height: 1.25rem;+}diff --git a/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.tsx b/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.tsxnew file mode 100644index 000000000..dc03d4511--- /dev/null+++ b/fluxer_app/src/features/premium/components/operator_pass/OperatorPassWallNameField.tsx@@ -0,0 +1,105 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import styles from '@app/features/premium/components/operator_pass/OperatorPassWallNameField.module.css';+import type {OperatorPassWallNameProblem} from '@app/features/premium/utils/OperatorPassUtils';+import {Checkbox} from '@app/features/ui/checkbox/Checkbox';+import {Input} from '@app/features/ui/components/form/FormInput';+import {OPERATOR_PASS_WALL_NAME_MAX_LENGTH} from '@fluxer/schema/src/domains/operator_pass/OperatorPassSchemas';+import {msg} from '@lingui/core/macro';+import {useLingui} from '@lingui/react/macro';+import {observer} from 'mobx-react-lite';++const WALL_NAME_INPUT_OVERFLOW_ALLOWANCE = 16;++const WALL_NAME_LABEL_DESCRIPTOR = msg({+ message: "Your name on the Operators' wall",+ comment:+ "Label of the text field for the name shown on the Operators' wall, at checkout and when accepting an Operator Pass someone passed on. The Operators' wall is the list of Operators on the homepage.",+});+const WALL_NAME_SETTINGS_LABEL_DESCRIPTOR = msg({+ message: 'Name on the wall',+ comment:+ "Label of the text field for the name shown on the Operators' wall, in the settings. The wall is the list of Operators on the homepage.",+});+const WALL_NAME_HINT_DESCRIPTOR = msg({+ message: 'We check new names before they go live.',+ comment:+ "Hint under the Operators' wall name field. Go live means showing on the Operators' wall, the list of Operators on the homepage.",+});+export const DONT_LIST_ME_DESCRIPTOR = msg({+ message: "Don't list me",+ comment:+ "Checkbox next to the Operators' wall name field. When checked, the person is not shown on the Operators' wall and the name field is disabled.",+});+const WALL_NAME_REQUIRED_DESCRIPTOR = msg({+ message: "Enter a name, or check Don't list me.",+ comment:+ "Error under the Operators' wall name field when it is empty and the person did not choose to stay off the wall. Don't list me is the label of the checkbox under the field, use the same words as that label.",+});+const WALL_NAME_TOO_LONG_DESCRIPTOR = msg({+ message: 'Use 32 characters or fewer.',+ comment: "Error under the Operators' wall name field when the name is longer than 32 characters.",+});++export const OperatorPassWallNameField = observer(function OperatorPassWallNameField({+ id,+ name,+ optOut,+ problem,+ disabled,+ context,+ onNameChange,+ onOptOutChange,+}: {+ id: string;+ name: string;+ optOut: boolean;+ problem: OperatorPassWallNameProblem | null;+ disabled: boolean;+ context: 'checkout' | 'offer' | 'settings';+ onNameChange: (name: string) => void;+ onOptOutChange: (optOut: boolean) => void;+}) {+ const {i18n} = useLingui();+ let error: string | null = null;+ if (!optOut) {+ if (problem === 'required') {+ error = i18n._(WALL_NAME_REQUIRED_DESCRIPTOR);+ } else if (problem === 'too_long') {+ error = i18n._(WALL_NAME_TOO_LONG_DESCRIPTOR);+ }+ }+ return (+ <div className={styles.field} data-flx="premium.operator-pass-wall-name-field.field">+ <Input+ id={id}+ label={i18n._(context === 'settings' ? WALL_NAME_SETTINGS_LABEL_DESCRIPTOR : WALL_NAME_LABEL_DESCRIPTOR)}+ value={name}+ dir="auto"+ onChange={(event) => onNameChange(event.target.value)}+ error={error}+ footer={+ error ? undefined : (+ <span className={styles.hint} data-flx="premium.operator-pass-wall-name-field.hint">+ {i18n._(WALL_NAME_HINT_DESCRIPTOR)}+ </span>+ )+ }+ maxLength={OPERATOR_PASS_WALL_NAME_MAX_LENGTH + WALL_NAME_INPUT_OVERFLOW_ALLOWANCE}+ autoComplete="off"+ disabled={disabled || optOut}+ data-flx="premium.operator-pass-wall-name-field.input.name"+ />+ <Checkbox+ checked={optOut}+ onChange={onOptOutChange}+ disabled={disabled}+ data-flx="premium.operator-pass-wall-name-field.checkbox.opt-out"+ >+ <span className={styles.optOutLabel} data-flx="premium.operator-pass-wall-name-field.opt-out-label">+ {i18n._(DONT_LIST_ME_DESCRIPTOR)}+ </span>+ </Checkbox>+ </div>+ );+});diff --git a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.module.css b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.module.cssnew file mode 100644index 000000000..0d471b2a3--- /dev/null+++ b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.module.css@@ -0,0 +1,97 @@+/* SPDX-License-Identifier: AGPL-3.0-or-later */++.section {+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+ margin-top: 1.5rem;+}++.title {+ margin: 0;+ color: var(--text-primary);+ font-size: 0.875rem;+ font-weight: 600;+ line-height: 1.25rem;+}++.status {+ margin: 0;+ color: var(--text-primary-muted);+ font-size: 0.875rem;+ line-height: 1.25rem;+}++.declined {+ margin: 0;+ color: var(--status-danger);+ font-size: 0.875rem;+ line-height: 1.25rem;+}++.actions {+ display: flex;+ justify-content: flex-start;+}++.rows {+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+}++.row {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ min-width: 0;+}++.rowLabel {+ flex-shrink: 0;+ min-width: 5.5rem;+ color: var(--text-primary-muted);+ font-size: 0.8125rem;+ line-height: 1.125rem;+}++.rowEntry {+ display: flex;+ flex: 1;+ align-items: center;+ gap: 0.5rem;+ min-width: 0;+}++.rowAvatar {+ flex-shrink: 0;+ width: 1.5rem;+ height: 1.5rem;+ border-radius: 50%;+ object-fit: cover;+}++.rowName {+ min-width: 0;+ overflow: hidden;+ color: var(--text-primary);+ font-size: 0.875rem;+ font-weight: 600;+ line-height: 1.25rem;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.rowTrailing {+ flex-shrink: 0;+ margin-inline-start: auto;+ color: var(--text-primary-muted);+ font-size: 0.8125rem;+ line-height: 1.125rem;+}++.howLink {+ align-self: flex-start;+ font-size: 0.8125rem;+ line-height: 1.125rem;+}diff --git a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.tsx b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.tsxnew file mode 100644index 000000000..9f716dd23--- /dev/null+++ b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.tsx@@ -0,0 +1,442 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {Routes} from '@app/app/Routes';+import {ExternalLink} from '@app/features/app/components/shared/ExternalLink';+import {HttpError} from '@app/features/platform/types/EndpointError';+import {Logger} from '@app/features/platform/utils/AppLogger';+import * as OperatorPassCommands from '@app/features/premium/commands/OperatorPassCommands';+import {OperatorPassWallNameField} from '@app/features/premium/components/operator_pass/OperatorPassWallNameField';+import OperatorPassHoldings from '@app/features/premium/state/OperatorPassHoldings';+import {+ formatOperatorPassDate,+ formatOperatorPassDateTime,+ getOperatorPassWallNameProblem,+ isOperatorPassAvailable,+ normalizeOperatorPassWallName,+ type OperatorPassWallNameProblem,+} from '@app/features/premium/utils/OperatorPassUtils';+import {Button} from '@app/features/ui/button/Button';+import * as ToastCommands from '@app/features/ui/commands/ToastCommands';+import {Switch} from '@app/features/ui/components/form/FormSwitch';+import {Tooltip} from '@app/features/ui/tooltip/Tooltip';+import styles from '@app/features/user/components/modals/tabs/my_profile_tab/OperatorPassWallSettings.module.css';+import Users from '@app/features/user/state/Users';+import {getDefaultAvatarURL, getUserAvatarURL} from '@app/features/user/utils/AvatarUtils';+import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import type {OperatorPassListingResponse} from '@fluxer/schema/src/domains/operator_pass/OperatorPassSchemas';+import {msg} from '@lingui/core/macro';+import {useLingui} from '@lingui/react/macro';+import {observer} from 'mobx-react-lite';+import {type ReactNode, useEffect, useRef, useState} from 'react';++const WALL_TITLE_DESCRIPTOR = msg({+ message: "Operators' wall",+ comment:+ "Heading of the Operators' wall group in the Operator Pass profile settings. Operators' wall is the name of a section of the homepage.",+});+const WALL_HOW_IT_WORKS_DESCRIPTOR = msg({+ message: 'How the wall works',+ comment: "Link under the Operators' wall settings. It opens the question about the wall on the Operator Pass page.",+});+const WALL_NOT_LISTED_DESCRIPTOR = msg({+ message: 'Not listed.',+ comment: "Status in the Operators' wall settings when the account chose not to be listed or has not chosen a name.",+});+const WALL_ON_THE_WALL_DESCRIPTOR = msg({+ message: 'On the wall',+ comment: "Label in front of the name and avatar the Operators' wall shows for this account right now.",+});+const WALL_IN_REVIEW_DESCRIPTOR = msg({+ message: 'In review',+ comment: "Label in front of a new name and avatar for the Operators' wall that our team has not checked yet.",+});+const WALL_REVIEW_BY_DESCRIPTOR = msg({+ message: 'by {date}',+ comment:+ "Short muted text after a name waiting for review on the Operators' wall. {date} is the date our team aims to finish the review by, without a time.",+});+const WALL_LIVE_DESCRIPTOR = msg({+ context: 'operators-wall-status',+ message: 'Live',+ comment: "Status next to the name and avatar when they are approved and shown on the Operators' wall.",+});+const WALL_DECLINED_DESCRIPTOR = msg({+ message: 'Declined: {name}. {reason}.',+ comment:+ 'Status in the Operators\' wall settings when our team declined a new name or avatar. {name} is the declined name. {reason} is one of the short decline reasons, such as "Breaks the community guidelines".',+});+const WALL_TEAM_NOTE_DESCRIPTOR = msg({+ message: 'Team note: {note}',+ comment:+ "Line in the Operators' wall settings with what our team wrote about a declined name or avatar. {note} is their text, in the language they wrote it.",+});+const WALL_HIDDEN_DESCRIPTOR = msg({+ message: 'Hidden by our team for now.',+ comment: "Status in the Operators' wall settings when our team hid the listing for a while.",+});+const WALL_HIDDEN_WHY_DESCRIPTOR = msg({+ message: 'Why?',+ comment: "Link after the hidden status in the Operators' wall settings. It opens the Operator Pass terms.",+});+const WALL_REMOVED_DESCRIPTOR = msg({+ message: 'Off the wall while your benefits are removed.',+ comment:+ "Status in the Operators' wall settings when the Operator Pass benefits are removed under the Operator Pass terms.",+});+const WALL_TERMS_LINK_DESCRIPTOR = msg({+ message: 'Operator Pass terms',+ comment: 'Link to the Operator Pass terms. Operator Pass is a product name.',+});+const WALL_SEND_CHANGES_DESCRIPTOR = msg({+ message: 'Send profile changes to the wall',+ comment:+ "Switch in the Operators' wall settings. When on, new profile names and avatars go to the Operators' wall after our team checks them.",+});+const WALL_RELEASE_LIST_DESCRIPTOR = msg({+ message: 'Add my name to the yearly Operators list',+ comment:+ "Switch in the Operators' wall settings, off by default. When on, the name on the Operators' wall goes into The Operators list for the year, which Fluxer publishes once a year. Operators are the people who have an Operator Pass, keep the word Operators in English.",+});+const WALL_RELEASE_LIST_HINT_DESCRIPTOR = msg({+ message:+ 'Once a year, we publish a list of Operators in the notes of a Fluxer release and in its source code. Your wall name is only on it if you turn this on.',+ comment:+ "Description under the switch that adds the Operators' wall name to the yearly Operators list. A Fluxer release is a published version of the app. Operators are the people who have an Operator Pass, keep the word Operators in English.",+});+const REASON_GUIDELINES_DESCRIPTOR = msg({+ message: 'Breaks the community guidelines',+ comment: "Short reason our team declined a name or avatar on the Operators' wall.",+});+const REASON_IMPERSONATION_DESCRIPTOR = msg({+ message: 'Pretends to be someone else',+ comment: "Short reason our team declined a name or avatar on the Operators' wall.",+});+const REASON_RIGHTS_DESCRIPTOR = msg({+ message: 'Uses a name or image without the rights to it',+ comment: "Short reason our team declined a name or avatar on the Operators' wall.",+});+const REASON_AGE_DESCRIPTOR = msg({+ message: 'Not suitable for younger users',+ comment: "Short reason our team declined a name or avatar on the Operators' wall.",+});+const WALL_SAVE_DESCRIPTOR = msg({+ message: 'Save',+ comment: "Button that saves the Operators' wall settings.",+});+const WALL_SAVED_DESCRIPTOR = msg({+ message: 'Saved.',+ comment: "Toast after saving the Operators' wall settings.",+});+export const WALL_SAVE_FAILED_DESCRIPTOR = msg({+ message: "Couldn't save. Try again.",+ comment: "Toast when saving the Operators' wall settings failed.",+});++const logger = new Logger('OperatorPassWallSettings');++function declineReasonDescriptor(reason: NonNullable<OperatorPassListingResponse['decline_reason']>) {+ switch (reason) {+ case 'guidelines':+ return REASON_GUIDELINES_DESCRIPTOR;+ case 'impersonation':+ return REASON_IMPERSONATION_DESCRIPTOR;+ case 'rights':+ return REASON_RIGHTS_DESCRIPTOR;+ case 'age_suitability':+ return REASON_AGE_DESCRIPTOR;+ }+}++function WallRow({+ label,+ avatarUrl,+ name,+ trailing,+ flx,+}: {+ label: string;+ avatarUrl: string | null;+ name: string;+ trailing?: ReactNode;+ flx: string;+}) {+ return (+ <div className={styles.row} data-flx={`user.my-profile-tab.operator-pass-wall-settings.${flx}`}>+ <span className={styles.rowLabel} data-flx="user.my-profile-tab.operator-pass-wall-settings.row-label">+ {label}+ </span>+ <div className={styles.rowEntry} data-flx="user.my-profile-tab.operator-pass-wall-settings.row-entry">+ {avatarUrl && (+ <img+ src={avatarUrl}+ alt=""+ className={styles.rowAvatar}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.row-avatar"+ />+ )}+ <span className={styles.rowName} dir="auto" data-flx="user.my-profile-tab.operator-pass-wall-settings.row-name">+ {name}+ </span>+ {trailing && (+ <span className={styles.rowTrailing} data-flx="user.my-profile-tab.operator-pass-wall-settings.row-trailing">+ {trailing}+ </span>+ )}+ </div>+ </div>+ );+}++const OperatorPassWallStatus = observer(function OperatorPassWallStatus({+ listing,+}: {+ listing: OperatorPassListingResponse;+}) {+ const {i18n} = useLingui();+ const user = Users.currentUser;+ if (listing.status !== 'listed' && listing.display_state !== 'removed') {+ return (+ <p className={styles.status} data-flx="user.my-profile-tab.operator-pass-wall-settings.status">+ {i18n._(WALL_NOT_LISTED_DESCRIPTOR)}+ </p>+ );+ }+ if (listing.display_state === 'hidden') {+ return (+ <p className={styles.status} data-flx="user.my-profile-tab.operator-pass-wall-settings.status">+ {i18n._(WALL_HIDDEN_DESCRIPTOR)}{' '}+ <ExternalLink+ href={`${Routes.operatorPassTerms()}#8-when-we-remove-perks`}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.link.why-hidden"+ >+ {i18n._(WALL_HIDDEN_WHY_DESCRIPTOR)}+ </ExternalLink>+ </p>+ );+ }+ if (listing.display_state === 'removed') {+ return (+ <p className={styles.status} data-flx="user.my-profile-tab.operator-pass-wall-settings.status">+ {i18n._(WALL_REMOVED_DESCRIPTOR)}{' '}+ <ExternalLink+ href={`${Routes.operatorPassTerms()}#8-when-we-remove-perks`}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.link.terms"+ >+ {i18n._(WALL_TERMS_LINK_DESCRIPTOR)}+ </ExternalLink>+ </p>+ );+ }+ const avatarUrl = listing.shown_avatar_url ?? (user ? getDefaultAvatarURL(user.id) : null);+ const pending = listing.review_state === 'pending' && listing.pending_name;+ const declined = listing.review_state === 'declined';+ const live = listing.display_state === 'live' && !pending && !declined;+ return (+ <div className={styles.rows} data-flx="user.my-profile-tab.operator-pass-wall-settings.rows">+ <WallRow+ label={i18n._(WALL_ON_THE_WALL_DESCRIPTOR)}+ avatarUrl={avatarUrl}+ name={listing.shown_name ?? ''}+ trailing={live ? i18n._(WALL_LIVE_DESCRIPTOR) : null}+ flx="shown"+ data-flx="user.my-profile-tab.operator-pass-wall-settings.operator-pass-wall-status.wall-row"+ />+ {pending && (+ <WallRow+ label={i18n._(WALL_IN_REVIEW_DESCRIPTOR)}+ avatarUrl={user ? getUserAvatarURL({id: user.id, avatar: user.avatar}) : null}+ name={listing.pending_name ?? ''}+ trailing={+ listing.review_due_at ? (+ <Tooltip+ text={formatOperatorPassDateTime(listing.review_due_at)}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.review-due-tooltip"+ >+ <time+ dateTime={listing.review_due_at}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.review-due"+ >+ {i18n._(WALL_REVIEW_BY_DESCRIPTOR, {date: formatOperatorPassDate(listing.review_due_at)})}+ </time>+ </Tooltip>+ ) : null+ }+ flx="pending"+ data-flx="user.my-profile-tab.operator-pass-wall-settings.operator-pass-wall-status.wall-row--2"+ />+ )}+ {declined && listing.declined_name && listing.decline_reason && (+ <p className={styles.declined} data-flx="user.my-profile-tab.operator-pass-wall-settings.declined">+ {i18n._(WALL_DECLINED_DESCRIPTOR, {+ name: listing.declined_name,+ reason: i18n._(declineReasonDescriptor(listing.decline_reason)),+ })}+ </p>+ )}+ {declined && listing.decline_note && (+ <p className={styles.status} data-flx="user.my-profile-tab.operator-pass-wall-settings.decline-note">+ {i18n._(WALL_TEAM_NOTE_DESCRIPTOR, {note: listing.decline_note})}+ </p>+ )}+ </div>+ );+});++export const OperatorPassWallSettings = observer(function OperatorPassWallSettings() {+ const {i18n} = useLingui();+ const [listing, setListing] = useState<OperatorPassListingResponse | null>(null);+ const [name, setName] = useState('');+ const [optOut, setOptOut] = useState(false);+ const [sendChanges, setSendChanges] = useState(true);+ const [releaseListOptIn, setReleaseListOptIn] = useState(false);+ const [problem, setProblem] = useState<OperatorPassWallNameProblem | null>(null);+ const [saving, setSaving] = useState(false);+ const appliedRef = useRef<{+ name: string;+ optOut: boolean;+ sendChanges: boolean;+ releaseListOptIn: boolean;+ } | null>(null);+ const editedRef = useRef(false);+ const applied = appliedRef.current;+ editedRef.current =+ applied !== null &&+ (name !== applied.name ||+ optOut !== applied.optOut ||+ sendChanges !== applied.sendChanges ||+ releaseListOptIn !== applied.releaseListOptIn);+ const apply = (result: OperatorPassListingResponse) => {+ const next = {+ name: result.wall_name ?? Users.currentUser?.displayName ?? '',+ optOut: result.wall_opt_out,+ sendChanges: !result.keep_as_is,+ releaseListOptIn: result.release_list_opt_in,+ };+ appliedRef.current = next;+ setListing(result);+ setName(next.name);+ setOptOut(next.optOut);+ setSendChanges(next.sendChanges);+ setReleaseListOptIn(next.releaseListOptIn);+ };+ const passCount = OperatorPassHoldings.passes?.count;+ useEffect(() => {+ if (!isOperatorPassAvailable()) return;+ let active = true;+ OperatorPassCommands.fetchListing()+ .then((result) => {+ if (!active) return;+ if (editedRef.current) {+ setListing(result);+ } else {+ apply(result);+ }+ })+ .catch((error) => logger.warn("Failed to load the Operators' wall listing", error));+ return () => {+ active = false;+ };+ }, [passCount]);+ const removed = listing?.display_state === 'removed';+ if (!listing || (!listing.has_wall && !removed)) return null;+ const nameChanged =+ optOut !== listing.wall_opt_out || (!optOut && normalizeOperatorPassWallName(name) !== (listing.wall_name ?? ''));+ const switchChanged =+ !optOut && (sendChanges === listing.keep_as_is || releaseListOptIn !== listing.release_list_opt_in);+ const handleSave = async () => {+ const nextProblem = getOperatorPassWallNameProblem(name, optOut);+ setProblem(nextProblem);+ if (nextProblem) return;+ setSaving(true);+ try {+ const result = await OperatorPassCommands.updateListing({+ ...(nameChanged ? {wall_name: optOut ? null : normalizeOperatorPassWallName(name)} : {}),+ wall_opt_out: optOut,+ ...(optOut ? {} : {keep_as_is: !sendChanges, release_list_opt_in: releaseListOptIn}),+ });+ apply(result);+ ToastCommands.success(i18n._(WALL_SAVED_DESCRIPTOR));+ } catch (error) {+ if (+ error instanceof HttpError &&+ (error.body as {code?: string} | null)?.code === APIErrorCodes.OPERATOR_PASS_WALL_NAME_REQUIRED+ ) {+ setProblem('required');+ } else {+ ToastCommands.error(i18n._(WALL_SAVE_FAILED_DESCRIPTOR));+ }+ } finally {+ setSaving(false);+ }+ };+ return (+ <div className={styles.section} data-flx="user.my-profile-tab.operator-pass-wall-settings.section">+ <h3 className={styles.title} data-flx="user.my-profile-tab.operator-pass-wall-settings.title">+ {i18n._(WALL_TITLE_DESCRIPTOR)}+ </h3>+ <OperatorPassWallStatus+ listing={listing}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.operator-pass-wall-status"+ />+ {!removed && (+ <>+ <OperatorPassWallNameField+ id="operator-pass-settings-wall-name"+ name={name}+ optOut={optOut}+ problem={problem}+ disabled={saving}+ context="settings"+ onNameChange={(value) => {+ setName(value);+ if (problem) setProblem(getOperatorPassWallNameProblem(value, optOut));+ }}+ onOptOutChange={(value) => {+ setOptOut(value);+ if (value) setProblem(null);+ }}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.operator-pass-settings-wall-name"+ />+ {!optOut && (+ <Switch+ label={i18n._(WALL_SEND_CHANGES_DESCRIPTOR)}+ value={sendChanges}+ onChange={setSendChanges}+ disabled={saving}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.switch.send-changes"+ />+ )}+ {!optOut && (+ <Switch+ label={i18n._(WALL_RELEASE_LIST_DESCRIPTOR)}+ description={i18n._(WALL_RELEASE_LIST_HINT_DESCRIPTOR)}+ value={releaseListOptIn}+ onChange={setReleaseListOptIn}+ disabled={saving}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.switch.release-list"+ />+ )}+ <div className={styles.actions} data-flx="user.my-profile-tab.operator-pass-wall-settings.actions">+ <Button+ small+ variant="primary"+ onClick={() => void handleSave()}+ submitting={saving}+ disabled={!nameChanged && !switchChanged}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.button.save"+ >+ {i18n._(WALL_SAVE_DESCRIPTOR)}+ </Button>+ </div>+ </>+ )}+ <ExternalLink+ href={`${Routes.operatorPassInfo()}#wall`}+ className={styles.howLink}+ data-flx="user.my-profile-tab.operator-pass-wall-settings.link.how-the-wall-works"+ >+ {i18n._(WALL_HOW_IT_WORKS_DESCRIPTOR)}+ </ExternalLink>+ </div>+ );+});