diff --git a/navigation/vertical/index.ts b/navigation/vertical/index.ts index 9b63eaf..2d9a436 100644 --- a/navigation/vertical/index.ts +++ b/navigation/vertical/index.ts @@ -8,7 +8,7 @@ import ListIcon from '@mui/icons-material/List'; // ** Type import import { VerticalNavItemsType } from '../../core/layouts/types' import { BankTransfer, Cart, Clipboard, PageFirst, StarOutline } from 'mdi-material-ui' -import { DocumentScanner, FileOpen, OpenInBrowser, Settings, WebAsset } from '@mui/icons-material' +import { DocumentScanner, FileOpen, LockPerson, OpenInBrowser, People, PeopleOutline, Settings, WebAsset } from '@mui/icons-material' import { useState, useEffect } from 'react' const navigation = (): VerticalNavItemsType => { @@ -46,10 +46,20 @@ const navigation = (): VerticalNavItemsType => { sectionTitle: 'Admin' }, { - title: 'Artist Requests', - icon: Clipboard, + title: 'Manage Artist Access', + icon: LockPerson, path: '/dashboard/admin/requests' }, + { + title: 'Manage Users', + icon: People, + path: '/dashboard/admin/users' + }, + { + title: 'Manage Artists', + icon: PeopleOutline, + path: '/dashboard/admin/artists' + }, { sectionTitle: 'General' }, diff --git a/pages/account-settings/index.tsx b/pages/account-settings/index.tsx deleted file mode 100644 index b6cd06c..0000000 --- a/pages/account-settings/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -// ** React Imports -import { SyntheticEvent, useState } from 'react' - -// ** MUI Imports -import Box from '@mui/material/Box' -import Card from '@mui/material/Card' -import TabList from '@mui/lab/TabList' -import TabPanel from '@mui/lab/TabPanel' -import TabContext from '@mui/lab/TabContext' -import { styled } from '@mui/material/styles' -import MuiTab, { TabProps } from '@mui/material/Tab' - -// ** Icons Imports -import AccountOutline from 'mdi-material-ui/AccountOutline' -import LockOpenOutline from 'mdi-material-ui/LockOpenOutline' -import InformationOutline from 'mdi-material-ui/InformationOutline' - -// ** Demo Tabs Imports -import TabInfo from '../../views/account-settings/TabInfo' -import TabAccount from '../../views/account-settings/TabAccount' -import TabSecurity from '../../views/account-settings/TabSecurity' - -// ** Third Party Styles Imports -import 'react-datepicker/dist/react-datepicker.css' - -const Tab = styled(MuiTab)(({ theme }) => ({ - [theme.breakpoints.down('md')]: { - minWidth: 100 - }, - [theme.breakpoints.down('sm')]: { - minWidth: 67 - } -})) - -const TabName = styled('span')(({ theme }) => ({ - lineHeight: 1.71, - fontSize: '0.875rem', - marginLeft: theme.spacing(2.4), - [theme.breakpoints.down('md')]: { - display: 'none' - } -})) - -const AccountSettings = () => { - // ** State - const [value, setValue] = useState('account') - - const handleChange = (event: SyntheticEvent, newValue: string) => { - setValue(newValue) - } - - return ( - - - `1px solid ${theme.palette.divider}` }} - > - - - Account - - } - /> - - - Security - - } - /> - - - Info - - } - /> - - - - - - - - - - - - - - ) -} - -export default AccountSettings diff --git a/pages/advanced/api-profile.tsx b/pages/advanced/api-profile.tsx deleted file mode 100644 index 2e2c13c..0000000 --- a/pages/advanced/api-profile.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { useEffect, useState } from "react"; -import { useUser } from "@auth0/nextjs-auth0/client"; -import Layout from "../../components/Old/layout"; - -const ApiProfile = () => { - const { user, isLoading } = useUser(); - - const [data, setData] = useState(null); - - useEffect(() => { - (async () => { - const res = await fetch("/api/protected-api"); - - const data = await res.json(); - - setData(data); - })(); - }, []); - - return ( - -

Profile

- -
-

Public page (client rendered)

-

We are fetching data on the client-side :

-

By making request to '/api/protected-api' serverless function

-

so without a valid session cookie will fail

-

{JSON.stringify(data)}

-
-
- ); -}; - -// Public route.(CSR) also accessing API from the client-side. -// data is not cached when redirecting between pages. -export default ApiProfile; diff --git a/pages/advanced/ssr-profile.tsx b/pages/advanced/ssr-profile.tsx deleted file mode 100644 index 3b8d2cb..0000000 --- a/pages/advanced/ssr-profile.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { withPageAuthRequired } from "@auth0/nextjs-auth0"; -import Layout from "../../components/Old/layout"; -import { User } from "../../interfaces"; - -type ProfileProps = { - user: User; -}; - -export default function Profile({ user }: ProfileProps) { - return ( - -

Profile

- -
-

Profile (server rendered)

- user picture -

nickname: {user.nickname}

-

name: {user.name}

