93 lines
3.6 KiB
TypeScript
93 lines
3.6 KiB
TypeScript
// Metro module 12234 (f12235).
|
|
import { View } from "react-native";
|
|
import CreateInviteModalStore from "../../../../stores/CreateInviteModalStore";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
import { useStateFromStores } from "../../../../_bundle/Module589";
|
|
import { RefreshEmptyState, ClearButtonVisibility } from "../../../../design/void/native";
|
|
import Module12235 from "../../../../_bundle/Module12235";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import FreeFormTextInput from "../../../../design/void/Form/native/FreeFormTextInput";
|
|
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
|
|
import { SettingsIcon } from "../../../../design/components/Icon/native/redesign/generated/SettingsIcon";
|
|
import { Text } from "../../../../design/components/Text/native/Text";
|
|
import InstantInviteUtils from "../../../../utils/InstantInviteUtils";
|
|
import { Button } from "../../../../design/components/Button/native/Button.native";
|
|
const useStyles = createStyles({
|
|
container: {
|
|
padding: 16
|
|
},
|
|
emptyStateContainer: {
|
|
padding: 0,
|
|
marginBottom: 16
|
|
},
|
|
emptyStateArt: {
|
|
marginBottom: 16
|
|
},
|
|
emptyStateTitle: {
|
|
marginBottom: 4
|
|
},
|
|
linkContainer: {
|
|
maxWidth: "100%",
|
|
flexDirection: "row",
|
|
marginBottom: 8,
|
|
gap: 8
|
|
},
|
|
inviteInput: {
|
|
flexShrink: 1
|
|
},
|
|
expireCaption: {
|
|
marginBottom: 16
|
|
},
|
|
settingsButton: {
|
|
width: 48,
|
|
height: 48,
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
|
|
borderRadius: Module712.radii.xs
|
|
}
|
|
});
|
|
export default (a0) => {
|
|
let link = a0.link;
|
|
const { onCopy, onShare, onPressSettings } = a0;
|
|
const styles = useStyles();
|
|
const stateFromStores = useStateFromStores([CreateInviteModalStore], () => CreateInviteModalStore.getInviteSettings());
|
|
const r57 = [<RefreshEmptyState containerStyle={styles.emptyStateContainer} imageStyle={styles.emptyStateArt} titleStyle={styles.emptyStateTitle} source={Module12235} title={intl.string(t.tQc0l8)} body={intl.string(t.DXgdcD)} />, , , ,];
|
|
if (link == null) {
|
|
link = "";
|
|
}
|
|
r57[1] = <View style={styles.linkContainer}>
|
|
<FreeFormTextInput accessibilityRole="button" onPress={onCopy} editable={false} value={link} style={styles.inviteInput} forceAccessibleContainer clearButtonVisibility={ClearButtonVisibility.NEVER} />
|
|
<PressableOpacity accessibilityLabel={intl.string(t["3D5yo/"])} accessibilityRole="button" onPress={onPressSettings} style={styles.settingsButton}>
|
|
<SettingsIcon />
|
|
</PressableOpacity>
|
|
</View>;
|
|
const r3 = stateFromStores == null;
|
|
let r95 = null;
|
|
if (!r3) {
|
|
const maxAgeOptionByValue = InstantInviteUtils.getMaxAgeOptionByValue(stateFromStores.maxAge);
|
|
const r101 = maxAgeOptionByValue != null;
|
|
let maxUses = "";
|
|
let maxAge = "";
|
|
if (r101) {
|
|
let descriptiveLabel = maxAgeOptionByValue.descriptiveLabel;
|
|
if (descriptiveLabel == null) {
|
|
descriptiveLabel = "";
|
|
}
|
|
maxAge = descriptiveLabel;
|
|
}
|
|
const r110 = InstantInviteUtils.getMaxUsesOptions.find((getMaxUsesOption) => getMaxUsesOption.value === stateFromStores.maxUses);
|
|
if (r110 != null) {
|
|
maxUses = r110.descriptiveLabel;
|
|
}
|
|
r95 = intl.format(stateFromStores.maxAge === 0 ? t["99ISmn"] : t.dqPWMN, {
|
|
maxAge,
|
|
maxUses
|
|
});
|
|
}
|
|
r57[2] = <Text style={styles.expireCaption} variant="text-xs/medium" color="text-muted">{r95}</Text>;
|
|
r57[3] = <Button text={intl.string(t.Ej3B3Y)} onPress={onShare} />;
|
|
return <View style={styles.container}>{r57}</View>;
|
|
};
|