69 lines
2.8 KiB
TypeScript
69 lines
2.8 KiB
TypeScript
// Metro module 11069 (f11070).
|
|
import { useEffect, useMemo } from "react";
|
|
import { UserSettingsSections } from "../../../Constants";
|
|
import { AccountSettingsTabs } from "../../user_settings/account/native/SettingsAccountConstants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import ModalActionCreators from "../../../actions/ModalActionCreators";
|
|
import { getHeaderCloseButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
|
|
import ClassificationDetail from "./ClassificationDetail";
|
|
import { openUserSettings } from "../../user_settings/core/native/openUserSettings";
|
|
import { useSafetyHubInitialized } from "../hooks/useSafetyHubInitialized";
|
|
import { getSafetyHubData } from "../SafetyHubActionCreators";
|
|
import { useIsFocused } from "../../../_bundle/Module1481";
|
|
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
let c7467_8 = {
|
|
CLASSIFICATION_DETAIL: "CLASSIFICATION_DETAIL"
|
|
};
|
|
const useStyles = createStyles({
|
|
headerStyle: {
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
|
|
}
|
|
});
|
|
export default function ClassificationDetailModal(props) {
|
|
const { classificationId, source, shouldRedirectToAccountStanding = false } = props;
|
|
let c18513_2 = shouldRedirectToAccountStanding;
|
|
const styles = useStyles();
|
|
const safetyHubInitialized = useSafetyHubInitialized();
|
|
useEffect(() => {
|
|
if (!safetyHubInitialized) {
|
|
getSafetyHubData();
|
|
}
|
|
}, [safetyHubInitialized]);
|
|
useIsFocused();
|
|
return <Navigator screens={useMemo(() => {
|
|
const classificationId2 = classificationId;
|
|
let c26930_1 = c18513_2;
|
|
const source2 = source;
|
|
const r9 = {};
|
|
r9[c7467_8.CLASSIFICATION_DETAIL] = {
|
|
headerStyle: styles.headerStyle,
|
|
headerTitle: () => null,
|
|
headerLeft: getHeaderCloseButton(function closeModal() {
|
|
return ModalActionCreators.pop();
|
|
}),
|
|
render: () => <ClassificationDetail classificationId={classificationId2} source={source2} onClose={() => {
|
|
ModalActionCreators.pop();
|
|
if (c26930_1) {
|
|
openUserSettings({
|
|
screen: UserSettingsSections.ACCOUNT,
|
|
params: {
|
|
initialTab: AccountSettingsTabs.STANDING
|
|
}
|
|
});
|
|
}
|
|
}} onError={() => {
|
|
ModalActionCreators.pop();
|
|
openUserSettings({
|
|
screen: UserSettingsSections.ACCOUNT,
|
|
params: {
|
|
initialTab: AccountSettingsTabs.STANDING
|
|
}
|
|
});
|
|
}} />
|
|
};
|
|
return r9;
|
|
}, [classificationId, shouldRedirectToAccountStanding, styles, source])} initialRouteName={c7467_8.CLASSIFICATION_DETAIL} headerBackTitle={intl.string(t["13/7kX"])} />;
|
|
};
|