You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.8 KiB
58 lines
2.8 KiB
import type { ImageSourcePropType } from 'react-native';
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
import type { ComponentProps } from 'react';
|
|
import { colors } from '../../src/theme';
|
|
|
|
/**
|
|
* 图片素材占位注册表(色块占位方案)
|
|
* ------------------------------------------------------------
|
|
* 【换真实图只改这里】把对应项的 source 改为 require('../../assets/xxx.png')
|
|
* 即可启用真实图,Illustration 会自动渲染图片,否则渲染色块占位。
|
|
* 所有页面组件只引用本注册表的 name,不直接持有图片,保证页面纯净。
|
|
*/
|
|
export type AssetName =
|
|
| 'logo'
|
|
| 'illustCandidate'
|
|
| 'illustRecruiter'
|
|
| 'illustCelebrate'
|
|
| 'avatarDesigner'
|
|
| 'wechat'
|
|
| 'businessLicense'
|
|
| 'defaultAvatar';
|
|
|
|
type IconName = ComponentProps<typeof Ionicons>['name'];
|
|
|
|
export interface AssetDef {
|
|
/** 【换真实图只改这里】设为 require('../../assets/xxx.png') 即启用真实图,否则渲染色块占位 */
|
|
source: ImageSourcePropType | null;
|
|
tint: string;
|
|
icon: IconName;
|
|
hint: string;
|
|
}
|
|
|
|
export const ASSET_REGISTRY: Record<AssetName, AssetDef> = {
|
|
// RN 静态图片仅支持 require 引用,豁免 no-require-imports 规则
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
logo: { source: require('../../assets/brand-logo.jpg'), tint: colors.primary, icon: 'briefcase', hint: '有职 Logo' },
|
|
illustCandidate: { source: null, tint: colors.primaryLight, icon: 'document-text', hint: '手持 OFFER 职场男性插画' },
|
|
illustRecruiter: { source: null, tint: colors.primaryLight, icon: 'person', hint: '手持 RESUME 职场男性插画' },
|
|
illustCelebrate: { source: null, tint: colors.successLight, icon: 'ribbon', hint: '庆祝插画' },
|
|
avatarDesigner: { source: null, tint: colors.infoLight, icon: 'person', hint: '资深 UI 设计师头像' },
|
|
wechat: { source: null, tint: colors.success, icon: 'logo-wechat', hint: '微信图标' },
|
|
businessLicense: { source: null, tint: colors.primaryLight, icon: 'document', hint: '营业执照示例图' },
|
|
defaultAvatar: { source: null, tint: colors.borderLight, icon: 'person', hint: '默认头像剪影' },
|
|
};
|
|
|
|
/**
|
|
* 滑块拼图验证背景图池(每次刷新随机选一张)
|
|
* RN 静态图片仅支持 require 引用,豁免 no-require-imports 规则
|
|
*/
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
export const CAPTCHA_BACKGROUNDS = [
|
|
require('../../assets/captcha-bg-1.jpg'), // 山峦晨雾
|
|
require('../../assets/captcha-bg-2.jpg'), // 海岸礁石
|
|
require('../../assets/captcha-bg-3.jpg'), // 多肉植物
|
|
require('../../assets/captcha-bg-4.jpg'), // 欧洲街景
|
|
require('../../assets/captcha-bg-5.jpg'), // 摩天大楼
|
|
] as ImageSourcePropType[];
|
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
|