Skip to content

Commit

Permalink
Reactjs Admin Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Boel21 committed Sep 25, 2023
1 parent 1942008 commit 55fa0c2
Show file tree
Hide file tree
Showing 38 changed files with 19,244 additions and 143 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.env.development.local
.env.test.local
.env.production.local
.babelrc

npm-debug.log*
yarn-debug.log*
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Getting Started with Create React App

# React Admin Dashboard

npx create-react-app react admin

dependencies:

Install Material UI / data grid / icons --> npm i @mui/material @emotion/react @emotion/styled @mui/x-data-grid @mui/icons-material
Install react router dom --> npm i react-router-dom
Install react sidebar pro --> npm i react-pro-sidebar
Install formik / yup for forms --> npm i formik yup
Install Full Calendar --> npm i @fullcalendar/react @fullcalendar/core @fullcalendar/daygrid @fullcalendar/timegrid @fullcalendar/list @fullcalendar/interaction
Install Nivo charts --> npm i @nivo/core @nivo/pie @nivo/line @nivo/bar @nivo/geo

The new classes of the sidde bar pro are in the sideBarProUpdated.html file inside Global

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts
Expand Down
1,371 changes: 1,336 additions & 35 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fullcalendar/core": "^6.1.8",
"@fullcalendar/daygrid": "^6.1.8",
"@fullcalendar/interaction": "^6.1.9",
"@fullcalendar/list": "^6.1.8",
"@fullcalendar/react": "^6.1.9",
"@fullcalendar/timegrid": "^6.1.8",
"@mui/icons-material": "^5.14.9",
"@mui/material": "^5.14.10",
"@mui/x-data-grid": "^6.14.0",
"@nivo/bar": "^0.83.0",
"@nivo/core": "^0.83.0",
"@nivo/geo": "^0.83.0",
"@nivo/line": "^0.83.0",
"@nivo/pie": "^0.83.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"formik": "^2.4.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-pro-sidebar": "^1.1.0-alpha.1",
"react-router-dom": "^6.16.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"yup": "^1.2.0"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -34,5 +54,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "7.21.11"
}
}
Binary file added public/assets/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

59 changes: 41 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
import logo from './logo.svg';
import './App.css';
import { ColorModeContext, useMode } from "./theme";
import { CssBaseline, ThemeProvider } from "@mui/material";
import { Routes, Route } from "react-router-dom";
import Topbar from "./scenes/Global/Topbar";
import SideBar from "./scenes/Global/SideBar";
import Dashboard from "./scenes/dashboard";
import Team from "./scenes/team";
import Invoices from "./scenes/invoices";
import Contacts from "./scenes/contacts";
import Form from "./scenes/form";
import Calendar from "./scenes/calendar";
import FAQ from "./scenes/faq";
import Bar from "./scenes/bar";
import Line from "./scenes/line";
import Pie from "./scenes/pie";
import Geography from "./scenes/geography";

function App() {
const [theme, colorMode] = useMode();
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<ColorModeContext.Provider value={colorMode}>
<ThemeProvider theme={theme}>
<CssBaseline />
<div className="app">
<SideBar />
<main className="content">
<Topbar />
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/team" element={<Team />} />
<Route path="/contacts" element={<Contacts />} />
<Route path="/invoices" element={<Invoices />} />
<Route path="/form" element={<Form />} />
<Route path="/calendar" element={<Calendar />} />
<Route path="/faq" element={<FAQ />} />
<Route path="/bar" element={<Bar />} />
<Route path="/line" element={<Line />} />
<Route path="/pie" element={<Pie />} />
<Route path="/geography" element={<Geography />} />
</Routes>
</main>
</div>
</ThemeProvider>
</ColorModeContext.Provider>
);
}

Expand Down
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

130 changes: 130 additions & 0 deletions src/components/BarChart.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import { useTheme } from "@mui/material";
import { ResponsiveBar } from "@nivo/bar";
import { tokens } from "../theme";
import { mockBarData as data } from "../data/mockData";

const BarChart = ({ isDashboard = false }) => {
const theme = useTheme();
const colors = tokens(theme.palette.mode);

return (
<ResponsiveBar
data={data}
theme={{
// added
axis: {
domain: {
line: {
stroke: colors.grey[100],
},
},
legend: {
text: {
fill: colors.grey[100],
},
},
ticks: {
line: {
stroke: colors.grey[100],
strokeWidth: 1,
},
text: {
fill: colors.grey[100],
},
},
},
legends: {
text: {
fill: colors.grey[100],
},
},
}}
keys={["hot dog", "burger", "sandwich", "kebab", "fries", "donut"]}
indexBy="country"
margin={{ top: 50, right: 130, bottom: 50, left: 60 }}
padding={0.3}
valueScale={{ type: "linear" }}
indexScale={{ type: "band", round: true }}
colors={{ scheme: "nivo" }}
defs={[
{
id: "dots",
type: "patternDots",
background: "inherit",
color: "#38bcb2",
size: 4,
padding: 1,
stagger: true,
},
{
id: "lines",
type: "patternLines",
background: "inherit",
color: "#eed312",
rotation: -45,
lineWidth: 6,
spacing: 10,
},
]}
borderColor={{
from: "color",
modifiers: [["darker", "1.6"]],
}}
axisTop={null}
axisRight={null}
axisBottom={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: isDashboard ? undefined : "country", // changed
legendPosition: "middle",
legendOffset: 32,
}}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: isDashboard ? undefined : "food", // changed
legendPosition: "middle",
legendOffset: -40,
}}
enableLabel={false}
labelSkipWidth={12}
labelSkipHeight={12}
labelTextColor={{
from: "color",
modifiers: [["darker", 1.6]],
}}
legends={[
{
dataFrom: "keys",
anchor: "bottom-right",
direction: "column",
justify: false,
translateX: 120,
translateY: 0,
itemsSpacing: 2,
itemWidth: 100,
itemHeight: 20,
itemDirection: "left-to-right",
itemOpacity: 0.85,
symbolSize: 20,
effects: [
{
on: "hover",
style: {
itemOpacity: 1,
},
},
],
},
]}
role="application"
barAriaLabel={function (e) {
return e.id + ": " + e.formattedValue + " in country: " + e.indexValue;
}}
/>
);
};

export default BarChart;
Loading

0 comments on commit 55fa0c2

Please sign in to comment.