mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(app): guide privacy review with dots and an inline alert (#3356)
This commit is contained in:
1 parent
ec681e6061
commit
2f6201bcbd
60 files changed
+2975
-2500
No files matched your search
+50
@@ -11,7 +11,9 @@ import {Button} from '@app/features/ui/button/Button';
|
||||
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
|
||||
import {modal} from '@app/features/ui/commands/ModalCommands';
|
||||
import {Switch} from '@app/features/ui/components/form/FormSwitch';
|
||||
import {WarningAlert} from '@app/features/ui/warning_alert/WarningAlert';
|
||||
import * as UserSettingsCommands from '@app/features/user/commands/UserSettingsCommands';
|
||||
import {PrivacySetupModal} from '@app/features/user/components/modals/PrivacySetupModal';
|
||||
import styles from '@app/features/user/components/modals/tabs/privacy_safety_tab/ConnectionsTab.module.css';
|
||||
import UserSettings from '@app/features/user/state/UserSettings';
|
||||
import {FriendSourceFlags} from '@fluxer/constants/src/UserConstants';
|
||||
@@ -62,6 +64,22 @@ const BLOCK_FOR_ALL_COMMUNITIES_DESCRIPTOR = msg({
|
||||
comment: 'Button or menu action label in the connections tab. Keep it concise. Keep the tone plain and specific.',
|
||||
});
|
||||
|
||||
const PRIVACY_REVIEW_TITLE_DESCRIPTOR = msg({
|
||||
message: 'Review who can message you',
|
||||
comment:
|
||||
'Title of the inline alert in Privacy > Friends & direct messages, shown until the user reviews their direct message setting.',
|
||||
});
|
||||
const PRIVACY_REVIEW_BODY_DESCRIPTOR = msg({
|
||||
message:
|
||||
'Choose whether people who share a community with you can send you direct messages without being friends first.',
|
||||
comment:
|
||||
'Body of the inline alert in Privacy > Friends & direct messages, shown until the user reviews their direct message setting.',
|
||||
});
|
||||
const REVIEW_PRIVACY_SETTINGS_DESCRIPTOR = msg({
|
||||
message: 'Review privacy settings',
|
||||
comment: 'Button in the inline privacy review alert. Opens the privacy setup modal.',
|
||||
});
|
||||
|
||||
interface DirectMessagesConfirmModalProps {
|
||||
allowMessages: boolean;
|
||||
onApplyToAll: () => Promise<void>;
|
||||
@@ -156,6 +174,37 @@ const DirectMessagesConfirmModal = observer(
|
||||
);
|
||||
},
|
||||
);
|
||||
const PrivacyReviewAlert = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
const handleReview = useCallback(() => {
|
||||
ModalCommands.push(
|
||||
modal(() => (
|
||||
<PrivacySetupModal data-flx="user.privacy-safety-tab.connections-tab.privacy-review-alert.privacy-setup-modal" />
|
||||
)),
|
||||
);
|
||||
}, []);
|
||||
if (!UserSettings.isPrivacySetupPending()) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<WarningAlert
|
||||
title={i18n._(PRIVACY_REVIEW_TITLE_DESCRIPTOR)}
|
||||
actions={
|
||||
<Button
|
||||
variant="primary"
|
||||
small
|
||||
onClick={handleReview}
|
||||
data-flx="user.privacy-safety-tab.connections-tab.privacy-review-alert.button.review"
|
||||
>
|
||||
{i18n._(REVIEW_PRIVACY_SETTINGS_DESCRIPTOR)}
|
||||
</Button>
|
||||
}
|
||||
data-flx="user.privacy-safety-tab.connections-tab.privacy-review-alert"
|
||||
>
|
||||
{i18n._(PRIVACY_REVIEW_BODY_DESCRIPTOR)}
|
||||
</WarningAlert>
|
||||
);
|
||||
});
|
||||
export const ConnectionsTabContent: React.FC = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
const friendSourceFlags = UserSettings.getFriendSourceFlags();
|
||||
@@ -251,6 +300,7 @@ export const ConnectionsTabContent: React.FC = observer(() => {
|
||||
data-flx="user.privacy-safety-tab.connections-tab.connections-tab-content.switch.friend-request-toggle--3"
|
||||
/>
|
||||
</SettingsTabSection>
|
||||
<PrivacyReviewAlert data-flx="user.privacy-safety-tab.connections-tab.connections-tab-content.privacy-review-alert" />
|
||||
<SettingsTabSection
|
||||
title={<Trans>Direct messages</Trans>}
|
||||
data-flx="user.privacy-safety-tab.connections-tab.connections-tab-content.settings-tab-section--2"
|
||||
|
||||
Reference in new issue
Block a user