Skip to content

Commit 37979dc

Browse files
authored
Merge pull request #13 from Midna3/develop
Release v0.0.1
2 parents b51c0a2 + eb7879c commit 37979dc

37 files changed

+1380
-273
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
"@types/node": "^16.7.13",
1212
"@types/react": "^17.0.20",
1313
"@types/react-dom": "^17.0.9",
14+
"axios": "^0.27.2",
1415
"chart.js": "^3.7.1",
1516
"react": "^18.0.0",
1617
"react-chartjs-2": "^4.1.0",
1718
"react-circular-progressbar": "^2.0.4",
1819
"react-dom": "^18.0.0",
20+
"react-router-dom": "^6.3.0",
1921
"react-scripts": "5.0.0",
22+
"react-select": "^5.3.2",
2023
"typescript": "^4.4.2",
2124
"web-vitals": "^2.1.0"
2225
},

public/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
manifest.json provides metadata used when your web app is installed on a
1313
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1414
-->
15-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1615
<!--
1716
Notice the use of %PUBLIC_URL% in the tags above.
1817
It will be replaced with the URL of the `public` folder during the build.
@@ -44,4 +43,4 @@
4443
-->
4544
</body>
4645

47-
</html>
46+
</html>

src/App.css

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/App.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
import React from 'react';
2-
import Home from './pages/Home';
1+
import { Routes, Route } from 'react-router-dom';
2+
import { globalStyles } from './stitches.config';
3+
import { Header } from './components/Header/Header';
4+
import { SchoolPage } from './pages/SchoolPage/SchoolPage';
5+
import { HomePage } from './pages/HomePage/HomePage';
36

47
function App() {
8+
globalStyles();
9+
510
return (
6-
<Home/>
11+
<div>
12+
<Header />
13+
<Routes>
14+
<Route path="/" element={<HomePage />} />
15+
<Route path="/school/:schoolId" element={<SchoolPage />} />
16+
</Routes>
17+
</div>
718
);
819
}
920

src/assets/icons/dashboard.png

