forked from Yadro/time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfile.tsx
More file actions
35 lines (29 loc) · 918 Bytes
/
Profile.tsx
File metadata and controls
35 lines (29 loc) · 918 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
import React from 'react';
import { Space } from 'antd';
import { SettingOutlined } from '@ant-design/icons';
import { createUseStyles } from 'react-jss';
import rootStore from '../../modules/RootStore';
import useModal from '../../hooks/ModalHook';
import SettingsModal from '../SettingsModal/SettingsModal';
const { settingsStore } = rootStore;
const Profile: React.VFC = () => {
const classes = useStyles();
const { settings } = settingsStore;
const { open, openModal, closeModal } = useModal();
return (
<Space className={classes.root}>
<span className={classes.white}>{settings.currentProfile}</span>
<SettingOutlined className={classes.white} onClick={openModal} />
<SettingsModal visible={open} onClose={closeModal} />
</Space>
);
};
const useStyles = createUseStyles({
root: {
marginLeft: 16,
},
white: {
color: 'white',
},
});
export default Profile;