-
-
- ); -} - -// Protected route, checking authentication status before rendering the page.(SSR) -// It's slower than a static page with client side authentication -export const getServerSideProps = withPageAuthRequired(); diff --git a/pages/api/admin/artists.tsx b/pages/api/admin/artists.tsx new file mode 100644 index 0000000..4430db8 --- /dev/null +++ b/pages/api/admin/artists.tsx @@ -0,0 +1,18 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { offset, pageSize } = req.body; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists?offset='+offset+'&pageSize='+pageSize, { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/artists/[artistId].tsx b/pages/api/admin/artists/[artistId].tsx new file mode 100644 index 0000000..306069b --- /dev/null +++ b/pages/api/admin/artists/[artistId].tsx @@ -0,0 +1,18 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { artistId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists/'+userId, { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/artists/[artistId]/suspend.tsx b/pages/api/admin/artists/[artistId]/suspend.tsx new file mode 100644 index 0000000..bb6db5b --- /dev/null +++ b/pages/api/admin/artists/[artistId]/suspend.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists/'+userId+"/Suspend", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/artists/[artistId]/terminate.tsx b/pages/api/admin/artists/[artistId]/terminate.tsx new file mode 100644 index 0000000..b1deae5 --- /dev/null +++ b/pages/api/admin/artists/[artistId]/terminate.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists/'+userId+"/Terminate", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/artists/[artistId]/unsuspend.tsx b/pages/api/admin/artists/[artistId]/unsuspend.tsx new file mode 100644 index 0000000..33b81fe --- /dev/null +++ b/pages/api/admin/artists/[artistId]/unsuspend.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists/'+userId+"/Unsuspend", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/artists/count.tsx b/pages/api/admin/artists/count.tsx new file mode 100644 index 0000000..00ac8f1 --- /dev/null +++ b/pages/api/admin/artists/count.tsx @@ -0,0 +1,16 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtists/Count', { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); diff --git a/pages/api/admin/requests.tsx b/pages/api/admin/requests.tsx index 722f666..5ce5be9 100644 --- a/pages/api/admin/requests.tsx +++ b/pages/api/admin/requests.tsx @@ -2,7 +2,8 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a export default withApiAuthRequired(async function onboardUrl(req, res) { const { accessToken } = await getAccessToken(req, res); - const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests', { + const { offset, pageSize } = req.body; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests?offset='+offset+'&pageSize='+pageSize, { headers: { "Authorization": `Bearer ${accessToken}` } diff --git a/pages/api/admin/requests/[requestId].tsx b/pages/api/admin/requests/[requestId].tsx new file mode 100644 index 0000000..7eaea0e --- /dev/null +++ b/pages/api/admin/requests/[requestId].tsx @@ -0,0 +1,20 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { requestId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests/'+requestId, { + headers: { + "Authorization": `Bearer ${accessToken}`, + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + +// handles ACCEPT AND DENY \ No newline at end of file diff --git a/pages/api/admin/requests/count.tsx b/pages/api/admin/requests/count.tsx new file mode 100644 index 0000000..7980dc0 --- /dev/null +++ b/pages/api/admin/requests/count.tsx @@ -0,0 +1,16 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests/Count', { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); diff --git a/pages/api/admin/users.tsx b/pages/api/admin/users.tsx new file mode 100644 index 0000000..74a5e05 --- /dev/null +++ b/pages/api/admin/users.tsx @@ -0,0 +1,18 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { offset, pageSize } = req.body; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers?offset='+offset+'&pageSize='+pageSize, { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/users/[userId].tsx b/pages/api/admin/users/[userId].tsx new file mode 100644 index 0000000..3ca0184 --- /dev/null +++ b/pages/api/admin/users/[userId].tsx @@ -0,0 +1,18 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/'+userId, { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/requests/[userId].tsx b/pages/api/admin/users/[userId]/ban.tsx similarity index 84% rename from pages/api/admin/requests/[userId].tsx rename to pages/api/admin/users/[userId]/ban.tsx index 763cece..14b4587 100644 --- a/pages/api/admin/requests/[userId].tsx +++ b/pages/api/admin/users/[userId]/ban.tsx @@ -3,9 +3,9 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a export default withApiAuthRequired(async function onboardUrl(req, res) { const { accessToken } = await getAccessToken(req, res); const { userId } = req.query; - const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests/'+userId, { + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/'+userId+"/Ban", { headers: { - "Authorization": `Bearer ${accessToken}`, + "Authorization": `Bearer ${accessToken}` }, method: req.method }); diff --git a/pages/api/admin/users/[userId]/suspend.tsx b/pages/api/admin/users/[userId]/suspend.tsx new file mode 100644 index 0000000..1e21de3 --- /dev/null +++ b/pages/api/admin/users/[userId]/suspend.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/'+userId+"/Suspend", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/users/[userId]/unban.tsx b/pages/api/admin/users/[userId]/unban.tsx new file mode 100644 index 0000000..f925cbf --- /dev/null +++ b/pages/api/admin/users/[userId]/unban.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/'+userId+"/Unban", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/users/[userId]/unsuspend.tsx b/pages/api/admin/users/[userId]/unsuspend.tsx new file mode 100644 index 0000000..4c4fcde --- /dev/null +++ b/pages/api/admin/users/[userId]/unsuspend.tsx @@ -0,0 +1,19 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const { userId } = req.query; + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/'+userId+"/Unsuspend", { + headers: { + "Authorization": `Bearer ${accessToken}` + }, + method: req.method + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); + diff --git a/pages/api/admin/users/count.tsx b/pages/api/admin/users/count.tsx new file mode 100644 index 0000000..80f9b6d --- /dev/null +++ b/pages/api/admin/users/count.tsx @@ -0,0 +1,16 @@ +import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; + +export default withApiAuthRequired(async function onboardUrl(req, res) { + const { accessToken } = await getAccessToken(req, res); + const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminUsers/Count', { + headers: { + "Authorization": `Bearer ${accessToken}` + } + }); + if(response.ok==false){ + res.status(200).json({}) + return; + } + let result = await response.json(); + res.status(200).json(result); +}); diff --git a/pages/api/artist/onboardurl.tsx b/pages/api/artist/onboardurl.tsx index 628d56b..d871cf9 100644 --- a/pages/api/artist/onboardurl.tsx +++ b/pages/api/artist/onboardurl.tsx @@ -7,7 +7,9 @@ export default withApiAuthRequired(async function onboardUrl(req, res) { "Authorization": `Bearer ${accessToken}` } }); - + if(response.ok==false){ + res.status(200).json({}) + } let result = await response.json(); res.status(200).json(result); }); diff --git a/pages/cards/index.tsx b/pages/cards/index.tsx deleted file mode 100644 index 8828416..0000000 --- a/pages/cards/index.tsx +++ /dev/null @@ -1,83 +0,0 @@ -// ** MUI Imports -import Grid from '@mui/material/Grid' -import Typography from '@mui/material/Typography' - -// ** Demo Components Imports -import CardUser from '../views/cards/CardUser' -import CardImgTop from '../views/cards/CardImgTop' -import CardMobile from '../views/cards/CardMobile' -import CardSupport from '../views/cards/CardSupport' -import CardTwitter from '../views/cards/CardTwitter' -import CardFacebook from '../views/cards/CardFacebook' -import CardLinkedIn from '../views/cards/CardLinkedIn' -import CardAppleWatch from '../views/cards/CardAppleWatch' -import CardMembership from '../views/cards/CardMembership' -import CardInfluencer from '../views/cards/CardInfluencer' -import CardNavigation from '../views/cards/CardNavigation' -import CardWithCollapse from '../views/cards/CardWithCollapse' -import CardVerticalRatings from '../views/cards/CardVerticalRatings' -import CardNavigationCenter from '../views/cards/CardNavigationCenter' -import CardHorizontalRatings from '../views/cards/CardHorizontalRatings' - -const CardBasic = () => { - return ( - - - Basic Cards - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - `${theme.spacing(17.5)} !important` }}> - Navigation Cards - - - - - - - - `${theme.spacing(17.5)} !important` }}> - Solid Cards - - - - - - - - - - - - ) -} - -export default CardBasic diff --git a/pages/dashboard/admin/artists.tsx b/pages/dashboard/admin/artists.tsx new file mode 100644 index 0000000..28ab83d --- /dev/null +++ b/pages/dashboard/admin/artists.tsx @@ -0,0 +1,151 @@ +import * as React from 'react'; +import { DataGrid } from '@mui/x-data-grid'; +import { GridColDef } from '@mui/x-data-grid'; +import TextField from '@mui/material/TextField'; +import { Button, Stack, Typography } from '@mui/material'; +import CurrencyTextField from '@lupus-ai/mui-currency-textfield'; +import { DateField } from '@mui/x-date-pickers/DateField'; +import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; +import Chip from '@mui/material/Chip'; +import {Block, Check, Close, Download, OpenInFull, OpenInNew, Refresh, Star, Upload } from '@mui/icons-material'; +import PriceCheckIcon from '@mui/icons-material/PriceCheck'; +import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn'; +import AssignmentLateIcon from '@mui/icons-material/AssignmentLate'; +import ShoppingCartCheckoutIcon from '@mui/icons-material/ShoppingCartCheckout'; +import { IconButton } from '@mui/material'; +import Tooltip from '@mui/material/Tooltip'; +import { Card, CardContent } from '@mui/material'; +import Rating from '@mui/material/Rating'; + + +import dayjs from 'dayjs'; +import { DownloadBox, Magnify, StarOutline } from 'mdi-material-ui'; +import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, FormControl, InputLabel, Box } from '@mui/material'; +import { Grid } from '@mui/material'; +import { useRouter } from 'next/router'; +import { request } from 'http'; +import { useMediaQuery } from '@mui/material'; + + +export default function AdminArtists() { + const isSmallScreen = useMediaQuery(theme => theme.breakpoints.down('sm')); // Check if the screen size is small + const router = useRouter(); + let columns = []; + if(isSmallScreen){ + columns = [ + { field: 'id', headerName: '', flex: 0.05, sortable: false, filterable: false}, + ]; + } + else{ + columns = [ + { field: 'id', headerName: '', flex: 0.05, sortable: false, filterable: false}, + { field: 'displayName', headerName: 'User Name', flex: 0.15, sortable: false, filterable: false, valueGetter: (params) => { + return params.row.user.displayName + }}, + { field: 'name', headerName: 'Artist Name', flex: 0.15, sortable: false, filterable: false, valueGetter: (params) => { + return params.row.name + }}, + { field: 'email', headerName: 'Email', flex: 0.15, sortable: false, filterable: false, valueGetter: (params) => { + return params.row.user.email + }}, + { field: 'numberOfRequests', headerName: '# of Requests', flex: 0.1, sortable: false, filterable: false}, + { field: 'averageRating', headerName: 'Average Rating', flex: 0.1, sortable: false, filterable: false}, + { field: 'amountMade', headerName: 'Amount Made', flex: 0.1, sortable: false, filterable: false}, + { field: 'feesCollected', headerName: 'Fees Collected', flex: 0.1, sortable: false, filterable: false}, + { field: 'status', headerName: 'Status', flex: 0.1, sortable: false, filterable: false, renderCell: (params) =>{ + if(params.row.user.banned){ + return } label="Banned" variant="outlined" color="error" /> + } + else if(params.row.suspended || params.row.user.suspended){ + return } label="Suspended" variant="outlined" color="error" /> + } + else{ + return } label="Active" variant="outlined" color="success" /> + } + }}, + { field: 'actions', headerName: '', flex: 0.05, sortable: false, filterable: false, renderCell: (params) => { + return router.push("/dashboard/admin/users/"+params.row.id)}> + }} + ]; + } + const [isLoading, setIsLoading] = React.useState(true); + const [requestCount, setRequestCount] = React.useState(null); + const [requestData, setRequestData] = React.useState({}); + const [paginationModel, setPaginationModel] = React.useState({ + page: 0, + pageSize: 15, + }); + + + const getRequests = async () => { + setIsLoading(true); + const response = await fetch('/api/admin/artists', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }), + }); + const data = await response.json(); + setRequestData(data); + setIsLoading(false); + } + const getRequestsCount = async () => { + const response = await fetch('/api/admin/artists/count', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }) + }); + const data = await response.json(); + setRequestCount(data); + setRowCountState((prevRowCountState) => + data !== undefined + ? data + : prevRowCountState, + ); + return data; + } + + // Some API clients return undefined while loading + // Following lines are here to prevent `rowCountState` from being undefined during the loading + const [rowCountState, setRowCountState] = React.useState(0); + React.useEffect(() => { + getRequests(); + getRequestsCount(); + }, [requestCount, setRowCountState,paginationModel]); + + return ( + +
+ + + +
+ ); +} \ No newline at end of file diff --git a/pages/dashboard/admin/artists/[artistId].tsx b/pages/dashboard/admin/artists/[artistId].tsx new file mode 100644 index 0000000..cf8d73b --- /dev/null +++ b/pages/dashboard/admin/artists/[artistId].tsx @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { useState, useEffect } from 'react'; +import { useRouter } from 'next/router'; +import { withPageAuthRequired } from '@auth0/nextjs-auth0/client' + +const AdminArtist = () => { + const router = useRouter(); + + const getData = async () => { + if(router.query.artistId!=null){ + + } + } + + + useEffect(() => { + getData() + }, [router.query.artistId]); + + return (<> + + ); +}; + +// Protected route, checking user authentication client-side.(CSR) +export default withPageAuthRequired(ArtistRequestDetails); + + diff --git a/pages/dashboard/admin/requests.tsx b/pages/dashboard/admin/requests.tsx index f9011d2..2a14666 100644 --- a/pages/dashboard/admin/requests.tsx +++ b/pages/dashboard/admin/requests.tsx @@ -1,50 +1,206 @@ -import { useUser,withPageAuthRequired } from "@auth0/nextjs-auth0/client"; -import { Grid, Typography } from "@mui/material"; -import Card from "@mui/material/Card"; -import CardContent from "@mui/material/CardContent"; -import EditableArtistPortfolio from "../../../components/Old/editableArtistPortfolio"; -import { useEffect, useState } from "react"; +import * as React from 'react'; +import { DataGrid } from '@mui/x-data-grid'; +import { GridColDef } from '@mui/x-data-grid'; import TextField from '@mui/material/TextField'; -import Button from '@mui/material/Button'; -import Switch from '@mui/material/Switch'; -import Divider from '@mui/material/Divider'; -import ArtistRequest from "../../../components/dashboard/admin/artistRequest"; +import { Button, Stack, Typography } from '@mui/material'; +import CurrencyTextField from '@lupus-ai/mui-currency-textfield'; +import { DateField } from '@mui/x-date-pickers/DateField'; +import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; +import Chip from '@mui/material/Chip'; +import {Block, Check, Close, Download, OpenInFull, OpenInNew, Person, Refresh, Star, Upload } from '@mui/icons-material'; +import PriceCheckIcon from '@mui/icons-material/PriceCheck'; +import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn'; +import AssignmentLateIcon from '@mui/icons-material/AssignmentLate'; +import ShoppingCartCheckoutIcon from '@mui/icons-material/ShoppingCartCheckout'; +import { IconButton } from '@mui/material'; +import Tooltip from '@mui/material/Tooltip'; +import { Card, CardContent } from '@mui/material'; +import Rating from '@mui/material/Rating'; -const ArtistRequests = () => { - const {user, isLoading} = useUser(); - const [artistRequestData, setArtistRequestData] = useState(null); - const getData = () => { - fetch('/api/admin/requests').then(response => response.json().then(data => setArtistRequestData(data))) - } - useEffect(() => { - getData() - }, []); - return ( - - {(artistRequestData != null && Object.keys(artistRequestData).length>0) ? ( - (artistRequestData.map((request) => { - let formattedTime = ""; - if (artistRequestData) { - const date = new Date(request["requestDate"]); - formattedTime = date.toLocaleTimeString('en-US', { - month: 'long', - day: '2-digit', - year: 'numeric', - hour12: true, - hour: '2-digit', - minute: '2-digit' - }); // Example format +import dayjs from 'dayjs'; +import { DownloadBox, Magnify, StarOutline } from 'mdi-material-ui'; +import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, FormControl, InputLabel, Box } from '@mui/material'; +import { Grid } from '@mui/material'; +import { useRouter } from 'next/router'; +import { request } from 'http'; +import { useMediaQuery } from '@mui/material'; + + +export default function AdminRequests() { + const isSmallScreen = useMediaQuery(theme => theme.breakpoints.down('sm')); // Check if the screen size is small + const router = useRouter(); + let columns = []; + if(isSmallScreen){ + columns = [ + { field: 'id', headerName: '', flex: 0.05, sortable: false, filterable: false}, + { field: 'message', headerName: 'Message', flex: 0.2, sortable: false, filterable: false}, + { field: 'actions', headerName: '', flex: 0.15, sortable: false, filterable: false, renderCell: (params) => { + const handleAccept = async () => { + var response = await fetch("/api/admin/requests/"+params.row.userId, {method:"PUT"}) + if(response.ok){ + var data = await response.json(); + router.reload(); + } + else{ + alert("Failed to accept request.") + } + } + const handleDeny = async () => { + var response = await fetch("/api/admin/requests/"+params.row.userId, {method:"DELETE"}) + if(response.ok){ + var data = await response.json(); + router.reload(); + } + else{ + alert("Failed to deny request.") + } + } + if(params.row.accepted){ + return <> + + router.push("/dashboard/admin/requests/"+params.row.id)} color="info"> + + } + else{ + + return ( + <> + + + + ) + } + }} + ]; + } + else{ + columns = [ + { field: 'id', headerName: '', flex: 0.05, sortable: false, filterable: false}, + { field: 'userId', headerName: 'User ID', flex: 0.25, sortable: false, filterable: false}, + { field: 'message', headerName: 'Message', flex: 0.5, sortable: false, filterable: false}, + { field: 'requestDate', headerName: 'Request Date', flex: 0.1, sortable: false, filterable: false, type: 'date', valueGetter: (params) => { return new Date(params.row.requestDate); }}, + { field: 'accepted', headerName:'Accepted', flex: 0.15, sortable: false, filterable: false, renderCell: (params) => { + return (params.row.accepted ? } label="Accepted" variant="outlined" color="success" /> : } label="Pending" variant="outlined" color="info" />) + }}, + { field: 'actions', headerName: '', flex: 0.15, sortable: false, filterable: false, renderCell: (params) => { + const handleAccept = async () => { + var response = await fetch("/api/admin/requests/"+params.row.userId, {method:"PUT"}) + if(response.ok){ + var data = await response.json(); + router.reload(); + } + else{ + alert("Failed to accept request.") + } + } + const handleDeny = async () => { + var response = await fetch("/api/admin/requests/"+params.row.userId, {method:"DELETE"}) + if(response.ok){ + var data = await response.json(); + router.reload(); + } + else{ + alert("Failed to deny request.") + } + } + if(params.row.accepted){ + return <> + router.push("/dashboard/admin/requests/"+params.row.id)} color="info"> + router.push("/dashboard/admin/users/"+params.row.id)} color="info"> + + } + else{ + + return ( + <> + router.push("/dashboard/admin/requests/"+params.row.id)} color="info"> + + + + ) + } + }} + ]; + } + const [isLoading, setIsLoading] = React.useState(true); + const [requestCount, setRequestCount] = React.useState(null); + const [requestData, setRequestData] = React.useState({}); + const [paginationModel, setPaginationModel] = React.useState({ + page: 0, + pageSize: 15, + }); + + + const getRequests = async () => { + setIsLoading(true); + const response = await fetch('/api/admin/requests', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }), + }); + const data = await response.json(); + setRequestData(data); + setIsLoading(false); } - return ( - - ) - } - )) - ):(No requests)} - - ); -}; + const getRequestsCount = async () => { + const response = await fetch('/api/admin/requests/count', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }) + }); + const data = await response.json(); + setRequestCount(data); + setRowCountState((prevRowCountState) => + data !== undefined + ? data + : prevRowCountState, + ); + return data; + } -// Protected route, checking user authentication client-side.(CSR) -export default withPageAuthRequired(ArtistRequests); + // Some API clients return undefined while loading + // Following lines are here to prevent `rowCountState` from being undefined during the loading + const [rowCountState, setRowCountState] = React.useState(0); + React.useEffect(() => { + getRequests(); + getRequestsCount(); + }, [requestCount, setRowCountState,paginationModel]); + + return ( + +
+ + + +
+ ); +} \ No newline at end of file diff --git a/pages/dashboard/admin/requests/[requestId].tsx b/pages/dashboard/admin/requests/[requestId].tsx new file mode 100644 index 0000000..1a2f282 --- /dev/null +++ b/pages/dashboard/admin/requests/[requestId].tsx @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { useState, useEffect } from 'react'; +import { useRouter } from 'next/router'; +import { withPageAuthRequired } from '@auth0/nextjs-auth0/client' + +const AdminRequest = () => { + const router = useRouter(); + + const getData = async () => { + if(router.query.artistId!=null){ + + } + } + + + useEffect(() => { + getData() + }, [router.query.artistId]); + + return (<> + + ); +}; + +// Protected route, checking user authentication client-side.(CSR) +export default withPageAuthRequired(AdminRequest); + + diff --git a/pages/dashboard/admin/users.tsx b/pages/dashboard/admin/users.tsx new file mode 100644 index 0000000..6a6885c --- /dev/null +++ b/pages/dashboard/admin/users.tsx @@ -0,0 +1,147 @@ +import * as React from 'react'; +import { DataGrid } from '@mui/x-data-grid'; +import { GridColDef } from '@mui/x-data-grid'; +import TextField from '@mui/material/TextField'; +import { Button, Stack, Typography } from '@mui/material'; +import CurrencyTextField from '@lupus-ai/mui-currency-textfield'; +import { DateField } from '@mui/x-date-pickers/DateField'; +import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; +import Chip from '@mui/material/Chip'; +import {Block, Check, Close, Download, OpenInFull, OpenInNew, Refresh, Star, Upload } from '@mui/icons-material'; +import PriceCheckIcon from '@mui/icons-material/PriceCheck'; +import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn'; +import AssignmentLateIcon from '@mui/icons-material/AssignmentLate'; +import ShoppingCartCheckoutIcon from '@mui/icons-material/ShoppingCartCheckout'; +import { IconButton } from '@mui/material'; +import Tooltip from '@mui/material/Tooltip'; +import { Card, CardContent } from '@mui/material'; +import Rating from '@mui/material/Rating'; + + +import dayjs from 'dayjs'; +import { DownloadBox, Magnify, StarOutline } from 'mdi-material-ui'; +import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, FormControl, InputLabel, Box } from '@mui/material'; +import { Grid } from '@mui/material'; +import { useRouter } from 'next/router'; +import { request } from 'http'; +import { useMediaQuery } from '@mui/material'; + + +export default function AdminUsers() { + const isSmallScreen = useMediaQuery(theme => theme.breakpoints.down('sm')); // Check if the screen size is small + const router = useRouter(); + let columns = []; + if(isSmallScreen){ + columns = [ + { field: 'id', headerName: 'User ID', flex: 0.95, sortable: false, filterable: false}, + { field: "actions", headerName: "Actions", flex: 0.05, sortable: false, filterable: false, renderCell: (params) => { + return router.push("/dashboard/admin/users/"+params.row.id)}> + }} + ]; + } + else{ + columns = [ + { field: 'id', headerName: 'User ID', flex: 0.2, sortable: false, filterable: false}, + { field: 'displayName', headerName: 'Display Name', flex: 0.15, sortable: false, filterable: false}, + { field: 'email', headerName: 'Email', flex: 0.2, sortable: false, filterable: false}, + { field: "requestCount", headerName: "# of Requests", flex: 0.1, sortable: false, filterable: false}, + { field: "reviewCount", headerName: "# of Reviews", flex: 0.1, sortable: false, filterable: false}, + { field: "amountSpent", headerName: "Amount Spent", flex: 0.1, sortable: false, filterable: false}, + { field: 'status', headerName: 'Status', flex: 0.1, sortable: false, filterable: false, renderCell: (params) =>{ + if(params.row.banned){ + return } label="Banned" variant="outlined" color="error" /> + } + else if(params.row.suspended){ + return } label="Suspended" variant="outlined" color="error" /> + } + else{ + return } label="Active" variant="outlined" color="success" /> + } + }}, + { field: "actions", headerName: "", flex: 0.05, sortable: false, filterable: false, renderCell: (params) => { + return router.push("/dashboard/admin/users/"+params.row.id)}> + }} + ]; + } + const [isLoading, setIsLoading] = React.useState(true); + const [requestCount, setRequestCount] = React.useState(null); + const [requestData, setRequestData] = React.useState({}); + const [paginationModel, setPaginationModel] = React.useState({ + page: 0, + pageSize: 15, + }); + + + const getRequests = async () => { + setIsLoading(true); + const response = await fetch('/api/admin/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }), + }); + const data = await response.json(); + setRequestData(data); + setIsLoading(false); + } + const getRequestsCount = async () => { + const response = await fetch('/api/admin/users/count', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + completed: true, // Example query parameter + declined: true, // Example query parameter + accepted: true, // Example query parameter + paid: true, // Example query parameter + offset: paginationModel.page*paginationModel.pageSize, // Example query parameter + pageSize: paginationModel.pageSize + }) + }); + const data = await response.json(); + setRequestCount(data); + setRowCountState((prevRowCountState) => + data !== undefined + ? data + : prevRowCountState, + ); + return data; + } + + // Some API clients return undefined while loading + // Following lines are here to prevent `rowCountState` from being undefined during the loading + const [rowCountState, setRowCountState] = React.useState(0); + React.useEffect(() => { + getRequests(); + getRequestsCount(); + }, [requestCount, setRowCountState,paginationModel]); + + return ( + +
+ + + + +
+ ); +} \ No newline at end of file diff --git a/pages/dashboard/admin/users/[userId].tsx b/pages/dashboard/admin/users/[userId].tsx new file mode 100644 index 0000000..925c63f --- /dev/null +++ b/pages/dashboard/admin/users/[userId].tsx @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { useState, useEffect } from 'react'; +import { useRouter } from 'next/router'; +import { withPageAuthRequired } from '@auth0/nextjs-auth0/client' + +const AdminUser = () => { + const router = useRouter(); + + const getData = async () => { + if(router.query.artistId!=null){ + + } + } + + + useEffect(() => { + getData() + }, [router.query.artistId]); + + return (<> + + ); +}; + +// Protected route, checking user authentication client-side.(CSR) +export default withPageAuthRequired(AdminUser); + + diff --git a/pages/form-layouts/index.tsx b/pages/form-layouts/index.tsx deleted file mode 100644 index 980ed9a..0000000 --- a/pages/form-layouts/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -// ** MUI Imports -import Grid from '@mui/material/Grid' - -// ** Styled Component -import DatePickerWrapper from '../../core/styles/libs/react-datepicker' - -// ** Demo Components Imports -import FormLayoutsBasic from '../../views/form-layouts/FormLayoutsBasic' -import FormLayoutsIcons from '../../views/form-layouts/FormLayoutsIcons' -import FormLayoutsSeparator from '../../views/form-layouts/FormLayoutsSeparator' -import FormLayoutsAlignment from '../../views/form-layouts/FormLayoutsAlignment' - -// ** Third Party Styles Imports -import 'react-datepicker/dist/react-datepicker.css' - -const FormLayouts = () => { - return ( - - - - - - - - - - - - - - - - - ) -} - -export default FormLayouts diff --git a/pages/icons/index.tsx b/pages/icons/index.tsx deleted file mode 100644 index d5358aa..0000000 --- a/pages/icons/index.tsx +++ /dev/null @@ -1,164 +0,0 @@ -// ** MUI Imports -import Grid from '@mui/material/Grid' -import Card from '@mui/material/Card' -import Link from '@mui/material/Link' -import Button from '@mui/material/Button' -import Tooltip from '@mui/material/Tooltip' -import Typography from '@mui/material/Typography' -import CardContent from '@mui/material/CardContent' - -/** - ** Icons Imports: - * ! You need to import all the icons which come from the API or from your server and then add these icons in 'icons' variable. - * ! If you need all the icons from the library, use "import * as Icon from 'mdi-material-ui'" - * */ -import Abacus from 'mdi-material-ui/Abacus' -import Account from 'mdi-material-ui/Account' -import AbTesting from 'mdi-material-ui/AbTesting' -import AccountBox from 'mdi-material-ui/AccountBox' -import AccountCog from 'mdi-material-ui/AccountCog' -import AbjadArabic from 'mdi-material-ui/AbjadArabic' -import AbjadHebrew from 'mdi-material-ui/AbjadHebrew' -import AbugidaThai from 'mdi-material-ui/AbugidaThai' -import AccessPoint from 'mdi-material-ui/AccessPoint' -import AccountCash from 'mdi-material-ui/AccountCash' -import AccountEdit from 'mdi-material-ui/AccountEdit' -import AccountAlert from 'mdi-material-ui/AccountAlert' -import AccountCheck from 'mdi-material-ui/AccountCheck' -import AccountChild from 'mdi-material-ui/AccountChild' -import AccountClock from 'mdi-material-ui/AccountClock' -import AccountGroup from 'mdi-material-ui/AccountGroup' -import AccountCancel from 'mdi-material-ui/AccountCancel' -import AccountCircle from 'mdi-material-ui/AccountCircle' -import AccessPointOff from 'mdi-material-ui/AccessPointOff' -import AccountConvert from 'mdi-material-ui/AccountConvert' -import AccountDetails from 'mdi-material-ui/AccountDetails' -import AccessPointPlus from 'mdi-material-ui/AccessPointPlus' -import AccessPointCheck from 'mdi-material-ui/AccessPointCheck' -import AccessPointMinus from 'mdi-material-ui/AccessPointMinus' -import AccountArrowLeft from 'mdi-material-ui/AccountArrowLeft' -import AccountCowboyHat from 'mdi-material-ui/AccountCowboyHat' -import AbugidaDevanagari from 'mdi-material-ui/AbugidaDevanagari' -import AccessPointRemove from 'mdi-material-ui/AccessPointRemove' -import AccountArrowRight from 'mdi-material-ui/AccountArrowRight' -import AccountBoxOutline from 'mdi-material-ui/AccountBoxOutline' -import AccountCogOutline from 'mdi-material-ui/AccountCogOutline' -import AccessPointNetwork from 'mdi-material-ui/AccessPointNetwork' -import AccountBoxMultiple from 'mdi-material-ui/AccountBoxMultiple' -import AccountCashOutline from 'mdi-material-ui/AccountCashOutline' -import AccountChildCircle from 'mdi-material-ui/AccountChildCircle' -import AccountEditOutline from 'mdi-material-ui/AccountEditOutline' -import AccountAlertOutline from 'mdi-material-ui/AccountAlertOutline' -import AccountCheckOutline from 'mdi-material-ui/AccountCheckOutline' -import AccountChildOutline from 'mdi-material-ui/AccountChildOutline' -import AccountClockOutline from 'mdi-material-ui/AccountClockOutline' -import AccountCancelOutline from 'mdi-material-ui/AccountCancelOutline' -import AccountCircleOutline from 'mdi-material-ui/AccountCircleOutline' -import AccessPointNetworkOff from 'mdi-material-ui/AccessPointNetworkOff' -import AccountConvertOutline from 'mdi-material-ui/AccountConvertOutline' -import AccountDetailsOutline from 'mdi-material-ui/AccountDetailsOutline' -import AccountArrowLeftOutline from 'mdi-material-ui/AccountArrowLeftOutline' -import AccountArrowRightOutline from 'mdi-material-ui/AccountArrowRightOutline' -import AccountBoxMultipleOutline from 'mdi-material-ui/AccountBoxMultipleOutline' - -const icons = { - Abacus, - Account, - AbTesting, - AccountBox, - AccountCog, - AbjadArabic, - AbjadHebrew, - AbugidaThai, - AccessPoint, - AccountCash, - AccountEdit, - AccountAlert, - AccountCheck, - AccountChild, - AccountClock, - AccountGroup, - AccountCancel, - AccountCircle, - AccessPointOff, - AccountConvert, - AccountDetails, - AccessPointPlus, - AccessPointCheck, - AccessPointMinus, - AccountArrowLeft, - AccountCowboyHat, - AbugidaDevanagari, - AccessPointRemove, - AccountArrowRight, - AccountBoxOutline, - AccountCogOutline, - AccessPointNetwork, - AccountBoxMultiple, - AccountCashOutline, - AccountChildCircle, - AccountEditOutline, - AccountAlertOutline, - AccountCheckOutline, - AccountChildOutline, - AccountClockOutline, - AccountCancelOutline, - AccountCircleOutline, - AccessPointNetworkOff, - AccountConvertOutline, - AccountDetailsOutline, - AccountArrowLeftOutline, - AccountArrowRightOutline, - AccountBoxMultipleOutline -} - -const Icons = () => { - const renderIconGrids = () => { - return Object.keys(icons).map(key => { - const IconTag = icons[key as keyof typeof icons] - - return ( - - - - - - - - - - ) - }) - } - - return ( - - - - - Material Design Icons - - - Material Design Icons from the Community - - - - {renderIconGrids()} - - - - - - - ) -} - -export default Icons diff --git a/pages/pages/error/index.tsx b/pages/pages/error/index.tsx deleted file mode 100644 index 6a43068..0000000 --- a/pages/pages/error/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -// ** React Imports -import { ReactNode } from 'react' - -// ** Layout Import -import BlankLayout from '../core/layouts/BlankLayout' - -// ** Component Import -import Error404 from '../pages/404' - -const ErrorPage = () => - -ErrorPage.getLayout = (page: ReactNode) => {page} - -export default ErrorPage diff --git a/pages/pages/login/index.tsx b/pages/pages/login/index.tsx deleted file mode 100644 index a9d7065..0000000 --- a/pages/pages/login/index.tsx +++ /dev/null @@ -1,257 +0,0 @@ -// ** React Imports -import { ChangeEvent, MouseEvent, ReactNode, useState } from 'react' - -// ** Next Imports -import Link from 'next/link' -import { useRouter } from 'next/router' - -// ** MUI Components -import Box from '@mui/material/Box' -import Button from '@mui/material/Button' -import Divider from '@mui/material/Divider' -import Checkbox from '@mui/material/Checkbox' -import TextField from '@mui/material/TextField' -import InputLabel from '@mui/material/InputLabel' -import Typography from '@mui/material/Typography' -import IconButton from '@mui/material/IconButton' -import CardContent from '@mui/material/CardContent' -import FormControl from '@mui/material/FormControl' -import OutlinedInput from '@mui/material/OutlinedInput' -import { styled, useTheme } from '@mui/material/styles' -import MuiCard, { CardProps } from '@mui/material/Card' -import InputAdornment from '@mui/material/InputAdornment' -import MuiFormControlLabel, { FormControlLabelProps } from '@mui/material/FormControlLabel' - -// ** Icons Imports -import Google from 'mdi-material-ui/Google' -import Github from 'mdi-material-ui/Github' -import Twitter from 'mdi-material-ui/Twitter' -import Facebook from 'mdi-material-ui/Facebook' -import EyeOutline from 'mdi-material-ui/EyeOutline' -import EyeOffOutline from 'mdi-material-ui/EyeOffOutline' - -// ** Configs -import themeConfig from '../configs/themeConfig' - -// ** Layout Import -import BlankLayout from '../core/layouts/BlankLayout' - -// ** Demo Imports -import FooterIllustrationsV1 from '../views/pages/auth/FooterIllustration' - -interface State { - password: string - showPassword: boolean -} - -// ** Styled Components -const Card = styled(MuiCard)(({ theme }) => ({ - [theme.breakpoints.up('sm')]: { width: '28rem' } -})) - -const LinkStyled = styled('a')(({ theme }) => ({ - fontSize: '0.875rem', - textDecoration: 'none', - color: theme.palette.primary.main -})) - -const FormControlLabel = styled(MuiFormControlLabel)(({ theme }) => ({ - '& .MuiFormControlLabel-label': { - fontSize: '0.875rem', - color: theme.palette.text.secondary - } -})) - -const LoginPage = () => { - // ** State - const [values, setValues] = useState({ - password: '', - showPassword: false - }) - - // ** Hook - const theme = useTheme() - const router = useRouter() - - const handleChange = (prop: keyof State) => (event: ChangeEvent) => { - setValues({ ...values, [prop]: event.target.value }) - } - - const handleClickShowPassword = () => { - setValues({ ...values, showPassword: !values.showPassword }) - } - - const handleMouseDownPassword = (event: MouseEvent) => { - event.preventDefault() - } - - return ( - - - `${theme.spacing(12, 9, 7)} !important` }}> - - - - - - - - - - {themeConfig.templateName} - - - - - Welcome to {themeConfig.templateName}! 👋🏻 - - Please sign-in to your account and start the adventure - -
e.preventDefault()}> - - - Password - - - {values.showPassword ? : } - - - } - /> - - - } label='Remember Me' /> - - e.preventDefault()}>Forgot Password? - - - - - - New on our platform? - - - - Create an account - - - - or - - - ) => e.preventDefault()}> - - - - - ) => e.preventDefault()}> - - - - - ) => e.preventDefault()}> - (theme.palette.mode === 'light' ? '#272727' : theme.palette.grey[300]) }} - /> - - - - ) => e.preventDefault()}> - - - - - -
-
- -
- ) -} - -LoginPage.getLayout = (page: ReactNode) => {page} - -export default LoginPage diff --git a/pages/pages/register/index.tsx b/pages/pages/register/index.tsx deleted file mode 100644 index f049e1a..0000000 --- a/pages/pages/register/index.tsx +++ /dev/null @@ -1,255 +0,0 @@ -// ** React Imports -import { useState, Fragment, ChangeEvent, MouseEvent, ReactNode } from 'react' - -// ** Next Imports -import Link from 'next/link' - -// ** MUI Components -import Box from '@mui/material/Box' -import Button from '@mui/material/Button' -import Divider from '@mui/material/Divider' -import Checkbox from '@mui/material/Checkbox' -import TextField from '@mui/material/TextField' -import Typography from '@mui/material/Typography' -import InputLabel from '@mui/material/InputLabel' -import IconButton from '@mui/material/IconButton' -import CardContent from '@mui/material/CardContent' -import FormControl from '@mui/material/FormControl' -import OutlinedInput from '@mui/material/OutlinedInput' -import { styled, useTheme } from '@mui/material/styles' -import MuiCard, { CardProps } from '@mui/material/Card' -import InputAdornment from '@mui/material/InputAdornment' -import MuiFormControlLabel, { FormControlLabelProps } from '@mui/material/FormControlLabel' - -// ** Icons Imports -import Google from 'mdi-material-ui/Google' -import Github from 'mdi-material-ui/Github' -import Twitter from 'mdi-material-ui/Twitter' -import Facebook from 'mdi-material-ui/Facebook' -import EyeOutline from 'mdi-material-ui/EyeOutline' -import EyeOffOutline from 'mdi-material-ui/EyeOffOutline' - -// ** Configs -import themeConfig from '../configs/themeConfig' - -// ** Layout Import -import BlankLayout from '../core/layouts/BlankLayout' - -// ** Demo Imports -import FooterIllustrationsV1 from '../views/pages/auth/FooterIllustration' - -interface State { - password: string - showPassword: boolean -} - -// ** Styled Components -const Card = styled(MuiCard)(({ theme }) => ({ - [theme.breakpoints.up('sm')]: { width: '28rem' } -})) - -const LinkStyled = styled('a')(({ theme }) => ({ - fontSize: '0.875rem', - textDecoration: 'none', - color: theme.palette.primary.main -})) - -const FormControlLabel = styled(MuiFormControlLabel)(({ theme }) => ({ - marginTop: theme.spacing(1.5), - marginBottom: theme.spacing(4), - '& .MuiFormControlLabel-label': { - fontSize: '0.875rem', - color: theme.palette.text.secondary - } -})) - -const RegisterPage = () => { - // ** States - const [values, setValues] = useState({ - password: '', - showPassword: false - }) - - // ** Hook - const theme = useTheme() - - const handleChange = (prop: keyof State) => (event: ChangeEvent) => { - setValues({ ...values, [prop]: event.target.value }) - } - const handleClickShowPassword = () => { - setValues({ ...values, showPassword: !values.showPassword }) - } - const handleMouseDownPassword = (event: MouseEvent) => { - event.preventDefault() - } - - return ( - - - `${theme.spacing(12, 9, 7)} !important` }}> - - - - - - - - - - {themeConfig.templateName} - - - - - Adventure starts here 🚀 - - Make your app management easy and fun! - -
e.preventDefault()}> - - - - Password - - - {values.showPassword ? : } - - - } - /> - - } - label={ - - I agree to - - ) => e.preventDefault()}> - privacy policy & terms - - - - } - /> - - - - Already have an account? - - - - Sign in instead - - - - or - - - ) => e.preventDefault()}> - - - - - ) => e.preventDefault()}> - - - - - ) => e.preventDefault()}> - (theme.palette.mode === 'light' ? '#272727' : theme.palette.grey[300]) }} - /> - - - - ) => e.preventDefault()}> - - - - - -
-
- -
- ) -} - -RegisterPage.getLayout = (page: ReactNode) => {page} - -export default RegisterPage diff --git a/pages/tables/index.tsx b/pages/tables/index.tsx deleted file mode 100644 index 9edceb6..0000000 --- a/pages/tables/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -// ** MUI Imports -import Grid from '@mui/material/Grid' -import Link from '@mui/material/Link' -import Card from '@mui/material/Card' -import Typography from '@mui/material/Typography' -import CardHeader from '@mui/material/CardHeader' - -// ** Demo Components Imports -import TableBasic from '../views/tables/TableBasic' -import TableDense from '../views/tables/TableDense' -import TableSpanning from '../views/tables/TableSpanning' -import TableCustomized from '../views/tables/TableCustomized' -import TableCollapsible from '../views/tables/TableCollapsible' -import TableStickyHeader from '../views/tables/TableStickyHeader' - -const MUITable = () => { - return ( - - - - - MUI Tables - - - Tables display sets of data. They can be fully customized - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} - -export default MUITable diff --git a/pages/typography/index.tsx b/pages/typography/index.tsx deleted file mode 100644 index b0413d4..0000000 --- a/pages/typography/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -// ** MUI Imports -import Grid from '@mui/material/Grid' - -// ** Demo Components Imports -import TypographyTexts from '../views/typography/TypographyTexts' -import TypographyHeadings from '../views/typography/TypographyHeadings' - -const TypographyPage = () => { - return ( - - - - - - - - - ) -} - -export default TypographyPage