diff --git a/app/(main)/classes/page.tsx b/app/(main)/classes/page.tsx new file mode 100644 index 0000000..9013e0a --- /dev/null +++ b/app/(main)/classes/page.tsx @@ -0,0 +1,103 @@ +/* eslint-disable @next/next/no-img-element */ +'use client'; +import { Button } from 'primereact/button'; +import React, { useContext, useEffect, useRef, useState } from 'react'; +import { LayoutContext } from '../../../layout/context/layoutcontext'; +import { ChartData, ChartOptions } from 'chart.js'; + +const Classes = () => { + + const { layoutConfig } = useContext(LayoutContext); + + const applyLightTheme = () => { + const lineOptions: ChartOptions = { + plugins: { + legend: { + labels: { + color: '#495057' + } + } + }, + scales: { + x: { + ticks: { + color: '#495057' + }, + grid: { + color: '#ebedef' + } + }, + y: { + ticks: { + color: '#495057' + }, + grid: { + color: '#ebedef' + } + } + } + }; + + setLineOptions(lineOptions); + }; + + const applyDarkTheme = () => { + const lineOptions = { + plugins: { + legend: { + labels: { + color: '#ebedef' + } + } + }, + scales: { + x: { + ticks: { + color: '#ebedef' + }, + grid: { + color: 'rgba(160, 167, 181, .3)' + } + }, + y: { + ticks: { + color: '#ebedef' + }, + grid: { + color: 'rgba(160, 167, 181, .3)' + } + } + } + }; + + setLineOptions(lineOptions); + }; + + // useEffect(() => { + // ProductService.getProductsSmall().then((data) => setProducts(data)); + // }, []); + + useEffect(() => { + if (layoutConfig.colorScheme === 'light') { + applyLightTheme(); + } else { + applyDarkTheme(); + } + }, [layoutConfig.colorScheme]); + + return ( +
+
+
+
+
+
+ ); +}; + +export default Classes; diff --git a/layout/AppMenu.tsx b/layout/AppMenu.tsx index a3d65b4..08e73fd 100644 --- a/layout/AppMenu.tsx +++ b/layout/AppMenu.tsx @@ -20,8 +20,10 @@ const AppMenu = () => { }, { label: 'Manage', - items: [{ label: 'Questions', icon: 'pi pi-fw pi-tag', to: '/questions/searchlist' }, - { label: 'Topics', icon: 'pi pi-fw pi-tag', to: '/questions/topics' }] + items: [{ label: 'Questions', icon: 'pi pi-fw pi-question-circle', to: '/questions/searchlist' }, + { label: 'Topics', icon: 'pi pi-fw pi-tags', to: '/questions/topics' }, + { label: 'Classes', icon: 'pi pi-fw pi-sitemap', to: '/classes' }, + ] }, /* { label: 'UI Components', @@ -189,7 +191,7 @@ const AppMenu = () => { - + ); }; diff --git a/package-lock.json b/package-lock.json index 9baa2ba..4ec4958 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "react": "18.3.1", "react-cookie": "^7.1.4", "react-dom": "18.3.1", - "typescript": "^5.5.2" + "typescript": "5.5.2" }, "devDependencies": { "eslint": "8.43.0",