mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
The store is wired into the header and the home page, so deleting the files that import it removed the site. Those files are back; a HeadAnchor variant is named menu, because gui now has a grid style prop that shadows a variant of that name; and the community page, which imports a component this repository never held, is gone. The store's own files remain until their importers stop importing them.
72 lines
1.5 KiB
TypeScript
72 lines
1.5 KiB
TypeScript
import { H3, Paragraph, XStack, YStack, styled } from '@hanzo/gui'
|
|
import { AlertTriangle, Info, CheckCircle } from '@hanzogui/lucide-icons-2'
|
|
|
|
import { unwrapText } from '~/helpers/unwrapText'
|
|
|
|
const getIcon = (theme: string) => {
|
|
switch (theme) {
|
|
case 'blue':
|
|
return Info
|
|
case 'green':
|
|
return CheckCircle
|
|
default:
|
|
return AlertTriangle
|
|
}
|
|
}
|
|
|
|
type NoticeTheme = 'yellow' | 'blue' | 'green'
|
|
|
|
export const Notice = ({
|
|
children,
|
|
theme = 'yellow',
|
|
disableUnwrap,
|
|
title,
|
|
...props
|
|
}: {
|
|
children: React.ReactNode
|
|
theme?: NoticeTheme
|
|
disableUnwrap?: boolean
|
|
title?: string
|
|
} & any) => {
|
|
const IconComponent = getIcon(theme)
|
|
|
|
return (
|
|
<NoticeFrame theme={theme} {...props}>
|
|
<XStack gap="$3">
|
|
<IconComponent size="$1" mt={5} color="$color10" />
|
|
<YStack flex={1}>
|
|
{title && (
|
|
<H3 size="$5" mb={-10} mt={5}>
|
|
{title}
|
|
</H3>
|
|
)}
|
|
<Paragraph
|
|
render="div"
|
|
py="$2"
|
|
color="$color11"
|
|
mt={-3}
|
|
mb={-3}
|
|
className="paragraph-parent"
|
|
size="$5"
|
|
>
|
|
{disableUnwrap ? children : unwrapText(children)}
|
|
</Paragraph>
|
|
</YStack>
|
|
</XStack>
|
|
</NoticeFrame>
|
|
)
|
|
}
|
|
|
|
export const NoticeFrame = styled(YStack, {
|
|
className: 'no-opacity-fade',
|
|
borderWidth: 1,
|
|
borderColor: '$borderColor',
|
|
p: '$4',
|
|
py: '$3',
|
|
bg: '$background',
|
|
rounded: '$4',
|
|
gap: '$3',
|
|
my: '$4',
|
|
position: 'relative',
|
|
})
|