Files
bsky-social-app/src/components/IconCircle.tsx
T
Samuel Newman 1b0fbd503e Remove use of flatten where possible (#9325)
* remove use of flatten where possible

* restore flatten where it says it's needed

* missing utils alpha
2025-11-04 05:43:08 -08:00

41 lines
870 B
TypeScript

import {View} from 'react-native'
import {
atoms as a,
type TextStyleProp,
useTheme,
type ViewStyleProp,
} from '#/alf'
import {type Props} from '#/components/icons/common'
import {type Growth_Stroke2_Corner0_Rounded as Growth} from '#/components/icons/Growth'
export function IconCircle({
icon: Icon,
size = 'xl',
style,
iconStyle,
}: ViewStyleProp & {
icon: typeof Growth
size?: Props['size']
iconStyle?: TextStyleProp['style']
}) {
const t = useTheme()
return (
<View
style={[
a.justify_center,
a.align_center,
a.rounded_full,
{
width: size === 'lg' ? 52 : 64,
height: size === 'lg' ? 52 : 64,
backgroundColor: t.palette.primary_50,
},
style,
]}>
<Icon size={size} style={[{color: t.palette.primary_500}, iconStyle]} />
</View>
)
}