decord/source/modules/tiny_bronco/native/TinyBroncoAgeGroupHeader.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

136 lines
7.3 KiB
TypeScript

// Module ID: 14842
// Function ID: 14843
// Name: TinyBroncoAgeGroupHeader
// Dependencies: [32, 19, 17, 14804, 1955, 21, 4640, 576, 1944, 14837, 14843, 8560, 14838, 7502, 4594, 4636, 1115, 5210, 5768, 14875, 5062, 2]
// Exports: TinyBroncoAgeGroupHeader
// Module 14842 (TinyBroncoAgeGroupHeader)
import nativeDefault from "native" /* 576 */;
import util from "util" /* 1115 */;
import Text_Text from "Text/Text" /* 4636 */;
import AgeVerificationActionCreatorsDefault from "AgeVerificationActionCreators" /* 8560 */;
import useAgeGroupPresentation from "useAgeGroupPresentation" /* 14837 */;
import _modDef14843 from "module_14843" /* 14843 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
require = fn;
function handleOpenBlog() {
AgeVerificationActionCreatorsDefault.openUrl(TINY_BRONCO_BLOG_URL);
}
function AccountStatusNotice(arg0) {
_require = undefined;
const tmp = closure_10();
const shouldShowAgeNotice = require("TinyBroncoLazy").useShouldShowAgeNotice();
const obj = require("TinyBroncoLazy");
const tmp5 = _slicedToArray(require("useSelectedDismissibleContent").useSelectedDismissibleContent(shouldShowAgeNotice ? items : closure_12), 2);
_require = tmp6;
[][0] = tmp5[1];
let tmp8 = null;
if (shouldShowAgeNotice) {
tmp8 = null;
if (null != tmp5[0]) {
const obj3 = { style: tmp.notice, children: null };
const obj4 = { style: tmp.noticeIcon, children: closure_8(tmp2(4594).CircleInformationIcon, { size: "xs", color: "text-link" }) };
items = [closure_8(View, obj4), , ];
const obj5 = { style: tmp.noticeBody, variant: "text-sm/normal", color: "text-default", children: null };
const intl = tmp2(1115).intl;
obj6 = { handleOnBlogHook: handleOpenBlog };
obj5.children = intl.format(obj6[arg0.ageGroup], obj6);
items[1] = closure_8(tmp2(4636).Text, obj5);
obj7 = { style: tmp.noticeDismiss, activeOpacity: 0.5, accessibilityRole: "button", accessibilityLabel: null, hitSlop: 12, onPress: null, children: null };
const intl2 = tmp2(1115).intl;
obj7.accessibilityLabel = intl2.string(tmp2(1115).t.WAI6xu);
obj7.onPress = tmp7;
obj7.children = closure_8(tmp2(5768).XSmallIcon, { size: "sm", color: "icon-strong" });
items[2] = closure_8(tmp2(5210).PressableOpacity, obj7);
obj3.children = items;
tmp8 = closure_9(View, obj3);
}
}
return tmp8;
}
function AgeGroupDescription(ageGroup) {
ageGroup = ageGroup.ageGroup;
if (useAgeGroupPresentation.AgeGroupState.ADULT === ageGroup) {
const obj2 = { variant: "text-sm/normal", color: "text-default", children: null };
const intl3 = tmp(1115).intl;
const obj3 = { handleOnAgeGatedContentHook: tmp(14837).handleOpenAgeGatedContentArticle };
obj2.children = intl3.format(_modDef14843.gi4ulu, obj3);
return React6(tmp(4636).Text, obj2);
} else if (tmp(14837).AgeGroupState.TEEN === ageGroup) {
const obj4 = { variant: "text-sm/normal", color: "text-default", children: null };
const intl2 = tmp(1115).intl;
const obj5 = { handleOnAgeGatedContentHook: tmp(14837).handleOpenAgeGatedContentArticle, handleOnConfirmAgeHook: tmp(14837).handleShowAgeVerification };
obj4.children = intl2.format(_modDef14843["221iML"], obj5);
return React6(tmp(4636).Text, obj4);
} else if (tmp(14837).AgeGroupState.UNVERIFIED === ageGroup) {
const obj = { variant: "text-sm/normal", color: "text-default", children: null };
const intl = tmp(1115).intl;
obj6 = { handleOnAgeGatedContentHook: tmp(14875).handleOpenUnconfirmedAgeGroupSupportArticle, handleOnConfirmAgeHook: tmp(14837).handleShowAgeVerification };
obj.children = intl.format(_modDef14843["W0/7DD"], obj6);
return React6(tmp(4636).Text, obj);
}
}
function AgeGroupCallToAction(ageGroup) {
ageGroup = ageGroup.ageGroup;
if (useAgeGroupPresentation.AgeGroupState.ADULT === ageGroup) {
return null;
} else if (tmp(14837).AgeGroupState.TEEN === ageGroup) {
const obj2 = { grow: true, variant: "secondary", size: "md", text: null, onPress: null };
const intl2 = tmp(1115).intl;
obj2.text = intl2.string(_modDef14843["+7NlgO"]);
obj2.onPress = tmp(14837).handleOpenAgeGatedContentArticle;
return React6(tmp(5062).Button, obj2);
} else if (tmp(14837).AgeGroupState.UNVERIFIED === ageGroup) {
const obj = { grow: true, variant: "secondary", size: "md", text: null, onPress: null };
const intl = tmp(1115).intl;
obj.text = intl.string(_modDef14843["cI+bc/"]);
obj.onPress = tmp(14837).handleShowAgeVerification;
return React6(tmp(5062).Button, obj);
}
}
const View = fn(17).View;
const TINY_BRONCO_BLOG_URL = fn(14804).TINY_BRONCO_BLOG_URL;
const ContentDismissActionType = fn(1955).ContentDismissActionType;
const jsxProd = fn(21);
({ jsx: closure_8, jsxs: closure_9 } = jsxProd);
const createStyles = fn(4640);
let obj2 = { header: { gap: nativeDefault.space.PX_12, paddingVertical: nativeDefault.space.PX_24 }, notice: null, noticeIcon: null, noticeBody: null, noticeDismiss: null, description: null };
let obj3 = { gap: nativeDefault.space.PX_12, paddingVertical: nativeDefault.space.PX_24 };
obj2.notice = { flexDirection: "row", alignItems: "flex-start", gap: nativeDefault.space.PX_8, padding: nativeDefault.space.PX_12, borderRadius: nativeDefault.radii.md, borderWidth: 1, borderColor: nativeDefault.colors.TEXT_LINK, backgroundColor: nativeDefault.colors.BACKGROUND_FEEDBACK_INFO };
obj2.noticeIcon = { flexShrink: 0 };
obj2.noticeBody = { flex: 1 };
obj2.noticeDismiss = { flexShrink: 0 };
let obj4 = { flexDirection: "row", alignItems: "flex-start", gap: nativeDefault.space.PX_8, padding: nativeDefault.space.PX_12, borderRadius: nativeDefault.radii.md, borderWidth: 1, borderColor: nativeDefault.colors.TEXT_LINK, backgroundColor: nativeDefault.colors.BACKGROUND_FEEDBACK_INFO };
obj2.description = { gap: nativeDefault.space.PX_8 };
let closure_10 = createStyles.createStyles(obj2);
let items = [fn(1944).DismissibleContent.TINY_BRONCO_NOTICE];
let closure_12 = [];
let obj6 = {};
obj6[fn(14837).AgeGroupState.ADULT] = _modDef14843["8TWztV"];
obj6[fn(14837).AgeGroupState.TEEN] = _modDef14843.qSkhZH;
obj6[fn(14837).AgeGroupState.UNVERIFIED] = _modDef14843.vGxRDB;
let obj7 = {};
obj7[fn(14837).AgeGroupState.ADULT] = _modDef14843.t5QjmQ;
obj7[fn(14837).AgeGroupState.TEEN] = _modDef14843["41MDhK"];
obj7[fn(14837).AgeGroupState.UNVERIFIED] = _modDef14843.m95jW8;
const size = fn(2);
const result = size.fileFinishedImporting("modules/tiny_bronco/native/TinyBroncoAgeGroupHeader.tsx");
export const TinyBroncoAgeGroupHeader = function TinyBroncoAgeGroupHeader() {
const tmp = closure_10();
const ageGroupState = useAgeGroupPresentation.useAgeGroupState();
const obj2 = { style: tmp.header, children: null };
items = [React6(AccountStatusNotice, { ageGroup: ageGroupState }), , ];
const obj3 = { style: tmp.description, children: null };
const obj4 = { variant: "heading-lg/semibold", color: "mobile-text-heading-primary", children: null };
const intl = util.intl;
obj4.children = intl.string(obj7[ageGroupState]);
const items1 = [React6(Text_Text.Heading, obj4), React6(AgeGroupDescription, { ageGroup: ageGroupState })];
obj3.children = items1;
items[1] = React7(View, obj3);
items[2] = React6(AgeGroupCallToAction, { ageGroup: ageGroupState });
obj2.children = items;
return React7(View, obj2);
};