32 lines
1.5 KiB
TypeScript
32 lines
1.5 KiB
TypeScript
// Metro module 14034 (f14035).
|
|
import * as Module19 from "react";
|
|
import { useMemo, useLayoutEffect } from "react";
|
|
import { QuestsExperimentLocations } from "../../QuestConstants";
|
|
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
|
|
import BountiesModalContentScroll from "./BountiesModalContentScroll";
|
|
import BountiesModalContent from "./BountiesModalContent";
|
|
import { lockOrientation, restoreDefaultOrientation } from "../../../device/native/DeviceOrientation";
|
|
import { Modal } from "../../../../design/components/Modal/native/Modal.native";
|
|
const initialRouteName = "bounty_main";
|
|
const r24 = Module19.memo(function BountiesModal(props) {
|
|
const { bountyId, sourceQuestContent } = props;
|
|
const verticalScrollEnabled = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE).verticalScrollEnabled;
|
|
const memo = useMemo(() => {
|
|
const r1 = {};
|
|
r1[initialRouteName] = {
|
|
fullscreen: true,
|
|
headerLeft: () => null,
|
|
render: () => verticalScrollEnabled ? <BountiesModalContentScroll bountyId={bountyId} sourceQuestContent={sourceQuestContent} /> : <BountiesModalContent bountyId={bountyId} sourceQuestContent={sourceQuestContent} />
|
|
};
|
|
return r1;
|
|
}, [bountyId, sourceQuestContent, verticalScrollEnabled]);
|
|
useLayoutEffect(() => {
|
|
lockOrientation("PORTRAIT", true);
|
|
return restoreDefaultOrientation;
|
|
}, []);
|
|
return <Modal hideTitle initialRouteName={initialRouteName} screens={memo} viewStyle={{
|
|
backgroundColor: "#000000"
|
|
}} />;
|
|
});
|
|
export default r24;
|