Created
February 11, 2022 16:05
-
-
Save Abusayid693/ee913c86e462d14912c1069314c67b8c to your computer and use it in GitHub Desktop.
Analytics main container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from "react"; | |
import {createUseStyles} from "react-jss" | |
import "antd/dist/antd.css"; | |
// Sub Components | |
import MyGraph from "./component/graph"; | |
import DropdownSelector from "./component/menu"; | |
import dataSet from "./component/data"; | |
const useStyles = createUseStyles(() => ({ | |
container: { | |
color: '#fff', | |
padding: '1rem', | |
transition: '0.3s ease-in-out', | |
width: '1200px', | |
height: '400px', | |
display:'flex', | |
flexDirection:'column', | |
position:'relative' | |
}, | |
})); | |
function Analytics() { | |
const classes = useStyles() | |
const [data, setData] = useState(dataSet.Today); | |
const fetchCustomData = (key) => { | |
setData(dataSet[key]); | |
}; | |
return ( | |
<div className={classes.container}> | |
<h1>Analytics</h1> | |
<DropdownSelector fetchCustomData={fetchCustomData} /> | |
<MyGraph data={data} /> | |
</div> | |
); | |
} | |
export default Analytics; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment