-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultIcon.tsx
37 lines (31 loc) 路 927 Bytes
/
DefaultIcon.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { DynamicIcon, View } from '@bluebase/components';
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
import React from 'react';
import { Theme } from '@bluebase/core';
export interface DefaultIconStyles {
iconColor: { color: TextStyle['color'] },
root: StyleProp<ViewStyle>
}
export interface DefaultIconProps {
size: number;
styles?: Partial<DefaultIconStyles>
}
export const DefaultIcon = ({ size, styles: _styles }: DefaultIconProps) => {
const styles = _styles as DefaultIconStyles;
return (
<View style={[styles.root, { height: size, width: size, }]}>
<DynamicIcon type="icon" name="build" color={styles.iconColor.color} size={size/2} />
</View>
);
};
DefaultIcon.defaultStyles = (theme: Theme) => ({
iconColor: {
color: theme.palette.primary.main
},
root: {
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,.12)',
borderRadius: 10,
justifyContent: 'center',
},
});