[Live] Add warning if link is missing image (#8393)

This commit is contained in:
Samuel Newman
2025-05-20 18:49:20 +03:00
committed by GitHub
parent c710187094
commit a18b25d16c
5 changed files with 141 additions and 215 deletions
+6 -6
View File
@@ -1,13 +1,13 @@
import React from 'react'
import {StyleProp, View, ViewStyle} from 'react-native'
import {createContext, useContext} from 'react'
import {type StyleProp, View, type ViewStyle} from 'react-native'
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {Button as BaseButton, ButtonProps} from '#/components/Button'
import {Button as BaseButton, type ButtonProps} from '#/components/Button'
import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
import {Eye_Stroke2_Corner0_Rounded as InfoIcon} from '#/components/icons/Eye'
import {Leaf_Stroke2_Corner0_Rounded as TipIcon} from '#/components/icons/Leaf'
import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning'
import {Text as BaseText, TextProps} from '#/components/Typography'
import {Text as BaseText, type TextProps} from '#/components/Typography'
export const colors = {
warning: {
@@ -20,13 +20,13 @@ type Context = {
type: 'info' | 'tip' | 'warning' | 'error'
}
const Context = React.createContext<Context>({
const Context = createContext<Context>({
type: 'info',
})
export function Icon() {
const t = useTheme()
const {type} = React.useContext(Context)
const {type} = useContext(Context)
const Icon = {
info: InfoIcon,
tip: TipIcon,