96 lines
4.1 KiB
TypeScript
96 lines
4.1 KiB
TypeScript
// Metro module 13709 (f13710).
|
|
import { View } from "react-native";
|
|
import UserStore from "../../../stores/UserStore";
|
|
import { AnalyticsObjects } from "../../../Constants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { useStateFromStores } from "../../../_bundle/Module589";
|
|
import PremiumUtils from "../../../utils/PremiumUtils";
|
|
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
|
|
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { NitroWheelIcon } from "../../../design/components/Icon/native/redesign/generated/NitroWheelIcon";
|
|
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
|
|
import { TableRow } from "../../../design/components/TableRow/native/TableRow.native";
|
|
import { FormLabel, FormSubLabel } from "../../../design/void/Form/native/index";
|
|
import UserProfileUpsellButton from "./UserProfileUpsellButton";
|
|
const useStyles = createStyles({
|
|
nitroWheel: {
|
|
marginLeft: Module712.space.PX_8
|
|
},
|
|
sublabel: {
|
|
color: Module712.colors.TEXT_DEFAULT
|
|
},
|
|
label: {
|
|
marginBottom: 4,
|
|
color: Module712.colors.INTERACTIVE_TEXT_ACTIVE,
|
|
alignItems: "center",
|
|
flexDirection: "row"
|
|
},
|
|
remove: {
|
|
color: Module712.colors.TEXT_FEEDBACK_CRITICAL
|
|
},
|
|
upsellButton: {
|
|
marginTop: Module712.space.PX_12,
|
|
marginBottom: Module712.space.PX_8
|
|
},
|
|
upsellTitleContainer: {
|
|
flexDirection: "row",
|
|
alignItems: "flex-end"
|
|
},
|
|
titleWrapper: {
|
|
flex: 0
|
|
},
|
|
titleContainer: {
|
|
justifyContent: "flex-start"
|
|
}
|
|
});
|
|
export default function ChangeAvatarActionSheet(props) {
|
|
const { handleUploadAvatarSelect, handleRemoveAvatarSelect, handleUploadGIFAvatarSelect, handleEditAvatarDecorationSelect } = props;
|
|
let showAnimatedAvatarUpsell = props.showAnimatedAvatarUpsell;
|
|
if (showAnimatedAvatarUpsell === void 0) {
|
|
showAnimatedAvatarUpsell = false;
|
|
}
|
|
let showRemoveAvatar = props.showRemoveAvatar;
|
|
if (showRemoveAvatar === void 0) {
|
|
showRemoveAvatar = false;
|
|
}
|
|
const styles = useStyles();
|
|
let trailing = PremiumUtils.isPremium(useStateFromStores([UserStore], () => UserStore.getCurrentUser()));
|
|
const props2 = {
|
|
title: intl.string(t.lqaIxI),
|
|
trailing: null,
|
|
titleWrapperStyle: null,
|
|
titleContainerStyle: null
|
|
};
|
|
if (trailing) {
|
|
trailing = <NitroWheelIcon />;
|
|
}
|
|
props2.trailing = trailing;
|
|
props2.titleWrapperStyle = styles.titleWrapper;
|
|
props2.titleContainerStyle = styles.titleContainer;
|
|
const r58 = [<BottomSheetTitleHeader {...props2} />, ,];
|
|
const r84 = [<TableRow label={intl.string(t["MsUY/S"])} subLabel={intl.string(t.r5hKOy)} onPress={handleUploadAvatarSelect} />, handleUploadGIFAvatarSelect != null && !showAnimatedAvatarUpsell && <TableRow label={intl.string(t["xsC+/y"])} onPress={handleUploadGIFAvatarSelect} />, , , ,];
|
|
if (showAnimatedAvatarUpsell) {
|
|
showAnimatedAvatarUpsell = <TableRow label={<View style={styles.upsellTitleContainer}>
|
|
<FormLabel text={intl.string(t.xZ0Wot)} />
|
|
<NitroWheelIcon style={styles.nitroWheel} size="sm" />
|
|
</View>} subLabel={<>
|
|
<FormSubLabel style={styles.sublabel} numberOfLines={3} text={intl.string(t.L3UPqR)} />
|
|
<View style={styles.upsellButton}>
|
|
<UserProfileUpsellButton analyticsObject={AnalyticsObjects.ANIMATED_AVATAR} label={intl.string(t.mr4K7D)} />
|
|
</View>
|
|
</>} />;
|
|
}
|
|
r84[2] = showAnimatedAvatarUpsell;
|
|
r84[3] = handleEditAvatarDecorationSelect != null && <TableRow label={<View style={styles.upsellTitleContainer}>
|
|
<FormLabel text={intl.string(t.BVcYCx)} />
|
|
</View>} onPress={handleEditAvatarDecorationSelect} />;
|
|
if (showRemoveAvatar) {
|
|
showRemoveAvatar = <TableRow label={<FormLabel style={[styles.label, styles.remove]} text={intl.string(t.twB3fz)} />} onPress={handleRemoveAvatarSelect} />;
|
|
}
|
|
r84[4] = showRemoveAvatar;
|
|
r58[1] = <TableRowGroup hasIcons={false}>{r84}</TableRowGroup>;
|
|
return <ActionSheet>{r58}</ActionSheet>;
|
|
};
|