import { withPageAuthRequired } from "@auth0/nextjs-auth0/client"; import Grid from '@mui/material/Grid'; import Card from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; import Button from '@mui/material/Button'; import { Accordion, Typography } from "@mui/material"; import { useEffect, useState } from "react"; import Switch from '@mui/material/Switch'; import Divider from '@mui/material/Divider'; import TextField from '@mui/material/TextField'; import { MuiColorInput } from 'mui-color-input' import { AccordionSummary } from "@mui/material"; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import AccordionDetails from '@mui/material/AccordionDetails'; import Slider from '@mui/material/Slider'; import ArtistPortfolio from '../../../components/Old/artistPortfolio'; const Profile = () => { const [profileData, setSellerProfileData] = useState(null); const [backgroundColor, setBackgroundColor] = useState('rgb(126, 115, 115)'); const [headerColor, setHeaderColor] = useState('rgb(194, 187, 187)'); const [headerIsImage, setHeaderImage] = useState(false); const [headerImageUrl, setHeaderImageUrl] = useState(''); const [headerText, setHeaderText] = useState('Shop'); const [headerSize, setHeaderSize] = useState(5); const headerVariant = [ 'h6', // Size 1 'h5', // Size 2 'h4', // Size 3 'h3', // Size 4 'h2', // Size 5 'h1', // Size 6 ][headerSize - 1] || 'h6'; const [bioColor, setBioColor] = useState('rgb(186, 186, 186)'); const [bioBgColor, setBioBgColor] = useState('rgb(103, 97, 97)'); const [bioHeaderColor, setBioHeaderColor] = useState('rgb(255, 255, 255)'); const [bioHeaderIsImage, setBioHeaderImage] = useState(false); const [bioHeaderImageUrl, setBioHeaderImageUrl] = useState(''); const [bioHeaderText, setBioHeaderText] = useState('Biography'); const [bioHeaderSize, setBioHeaderSize] = useState(3); const [bioSize, setBioSize] = useState(1); const bioHeaderVariant = [ 'h6', // Size 1 'h5', // Size 2 'h4', // Size 3 'h3', // Size 4 'h2', // Size 5 'h1', // Size 6 ][bioHeaderSize - 1] || 'h6'; const bioVariant = [ 'h6', // Size 1 'h5', // Size 2 'h4', // Size 3 'h3', // Size 4 'h2', // Size 5 'h1', // Size 6 ][bioSize - 1] || 'h6'; const [portfolioBgColor, setPortfolioBgColor] = useState('rgb(78, 73, 73)'); const [portfolioColumns, setPotrfolioColumns] = useState(2); const [portfolioWoven, setPortfolioWoven] = useState(true); const [portfolioShouldScroll, setPortfolioShouldScroll] = useState(true); const [portfolioSize, setPortfolioSize] = useState(25); const getData = async () => { const profileResponse = await fetch('/api/artist/profile'); const sellerProfile = await profileResponse.json(); setSellerProfileData(sellerProfile); } useEffect(() => { getData() }, []); const handleBackgroundColorChange = (newValue) => { setBackgroundColor(newValue) } const handleHeaderTextChange = (e) => { setHeaderText(e.target.value) } const handleHeaderImageUrl = (e) => { setHeaderImageUrl(e.target.value) } const handleHeaderImageToggle = (e) => { setHeaderImage(e.target.checked) }; const handleHeaderSize = (e, newValue) => { setHeaderSize(newValue) } const handleHeaderColorChange = (newValue) => { setHeaderColor(newValue) } const handleBioHeaderTextChange = (e) => { setBioHeaderText(e.target.value) } const handleBioHeaderImageUrl = (e) => { setBioHeaderImageUrl(e.target.value) } const handleBioHeaderImageToggle = (e) => { setBioHeaderImage(e.target.checked) }; const handleBioHeaderSize = (e, newValue) => { setBioHeaderSize(newValue) } const handleBioSize = (e, newValue) => { setBioSize(newValue) } const handleBioHeaderColorChange = (newValue) => { setBioHeaderColor(newValue) } const handleBioColorChange = (newValue) => { setBioColor(newValue) } const handleBioBgColorChange = (newValue) => { setBioBgColor(newValue) } const handlePortfolioBgColor = (newValue) => { setPortfolioBgColor(newValue) } const handlePortfolioColumns = (e, newValue) => { setPotrfolioColumns(newValue) } const handlePortfolioWoven = (e) => { setPortfolioWoven(e.target.checked) }; const handlePortfolioShouldScroll = (e) => { setPortfolioShouldScroll(e.target.checked) console.log(portfolioShouldScroll) }; const handlePortfolioSize = (e, newValue) => { setPortfolioSize(newValue) } return ( Customize Your Page } aria-controls="panel1-content" > Background } aria-controls="panel1-content" > Header Text Size } aria-controls="panel1-content" > Biography Header Size Text Size } aria-controls="panel1-content" > Portfolio Masonry Layout Enabled Columns Enable Scrolling Max Size {(headerIsImage) ? ( Header Image ) : ( {headerText} )} {(bioHeaderIsImage) ? ( Header Image ) : ( {bioHeaderText} )} {(profileData ? profileData["biography"]:null)} {(portfolioShouldScroll)?( {(profileData ? ( ):null)} ):( {(profileData ? ( ):null)} )} ); }; // Protected route, checking user authentication client-side.(CSR) export default withPageAuthRequired(Profile);