Skip to content

Commit b13d12e

Browse files
UI Updates added
1 parent 0be95f7 commit b13d12e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2426
-1238
lines changed

package-lock.json

+16-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hackstrap/blink-npm",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "This repo contains the code for blink npm pakage",
55
"author": "AbhijeetNandvikar",
66
"license": "MIT",
@@ -65,6 +65,7 @@
6565
"dist"
6666
],
6767
"dependencies": {
68+
"@agney/react-loading": "^0.1.2",
6869
"@uiw/react-md-editor": "^3.4.2",
6970
"axios": "^0.21.1",
7071
"chart.js": "^3.3.2",

src/App.css

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
::-webkit-scrollbar {
2+
margin-top: 4px;
3+
height: 5px;
4+
width: 5px;
5+
border-radius: 50%;
6+
}
7+
8+
::-webkit-scrollbar-track {
9+
background-color: transparent;
10+
}
11+
12+
::-webkit-scrollbar-thumb {
13+
background-color: rgb(187, 187, 187);
14+
outline: none;
15+
}
16+
17+
.editableInput {
18+
border: none;
19+
font-size: medium;
20+
color: rgb(49, 49, 49);
21+
outline: none;
22+
display: flex;
23+
/* height: 3rem; */
24+
position: relative;
25+
/* padding-left: 12px; */
26+
background-color: transparent;
27+
width: 100%;
28+
}
29+
30+
.MuiList-root {
31+
max-height: 300px;
32+
}
33+
34+
/* .ql-container {
35+
min-height: 500px;
36+
}
37+
.ql-editor {
38+
min-height: 500px;
39+
}
40+
41+
.ql-toolbar {
42+
border-radius: 4px 4px 0px 0px;
43+
}
44+
45+
.ql-container {
46+
border-radius: 0px 0px 4px 4px;
47+
} */
48+
49+
/*
50+
.editableInput:focus {
51+
border: 1px solid rgb(8, 160, 8);
52+
background-color: rgba(59, 255, 59, 0.26);
53+
} */

src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import PieChartIcon from '@material-ui/icons/PieChart'
4141
import StartupScreen from './Components/StartupScreen/StartupScreen'
4242
import InvestorScreen from './Components/InvestorScreen/InvestorScreen'
4343
import { Button, Container, Hidden } from '@material-ui/core'
44-
44+
import './App.css'
4545
const drawerWidth = 240
4646

4747
const useStyles = makeStyles((theme: Theme) =>

src/Components/ChartsComponents/ChartComponent.jsx

+47-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Chart, registerables } from "chart.js";
44
import { saveAs } from "file-saver";
55
import { toSvg, toPng } from "html-to-image";
66
import annotationPlugin from "chartjs-plugin-annotation";
7+
import { Bars } from "@agney/react-loading";
78

89
import {
910
Typography,
@@ -14,6 +15,7 @@ import {
1415
useTheme,
1516
FormControlLabel,
1617
Switch,
18+
CircularProgress,
1719
} from "@material-ui/core";
1820
import GetAppOutlinedIcon from "@material-ui/icons/GetAppOutlined";
1921
import { DateRange } from "react-date-range";
@@ -23,6 +25,8 @@ import { ContactsTwoTone } from "@material-ui/icons";
2325
import CloudUploadOutlinedIcon from "@material-ui/icons/CloudUploadOutlined";
2426
import { updateCollection } from "../fetch";
2527
import { ChartCard } from "../InvestorScreen/Dashboard/ValuationPage";
28+
import { KeyDownIcon } from "../StartupScreen/TablesView/NotesPage/NotesComponent/NotesComponent";
29+
// import ChartPlaceholder from "../ChartPlaceholder";
2630

2731
Chart.register(annotationPlugin);
2832

@@ -90,6 +94,13 @@ const useStyles = makeStyles((theme) => {
9094
display: "flex",
9195
alignItems: "center",
9296
},
97+
dropDownBtn: {
98+
display: "flex",
99+
"&:focus": {
100+
border: "1px solid #0066eb",
101+
boxShadow: "0 0 1.5pt 1.5pt #78b3ff78",
102+
},
103+
},
93104
};
94105
});
95106

