Commit 5111f2d7 authored by thetti27's avatar thetti27

Your commit message

parent 577936b5
Pipeline #7275 canceled with stages
This diff is collapsed.
...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@nivo/bar": "^0.85.1",
"@testing-library/jest-dom": "^5.17.0", "@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-router-dom": "^6.22.3",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"tailwindcss": "^3.4.1",
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"scripts": { "scripts": {
......
import React from 'react';
function About() {
return (
<div>
<h2>About Page</h2>
{/* Add more content here */}
</div>
);
}
export default About;
import logo from './logo.svg'; // App.js
import './App.css'; import React from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import Home from './Home';
import About from './About';
import Insights from './Insights';
import Navbar from './Navbar'; // Make sure to import the Navbar
function App() { function App() {
return ( return (
<div className="App"> <Router>
<header className="App-header"> <Navbar />
<img src={logo} className="App-logo" alt="logo" /> <Routes>
<p> <Route path="/about" element={<About />} />
Edit <code>src/App.js</code> and save to reload. <Route path="/insights" element={<Insights />} />
</p> <Route path="/" element={<Home />} />
<a </Routes>
className="App-link" </Router>
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
); );
} }
......
import React from 'react';
function Home() {
return (
<div>
<h2>Home Page</h2>
{/* Add more content here */}
</div>
);
}
export default Home;
\ No newline at end of file
import React from 'react';
import { ResponsiveBar } from '@nivo/bar';
// Updated data for student learning types
const data = [
{
"Learning Type": "Visual",
"Students": 50
},
{
"Learning Type": "Auditory",
"Students": 30
},
{
"Learning Type": "Read/Write",
"Students": 20
},
{
"Learning Type": "Kinesthetic",
"Students": 10
}
];
const Insights = () => (
<div style={{ height: '400px' }}>
<ResponsiveBar
data={data}
keys={['Students']}
indexBy="Learning Type"
margin={{ top: 50, right: 130, bottom: 50, left: 60 }}
padding={0.3}
groupMode="grouped"
colors={{ scheme: 'nivo' }}
borderColor={{ from: 'color', modifiers: [['darker', 1.6]] }}
axisBottom={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: 'Learning Type',
legendPosition: 'middle',
legendOffset: 32
}}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: 'Number of Students',
legendPosition: 'middle',
legendOffset: -40
}}
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
}
}
]
}
]}
/>
</div>
);
export default Insights;
// Navbar.js
import React from 'react';
import { NavLink } from 'react-router-dom';
const Navbar = () => {
const activeLinkStyle = ({ isActive }) =>
isActive ? 'text-blue-500' : 'text-white';
return (
<nav className="bg-gray-800 p-4">
<ul className="flex justify-start items-center space-x-4">
<li>
<NavLink
to="/"
className={activeLinkStyle}
aria-label="Home"
>
Home
</NavLink>
</li>
<li>
<NavLink
to="/about"
className={activeLinkStyle}
aria-label="About"
>
About
</NavLink>
</li>
<li>
<NavLink
to="/insights"
className={activeLinkStyle}
aria-label="Insights"
>
Insights
</NavLink>
</li>
</ul>
</nav>
);
};
export default Navbar;
body { @tailwind base;
margin: 0; @tailwind components;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', @tailwind utilities;
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', \ No newline at end of file
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment