forked from Yadro/time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIconTile.tsx
More file actions
36 lines (32 loc) · 715 Bytes
/
IconTile.tsx
File metadata and controls
36 lines (32 loc) · 715 Bytes
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
import React from 'react';
import { observer } from 'mobx-react';
import { createUseStyles } from 'react-jss';
import clsx from 'clsx';
interface IconTileProps {
children: React.ReactNode;
backgroundColor: string;
className?: string;
}
export default observer(function IconTile({
className,
children,
backgroundColor,
}: IconTileProps) {
const classes = useStyles();
return (
<span className={clsx(classes.root, className)} style={{ backgroundColor }}>
{children}
</span>
);
});
const useStyles = createUseStyles({
root: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: 30,
width: 30,
padding: 8,
borderRadius: 5,
},
});