@@ -142,7 +153,7 @@ const ChartComponent = ({
142153
let years = [];
143154
for (
144155
let i = new Date().getFullYear();
145-
i > parseInt(currentYear) - 200;
156+
i > parseInt(currentYear) - 100;
146157
i--
147158
) {
148159
years = [...years, i.toString()];
@@ -182,7 +193,14 @@ const ChartComponent = ({
182193

183194
return (
184195
<div className={classes.chartContainer}>
185-
<div ref={thisContainer}>
196+
<div
197+
ref={thisContainer}
198+
style={{
199+
display: "flex",
200+
flexDirection: "column",
201+
height: "100%",
202+
}}
203+
>
186204
<div className={styles.infoContainer}>
187205
<div className={classes.title}>
188206
<Typography variant="h4">{title}</Typography>
@@ -193,8 +211,10 @@ const ChartComponent = ({
193211
setShowYearConfig(!showYearConfig);
194212
}}
195213
variant="outlined"
214+
className={classes.dropDownBtn}
196215
>
197-
<Typography variant="body2">{currentYear}</Typography>
216+
<Typography variant="body2">{currentYear}</Typography>{" "}
217+
<KeyDownIcon />
198218
</Button>
199219
{showYearConfig ? (
200220
<div
@@ -304,7 +324,30 @@ const ChartComponent = ({
304324
<canvas className={classes.canvas} ref={thisGraph}></canvas>
305325
</div>
306326
) : (
307-
<Typography variant="h3">No Data Avaliable for this year</Typography>
327+
<div
328+
style={{
329+
flexGrow: 1,
330+
justifyContent: "center",
331+
alignItems: "center",
332+
display: "flex",
333+
}}
334+
>
335+
<div>
336+
<div style={{ maxWidth: "50px", margin: "auto", color: "gray" }}>
337+
<Bars />
338+
</div>
339+
<Typography
340+
variant="h4"
341+
style={{
342+
textAlign: "center",
343+
marginTop: "1.5rem",
344+
color: "gray",
345+
}}
346+
>
347+
Your Analytics is building
348+
</Typography>
349+
</div>
350+
</div>
308351
)}
309352
</div>
310353
{chartControl ? (

src/Components/ChartsComponents/ChartWrapper.jsx

+29-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,37 @@ Chart.register(...registerables);
99

1010
Chart.register(annotationPlugin);
1111

12-
const ChartWrapper = ({ type, data, options }) => {
12+
const ChartWrapper = ({ type, data, options, gradient, backgroundColor }) => {
1313
const thisGraph = useRef(null);
1414

1515
const renderChart = (ref) => {
16-
if (ref.current !== null && data && options) {
17-
return new Chart(ref.current, {
18-
type,
19-
data,
20-
options,
21-
});
16+
if (ref.current !== null && options && data) {
17+
if (gradient) {
18+
const ctx = thisGraph.current.getContext("2d");
19+
const gradient = ctx.createLinearGradient(0, 120, 0, 0);
20+
gradient.addColorStop(1, backgroundColor + "bb");
21+
gradient.addColorStop(0, backgroundColor + "00");
22+
return new Chart(thisGraph.current, {
23+
type,
24+
data,
25+
options: {
26+
...options,
27+
backgroundColor: gradient,
28+
maintainAspectRatio: false,
29+
responsive: true,
30+
},
31+
});
32+
} else {
33+
return new Chart(thisGraph.current, {
34+
type,
35+
data,
36+
options: {
37+
...options,
38+
maintainAspectRatio: false,
39+
responsive: true,
40+
},
41+
});
42+
}
2243
}
2344
};
2445

@@ -30,7 +51,7 @@ const ChartWrapper = ({ type, data, options }) => {
3051
}, []);
3152

3253
return (
33-
<div>
54+
<div style={{ display: "flex" }}>
3455
<canvas ref={thisGraph}></canvas>
3556
</div>
3657
);

src/Components/ChartsComponents/LineChart/LineChart.jsx

+38-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ import {
1212
useTheme,
1313
FormControlLabel,
1414
Switch,
15+
CircularProgress,
1516
} from "@material-ui/core";
1617
import GetAppOutlinedIcon from "@material-ui/icons/GetAppOutlined";
1718
import { DateRange } from "react-date-range";
1819
import { globalContext } from "../../../AppContext";
1920
import CloudUploadOutlinedIcon from "@material-ui/icons/CloudUploadOutlined";
2021
import axios from "axios";
22+
import { KeyDownIcon } from "../../StartupScreen/TablesView/NotesPage/NotesComponent/NotesComponent";
23+
import { Bars } from "@agney/react-loading";
24+
// import ChartPlaceholder from "../../ChartPlaceholder";
2125
Chart.register(...registerables);
2226

2327
const useStyles = makeStyles((theme) => {
@@ -79,6 +83,13 @@ const useStyles = makeStyles((theme) => {
7983
display: "flex",
8084
alignItems: "center",
8185
},
86+
dropDownBtn: {
87+
display: "flex",
88+
"&:focus": {
89+
border: "1px solid #0066eb",
90+
boxShadow: "0 0 1.5pt 1.5pt #78b3ff78",
91+
},
92+
},
8293
};
8394
});
8495
const LineChartComponent = ({
@@ -143,7 +154,7 @@ const LineChartComponent = ({
143154
let years = [];
144155
for (
145156
let i = new Date().getFullYear();
146-
i > parseInt(currentYear) - 200;
157+
i > parseInt(currentYear) - 100;
147158
i--
148159
) {
149160
years = [...years, i.toString()];
@@ -175,8 +186,10 @@ const LineChartComponent = ({
175186
setShowDatePicker(!showDatePicker);
176187
}}
177188
variant="outlined"
189+
classes={classes.dropDownBtn}
178190
>
179191
<Typography variant="body2">{currentYear}</Typography>
192+
<KeyDownIcon />
180193
</Button>
181194
{showDatePicker ? (
182195
<div
@@ -258,7 +271,30 @@ const LineChartComponent = ({
258271
<canvas className={classes.canvas} ref={thisGraph}></canvas>
259272
</div>
260273
) : (
261-
<Typography variant="h3">No Data Avaliable for this year</Typography>
274+
<div
275+
style={{
276+
flexGrow: 1,
277+
justifyContent: "center",
278+
alignItems: "center",
279+
display: "flex",
280+
}}
281+
>
282+
<div>
283+
<div style={{ maxWidth: "50px", margin: "auto", color: "gray" }}>
284+
<Bars />
285+
</div>
286+
<Typography
287+
variant="h4"
288+
style={{
289+
textAlign: "center",
290+
marginTop: "1.5rem",
291+
color: "gray",
292+
}}
293+
>
294+
Your Analytics is building
295+
</Typography>
296+
</div>
297+
</div>
262298
)}
263299
{chartControl ? (
264300
<div className={classes.toggleContainer}>

src/Components/ChartsComponents/LineChart/index.module.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
.columnConfigBox {
3737
display: flex;
38-
width: 141px;
38+
min-width: 100px;
3939
flex-direction: column;
4040
align-items: flex-start;
4141
padding: 15px;
@@ -44,6 +44,7 @@
4444
position: absolute;
4545
z-index: 20;
4646
background-color: white;
47-
max-height: 400px;
47+
max-height: 150px;
4848
overflow-y: auto;
49+
cursor: pointer;
4950
}

src/Components/ChartsComponents/index.module.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727
width: 100%;
2828
margin-top: 2rem;
2929
}
30-
3130
.columnConfigBox {
3231
display: flex;
33-
width: 141px;
32+
/* min-width: 100px; */
3433
flex-direction: column;
3534
align-items: flex-start;
3635
padding: 15px;
@@ -39,6 +38,7 @@
3938
position: absolute;
4039
z-index: 20;
4140
background-color: white;
42-
max-height: 400px;
41+
max-height: 150px;
4342
overflow-y: auto;
43+
cursor: pointer;
4444
}

src/Components/ChartsWrapper/CustomerChurnRate.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const CustomerChurnRate = (props) => {
147147
}, [currentYear, props]);
148148

149149
return (
150-
<div>
150+
<div style={{ height: "100%" }}>
151151
<LineChartComponent
152152
title="Customer Churn Rate (%)"
153153
description="Customer churn is the percentage of customers that stopped using your company's product or service during a certain time frame."

0 commit comments

Comments
 (0)