diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-05-20 18:49:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-20 18:49:20 +0300 |
commit | a18b25d16c7ff4e5233cc6ca45511ba42b12f55f (patch) | |
tree | 6aca1c86eac4b69fdc1aecd3f081e7e5135c7ebb /src/components/Admonition.tsx | |
parent | c7101870944a34f874fd80b18c16e38e24d6b51b (diff) | |
download | voidsky-a18b25d16c7ff4e5233cc6ca45511ba42b12f55f.tar.zst |
[Live] Add warning if link is missing image (#8393)
Diffstat (limited to 'src/components/Admonition.tsx')
-rw-r--r-- | src/components/Admonition.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/Admonition.tsx b/src/components/Admonition.tsx index 8df4934be..cdb1f0b8b 100644 --- a/src/components/Admonition.tsx +++ b/src/components/Admonition.tsx @@ -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, |