forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2
3import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons'
4import {
5 atoms as a,
6 type TextStyleProp,
7 useTheme,
8 type ViewStyleProp,
9} from '#/alf'
10import {type Props} from '#/components/icons/common'
11import {type Growth_Stroke2_Corner0_Rounded as Growth} from '#/components/icons/Growth'
12
13export function IconCircle({
14 icon: Icon,
15 size = 'xl',
16 style,
17 iconStyle,
18}: ViewStyleProp & {
19 icon: typeof Growth
20 size?: Props['size']
21 iconStyle?: TextStyleProp['style']
22}) {
23 const t = useTheme()
24 const enableSquareButtons = useEnableSquareButtons()
25
26 return (
27 <View
28 style={[
29 a.justify_center,
30 a.align_center,
31 enableSquareButtons ? a.rounded_sm : a.rounded_full,
32 {
33 width: size === 'lg' ? 52 : 64,
34 height: size === 'lg' ? 52 : 64,
35 backgroundColor: t.palette.primary_50,
36 },
37 style,
38 ]}>
39 <Icon size={size} style={[{color: t.palette.primary_500}, iconStyle]} />
40 </View>
41 )
42}