89 lines
3.7 KiB
TypeScript
89 lines
3.7 KiB
TypeScript
// Metro module 11093 (f11094).
|
|
import { View } from "react-native";
|
|
import { AppealIngestionSignal, AppealIngestionSignalOrder } from "../SafetyHubConstants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { useRadioA11yNative } from "../../../_bundle/Module3907";
|
|
import { FormRow, Form, FormSection } from "../../../design/void/Form/native/index";
|
|
import { getAppealSignalDisplayText } from "../SafetyHubUtils";
|
|
import { useSafetyHubAppealSignal } from "../hooks/useSafetyHubClassifications";
|
|
import Dispatcher from "../../../Dispatcher";
|
|
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { AppealIngestionModalScreen, AppealIngestionModalHeader } from "./AppealIngestionModal";
|
|
import { Text } from "../../../design/components/Text/native/Text";
|
|
let useStyles;
|
|
const AppealSignalRadioRow = function AppealSignalRadioRow(props) {
|
|
const { signal, selected, rowStyle, onSelect } = props;
|
|
const radioA11yNative = useRadioA11yNative({
|
|
selected
|
|
});
|
|
const { accessibilityRole, accessibilityState } = radioA11yNative;
|
|
return <FormRow style={rowStyle} label={<FormRow.Label text={getAppealSignalDisplayText(signal)} />} onPress={() => onSelect(signal)} trailing={<FormRow.Radio selected={selected} />} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState} />;
|
|
};
|
|
useStyles = createStyles({
|
|
container: {
|
|
flex: 1,
|
|
paddingHorizontal: 16
|
|
},
|
|
form: {
|
|
marginBottom: 16,
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
|
|
},
|
|
formRow: {
|
|
paddingVertical: 16,
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
|
|
},
|
|
formSection: {
|
|
gap: 8
|
|
},
|
|
disclaimer: {
|
|
marginTop: 24
|
|
}
|
|
});
|
|
export default function AppealIngestionCollectSignal(props) {
|
|
let styles, safetyHubAppealSignal;
|
|
const isDsaEligible = props.isDsaEligible;
|
|
styles = void 0;
|
|
safetyHubAppealSignal = void 0;
|
|
const handleAppealSignalSelect2 = function handleAppealSignalSelect(a0) {
|
|
Dispatcher.dispatch({
|
|
type: "SAFETY_HUB_APPEAL_SIGNAL_SELECT",
|
|
signal: a0
|
|
});
|
|
let r12 = isDsaEligible;
|
|
if (isDsaEligible) {
|
|
r12 = a0 === AppealIngestionSignal.SOMETHING_ELSE;
|
|
}
|
|
if (r12) {
|
|
ActionSheetActionCreators.openLazy(import("./AppealIngestionFreeTextAppealReasonActionSheet"), "AppealIngestionFreeTextAppealReasonActionSheet", {
|
|
onSave: (a0) => {
|
|
Dispatcher.dispatch({
|
|
type: "SAFETY_HUB_APPEAL_SIGNAL_CUSTOM_INPUT_CHANGE",
|
|
userInput: a0
|
|
});
|
|
ActionSheetActionCreators.hideActionSheet("AppealIngestionFreeTextAppealReasonActionSheet");
|
|
},
|
|
onClose: () => ActionSheetActionCreators.hideActionSheet("AppealIngestionFreeTextAppealReasonActionSheet")
|
|
});
|
|
}
|
|
};
|
|
styles = useStyles();
|
|
safetyHubAppealSignal = useSafetyHubAppealSignal();
|
|
return <AppealIngestionModalScreen>
|
|
<AppealIngestionModalHeader headerText={intl.string(t["C5q+pW"])} subHeaderText={intl.string(t.VEcRhw)} />
|
|
<View style={styles.container}>
|
|
<Form style={styles.form}>
|
|
<FormSection sectionBodyStyle={styles.formSection} accessibilityRole="radiogroup">
|
|
{AppealIngestionSignalOrder.map((item, index) => <AppealSignalRadioRow key={`formrow-${index}`} signal={item} selected={item === safetyHubAppealSignal} rowStyle={styles.formRow} onSelect={handleAppealSignalSelect2} />)}
|
|
</FormSection>
|
|
<View style={styles.disclaimer}>
|
|
<Text variant="text-sm/normal">
|
|
{intl.format(t["8k9GCW"], {})}
|
|
</Text>
|
|
</View>
|
|
</Form>
|
|
</View>
|
|
</AppealIngestionModalScreen>;
|
|
};
|