495 Bytes
Loading
File renamed without changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { CircularProgressbarWithChildren } from 'react-circular-progressbar';
2+
import 'react-circular-progressbar/dist/styles.css';
3+
4+
import { circleGraph, graphBox, percent } from './style';
5+
6+
export type DataProp = {
7+
value: number;
8+
maxValue: number;
9+
fillColor: string;
10+
circleText: string;
11+
title: string;
12+
numericalData: number | null;
13+
};
14+
15+
export const CircleGraphBox = (props: DataProp) => {
16+
const { value, maxValue, fillColor, circleText, title, numericalData } =
17+
props;
18+
19+
return (
20+
<div className={graphBox()}>
21+
<div className={circleGraph()}>
22+
<CircularProgressbarWithChildren
23+
value={value}
24+
maxValue={maxValue}
25+
strokeWidth={5}
26+
styles={{
27+
text: {
28+
fontFamily: 'sans-serif',
29+
fill: `${fillColor}`,
30+
fontWeight: 500,
31+
},
32+
trail: { stroke: '#DBDFF1' },
33+
path: {
34+
stroke: `${fillColor}`,
35+
},
36+
}}
37+
>
38+
<div className={percent()}>
39+
<span>{circleText}</span>
40+
</div>
41+
</CircularProgressbarWithChildren>
42+
</div>
43+
<div
44+
style={{
45+
display: 'flex',
46+
flexDirection: 'column',
47+
justifyContent: 'center',
48+
}}
49+
>
50+
<span>{numericalData ? numericalData : '--'}</span>
51+
<p>{title}</p>
52+
</div>
53+
</div>
54+
);
55+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { css } from '../../stitches.config';
2+
3+
export const graphBox = css({
4+
display: 'flex',
5+
gap: 18,
6+
flexDirection: 'row',
7+
});
8+
9+
export const circleGraph = css({
10+
width: '90px',
11+
});
12+
13+
export const percent = css({
14+
fontSize: '25px',
15+
display: 'flex',
16+
justifyContent: 'center',
17+
alignItems: 'center',
18+
});

src/components/DataCard/DataCard.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import { dataCard, icon } from './style';
3+
4+
export type DataProp = {
5+
background: string;
6+
title: string;
7+
data: string;
8+
};
9+
10+
export const DataCard = (props: DataProp) => {
11+
const { background, title, data } = props;
12+
13+
return (
14+
<div className={dataCard()}>
15+
<div className={icon()} style={{ backgroundColor: `${background}` }} />
16+
<div
17+
style={{
18+
display: 'flex',
19+
flexDirection: 'column',
20+
justifyContent: 'center',
21+
}}
22+
>
23+
<p style={{ fontWeight: 'bold' }}>{title}</p>
24+
<p>{data}</p>
25+
</div>
26+
</div>
27+
);
28+
};

src/components/DataCard/style.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { css } from '../../stitches.config';
2+
3+
export const container = css({
4+
display: 'flex',
5+
flexDirection: 'column',
6+
gap: 47,
7+
padding: '50px',
8+
backgroundColor: '#F1F4FA',
9+
fontSize: '20px',
10+
color: '#383874',
11+
height: '800px',
12+
});
13+
14+
export const enrolledStudents = css({
15+
h1: {
16+
fontSize: '70px',
17+
},
18+
});
19+
20+
export const dataCard = css({
21+
display: 'flex',
22+
gap: 26,
23+
flexDirection: 'row',
24+
padding: '15px',
25+
paddingLeft: '0px',
26+
});
27+
28+
export const icon = css({
29+
width: '70px',
30+
height: '70px',
31+
borderRadius: '20px',
32+
});

src/components/Flex/Flex.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { styled } from '../../stitches.config';
2+
import { FlexCSS } from './style';
3+
4+
export const Flex = styled('div', FlexCSS);

src/components/Flex/style.ts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import { css } from '../../stitches.config';
2+
3+
export const FlexCSS = css({
4+
boxSizing: 'border-box',
5+
display: 'flex',
6+
7+
variants: {
8+
direction: {
9+
row: {
10+
flexDirection: 'row',
11+
},
12+
column: {
13+
flexDirection: 'column',
14+
},
15+
rowReverse: {
16+
flexDirection: 'row-reverse',
17+
},
18+
columnReverse: {
19+
flexDirection: 'column-reverse',
20+
},
21+
},
22+
align: {
23+
start: {
24+
alignItems: 'flex-start',
25+
},
26+
center: {
27+
alignItems: 'center',
28+
},
29+
end: {
30+
alignItems: 'flex-end',
31+
},
32+
stretch: {
33+
alignItems: 'stretch',
34+
},
35+
baseline: {
36+
alignItems: 'baseline',
37+
},
38+
},
39+
justify: {
40+
start: {
41+
justifyContent: 'flex-start',
42+
},
43+
center: {
44+
justifyContent: 'center',
45+
},
46+
end: {
47+
justifyContent: 'flex-end',
48+
},
49+
between: {
50+
justifyContent: 'space-between',
51+
},
52+
},
53+
wrap: {
54+
noWrap: {
55+
flexWrap: 'nowrap',
56+
},
57+
wrap: {
58+
flexWrap: 'wrap',
59+
},
60+
wrapReverse: {
61+
flexWrap: 'wrap-reverse',
62+
},
63+
},
64+
gap: {
65+
1: {
66+
gap: 5,
67+
},
68+
2: {
69+
gap: 10,
70+
},
71+
3: {
72+
gap: 15,
73+
},
74+
4: {
75+
gap: 20,
76+
},
77+
5: {
78+
gap: 25,
79+
},
80+
6: {
81+
gap: 30,
82+
},
83+
7: {
84+
gap: 35,
85+
},
86+
8: {
87+
gap: 40,
88+
},
89+
},
90+
},
91+
defaultVariants: {
92+
direction: 'row',
93+
align: 'stretch',
94+
justify: 'start',
95+
wrap: 'noWrap',
96+
},
97+
});

src/components/Header.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)