153 lines
8.6 KiB
TypeScript
153 lines
8.6 KiB
TypeScript
/* Metro module 14342; source: modules/auth/native/components/PrivacyHint.tsx; dependencies: [31, 27, 5077, 14304, 661, 33, 4501, 6766, 1244, 3874, 7974, 7972, 14343, 2] */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseA11yRolesNativeModule from '../../../../external/discord_common/js/packages/design/hooks/useA11yRolesNative.tsx'; /* Metro dependency 3874 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as PromoEmailConsentStoreModule from '../../PromoEmailConsentStore.tsx'; /* Metro dependency 5077 */
|
|
import * as TextWithIOSLinkWorkaroundModule from '../../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
|
|
import * as RegistrationUIStoreModule from '../RegistrationUIStore.tsx'; /* Metro dependency 14304 */
|
|
|
|
function _fun108541(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14539:6, offset: 0x023249f5, size: 362 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
const env0_3 = value.View;
|
|
const env0_4 = value.Pressable;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
const env0_10 = (CreateStylesModule).createStyles({multiItem: {'flexDirection': 'column',
|
|
'gap': 16}, checkbox: {'flexDirection': 'row', 'alignItems': 'flex-start', 'gap': 8},
|
|
radio: {'flexDirection': 'row', 'alignItems': 'center', 'gap': 8}, checkboxLabel: {flex: 1}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/auth/native/components/PrivacyHint.tsx');
|
|
exports.default = PrivacyHint;
|
|
function PrivacyPolicyDescription({style}) { // fn#108542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14539:463, offset: 0x02324b5f, size: 157 bytes, params: 2, frame: 19
|
|
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
|
|
const intl = (IndexNativeModule).intl;
|
|
const format = intl.format;
|
|
const property = (IndexNativeModule).t['KI+BSb'];
|
|
const TERMS = MarketingURLs.TERMS;
|
|
const PRIVACY = MarketingURLs.PRIVACY;
|
|
return (
|
|
<TextWithIOSLinkWorkaround
|
|
style={style}
|
|
variant="text-xs/medium"
|
|
color="text-muted"
|
|
>
|
|
{Reflect.apply(format, intl, [property, {termsURL: TERMS, privacyURL: PRIVACY}])}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
}
|
|
|
|
function PrivacyPolicyCheckbox({consent, onToggleConsent, asCheckbox}) { // fn#108543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14539:696, offset: 0x02324bfc, size: 461 bytes, params: 2, frame: 23
|
|
asCheckbox = !(asCheckbox === undefined) && asCheckbox;
|
|
const styles = useStyles();
|
|
const {accessibilityRole,
|
|
accessibilityState} = (UseA11yRolesNativeModule).useCheckboxA11yNative({checked: consent});
|
|
object = {style: asCheckbox ? styles.checkbox : styles.radio, accessibilityState: accessibilityState,
|
|
accessibilityRole: accessibilityRole};
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const Y7Kgvf = (IndexNativeModule).t.Y7Kgvf;
|
|
object.accessibilityLabel = Reflect.apply(string, intl, [Y7Kgvf]);
|
|
object.onPress = onToggleConsent;
|
|
object.hitSlop = {'top': 11, 'bottom': 11, 'left': 11};
|
|
const r5 = (
|
|
asCheckbox
|
|
? ((FormCheckbox) => <FormCheckbox checked={consent} />)((require(7974) /* metro dependency 7974: FormCheckboxNative */).FormCheckbox)
|
|
: ((Radio) => <Radio selected={consent} />)((require(7972) /* metro dependency 7972: native */).FormRow.Radio)
|
|
);
|
|
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
|
|
const format = intl.format;
|
|
const qMDAP0 = (IndexNativeModule).t.qMDAP0;
|
|
const TERMS = MarketingURLs.TERMS;
|
|
const PRIVACY = MarketingURLs.PRIVACY;
|
|
return (
|
|
<Pressable {...object}>
|
|
{r5}
|
|
<TextWithIOSLinkWorkaround
|
|
variant="text-xs/medium"
|
|
color="text-muted"
|
|
style={styles.checkboxLabel}
|
|
>
|
|
{Reflect.apply(format, intl, [qMDAP0, {termsURL: TERMS, privacyURL: PRIVACY}])}
|
|
</TextWithIOSLinkWorkaround>
|
|
</Pressable>
|
|
);
|
|
}
|
|
|
|
function PrivacyHint({consent, consentRequired, onToggleConsent}) { // fn#108544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14539:1430, offset: 0x02324dc9, size: 338 bytes, params: 2, frame: 23
|
|
const styles = useStyles();
|
|
const r2 = useRegistrationUIStore(function(a0) {
|
|
return a0.registrationOptions.email != null;
|
|
}) && usePromoEmailConsentStore(function(a0) {
|
|
return a0.required;
|
|
});
|
|
return (
|
|
consentRequired
|
|
? (
|
|
consentRequired && r2
|
|
? (
|
|
<View style={styles.multiItem}>
|
|
{((Component) => <Component />)(importDefault(14343) /* metro dependency 14343: PromotionalEmailCheckBox */)}
|
|
<PrivacyPolicyCheckbox
|
|
consent={consent}
|
|
onToggleConsent={onToggleConsent}
|
|
asCheckbox
|
|
/>
|
|
</View>
|
|
)
|
|
: (
|
|
consentRequired
|
|
? (
|
|
<PrivacyPolicyCheckbox consent={consent} onToggleConsent={onToggleConsent} />
|
|
)
|
|
: (
|
|
<PrivacyPolicyDescription />
|
|
)
|
|
)
|
|
)
|
|
: (
|
|
r2
|
|
? (
|
|
<View style={styles.multiItem}>
|
|
{((Component) => <Component />)(importDefault(14343) /* metro dependency 14343: PromotionalEmailCheckBox */)}
|
|
<PrivacyPolicyDescription />
|
|
</View>
|
|
)
|
|
: (
|
|
consentRequired && r2
|
|
? (
|
|
<View style={styles.multiItem}>
|
|
{((Component) => <Component />)(importDefault(14343) /* metro dependency 14343: PromotionalEmailCheckBox */)}
|
|
<PrivacyPolicyCheckbox
|
|
consent={consent}
|
|
onToggleConsent={onToggleConsent}
|
|
asCheckbox
|
|
/>
|
|
</View>
|
|
)
|
|
: (
|
|
consentRequired
|
|
? (
|
|
<PrivacyPolicyCheckbox consent={consent} onToggleConsent={onToggleConsent} />
|
|
)
|
|
: (
|
|
<PrivacyPolicyDescription />
|
|
)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun108541, 14342, [31, 27, 5077, 14304, 661, 33, 4501, 6766, 1244, 3874, 7974, 7972, 14343,
|
|
2]) /* metro module 14342, dependencies: [31, 27, 5077, 14304, 661, 33, 4501, 6766, 1244, 3874, 7974, 7972, 14343, 2] */;
|