📱 responsiving
This commit is contained in:
parent
c0ee73db29
commit
b64d680409
@ -7,12 +7,12 @@ export const BannerView = styled.div`
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 19rem;
|
height: 20%;
|
||||||
|
|
||||||
.gradient {
|
.gradient {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 19rem;
|
height: 100%;
|
||||||
|
|
||||||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), rgba(7, 23, 100, 0.6);
|
background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), rgba(7, 23, 100, 0.6);
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
@ -20,6 +20,10 @@ export const BannerView = styled.div`
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 0 0 20px;
|
margin: 0 0 0 20px;
|
||||||
@ -34,7 +38,7 @@ export const BannerView = styled.div`
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 30px;
|
font-size: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
@ -42,7 +46,12 @@ export const BannerView = styled.div`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1008px) {
|
@media (max-width: 1008px) {
|
||||||
font-size: 170%;
|
font-size: 170%;
|
||||||
}
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|||||||
@ -20,4 +20,9 @@ export const LoginButtonView = styled.button`
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 18px;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import {
|
|||||||
|
|
||||||
import faker from 'faker'
|
import faker from 'faker'
|
||||||
import { ChartView } from './ChartView';
|
import { ChartView } from './ChartView';
|
||||||
|
import RenderIf from '../../utils/renderIf';
|
||||||
|
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
CategoryScale,
|
CategoryScale,
|
||||||
@ -25,9 +26,11 @@ ChartJS.register(
|
|||||||
|
|
||||||
interface ChartInterface {
|
interface ChartInterface {
|
||||||
title: string,
|
title: string,
|
||||||
|
data?: any,
|
||||||
|
single?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Chart({ title }: ChartInterface) {
|
export default function Chart({ title, single, data }: ChartInterface) {
|
||||||
const [ graphData, setGraphData ] = useState({
|
const [ graphData, setGraphData ] = useState({
|
||||||
labels: [],
|
labels: [],
|
||||||
datasets: [],
|
datasets: [],
|
||||||
@ -68,6 +71,12 @@ export default function Chart({ title }: ChartInterface) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ChartView>
|
<ChartView>
|
||||||
|
<RenderIf isTrue={single? true : false} >
|
||||||
|
<Bar
|
||||||
|
options={options}
|
||||||
|
data={graphData}
|
||||||
|
/>
|
||||||
|
</RenderIf>
|
||||||
<Bar
|
<Bar
|
||||||
options={options}
|
options={options}
|
||||||
data={graphData}
|
data={graphData}
|
||||||
|
|||||||
149
src/components/graph/LineChart.tsx
Normal file
149
src/components/graph/LineChart.tsx
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
import React, { useState, useEffect } from 'react'
|
||||||
|
|
||||||
|
import { Bar, Line } from 'react-chartjs-2';
|
||||||
|
// import {
|
||||||
|
// Chart as ChartJS,
|
||||||
|
// CategoryScale,
|
||||||
|
// LinearScale,
|
||||||
|
// BarElement,
|
||||||
|
// Title,
|
||||||
|
// Tooltip,
|
||||||
|
// Legend,
|
||||||
|
// PointElement,
|
||||||
|
// registerables
|
||||||
|
// } from 'chart.js'
|
||||||
|
|
||||||
|
// import Chart from 'chart.js/auto'
|
||||||
|
|
||||||
|
// import faker from 'faker'
|
||||||
|
import { ChartView } from './ChartView';
|
||||||
|
|
||||||
|
// ChartJS.register(
|
||||||
|
// CategoryScale,
|
||||||
|
// LinearScale,
|
||||||
|
// BarElement,
|
||||||
|
// Title,
|
||||||
|
// Tooltip,
|
||||||
|
// Legend,
|
||||||
|
// PointElement,
|
||||||
|
// )
|
||||||
|
|
||||||
|
import {
|
||||||
|
Chart as ChartJS,
|
||||||
|
CategoryScale,
|
||||||
|
LinearScale,
|
||||||
|
PointElement,
|
||||||
|
LineElement,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
|
Legend,
|
||||||
|
ScatterDataPoint,
|
||||||
|
} from 'chart.js';
|
||||||
|
// import { Line } from 'react-chartjs-2';
|
||||||
|
import faker from 'faker';
|
||||||
|
|
||||||
|
ChartJS.register(
|
||||||
|
CategoryScale,
|
||||||
|
LinearScale,
|
||||||
|
PointElement,
|
||||||
|
LineElement,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
|
Legend
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
interface ChartInterface {
|
||||||
|
title: string,
|
||||||
|
data: any
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function LineChart({ title, data }: ChartInterface) {
|
||||||
|
// const [ graphData, setGraphData ] = useState({
|
||||||
|
// labels: [],
|
||||||
|
// datasets: [],
|
||||||
|
// })
|
||||||
|
// const options = {
|
||||||
|
// responsive: true,
|
||||||
|
// plugins: {
|
||||||
|
// legend: {
|
||||||
|
// position: 'bottom' as const,
|
||||||
|
// },
|
||||||
|
// title: {
|
||||||
|
// display: true,
|
||||||
|
// text: title,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const labels = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez'];
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// setGraphData({
|
||||||
|
// labels,
|
||||||
|
// datasets: [
|
||||||
|
// {
|
||||||
|
// label: '2020',
|
||||||
|
// data: labels.map(() => faker.datatype.number({ min: 0, max: 1200 })),
|
||||||
|
// backgroundColor: '#C2D5FB',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '2021',
|
||||||
|
// data: labels.map(() => faker.datatype.number({ min: 0, max: 1200 })),
|
||||||
|
// backgroundColor: '#255488',
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// })
|
||||||
|
// }, [])
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
responsive: true,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: 'top' as const,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Chart.js Line Chart',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const labels = ['0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8',];
|
||||||
|
|
||||||
|
// const data = {
|
||||||
|
// labels,
|
||||||
|
// datasets: [
|
||||||
|
// // {
|
||||||
|
// // label: 'Dataset 1',
|
||||||
|
// // data: [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9],
|
||||||
|
// // borderColor: 'rgb(53, 162, 235)',
|
||||||
|
// // backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // label: 'Dataset 2',
|
||||||
|
// // data: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],
|
||||||
|
// // borderColor: 'rgb(255, 114, 32)',
|
||||||
|
// // backgroundColor: 'rgba(255, 145, 0, 0.5)',
|
||||||
|
// // },
|
||||||
|
// {
|
||||||
|
// label: 'Dataset 3',
|
||||||
|
// data: [1, 2, 3, 5, 7, 8, 9, 8, 9, 7, 8, 6, 4, 3, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 9, 10, 11, 12, 12, 14, 15, 17, 20, 21, 18, 15, 14, 12, 11, 10, 8, 6, 7, 8, 7, 9],
|
||||||
|
// borderColor: 'rgb(109, 109, 109)',
|
||||||
|
// backgroundColor: 'rgba(90, 90, 90, 0.5)',
|
||||||
|
// },
|
||||||
|
// // {
|
||||||
|
// // label: 'Dataset4',
|
||||||
|
// // data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||||
|
// // borderColor: 'rgb(255, 166, 0)',
|
||||||
|
// // backgroundColor: 'rgba(255, 187, 0, 0.5)',
|
||||||
|
// // },
|
||||||
|
// ],
|
||||||
|
// };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ChartView>
|
||||||
|
<Line options={options} data={data} />
|
||||||
|
</ChartView>
|
||||||
|
)
|
||||||
|
}
|
||||||
56
src/components/graph/SingleBar.tsx
Normal file
56
src/components/graph/SingleBar.tsx
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import {
|
||||||
|
Chart as ChartJS,
|
||||||
|
CategoryScale,
|
||||||
|
LinearScale,
|
||||||
|
BarElement,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
|
Legend,
|
||||||
|
} from 'chart.js';
|
||||||
|
import { Bar } from 'react-chartjs-2';
|
||||||
|
import faker from 'faker';
|
||||||
|
import { ChartView } from './ChartView';
|
||||||
|
|
||||||
|
ChartJS.register(
|
||||||
|
CategoryScale,
|
||||||
|
LinearScale,
|
||||||
|
BarElement,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
|
Legend
|
||||||
|
);
|
||||||
|
|
||||||
|
export const options = {
|
||||||
|
responsive: true,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: 'top' as const,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Chart.js Bar Chart',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const labels = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez'];
|
||||||
|
|
||||||
|
export const data = {
|
||||||
|
labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Dataset 2',
|
||||||
|
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
|
||||||
|
backgroundColor: '#255488',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export function SingleBar() {
|
||||||
|
return (
|
||||||
|
<ChartView>
|
||||||
|
<Bar options={options} data={data} />
|
||||||
|
</ChartView>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -7,15 +7,20 @@ import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|||||||
import { ChartCardView } from './ChartCardView';
|
import { ChartCardView } from './ChartCardView';
|
||||||
import Chart from '../Chart';
|
import Chart from '../Chart';
|
||||||
import ButtonGroup from '../../buttonGroup/ButtonGroup';
|
import ButtonGroup from '../../buttonGroup/ButtonGroup';
|
||||||
|
import RenderIf from '../../../utils/renderIf';
|
||||||
|
import LineChart from '../LineChart';
|
||||||
|
import { SingleBar } from '../SingleBar';
|
||||||
|
|
||||||
interface ChartCardInterface {
|
interface ChartCardInterface {
|
||||||
title: string,
|
title: string,
|
||||||
subtitle: string,
|
subtitle: string,
|
||||||
consumption?: number,
|
consumption?: number,
|
||||||
className?: string
|
className?: string,
|
||||||
|
line?: boolean | undefined,
|
||||||
|
singleBar?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ChartCard({ title, subtitle, consumption, className }: ChartCardInterface) {
|
export default function ChartCard({ title, subtitle, consumption, className, line, singleBar }: ChartCardInterface) {
|
||||||
const [timeCourse, setTimeCourse] = React.useState<string | null>('left');
|
const [timeCourse, setTimeCourse] = React.useState<string | null>('left');
|
||||||
|
|
||||||
const handleAlignment = (
|
const handleAlignment = (
|
||||||
@ -25,6 +30,39 @@ export default function ChartCard({ title, subtitle, consumption, className }: C
|
|||||||
setTimeCourse(newAlignment);
|
setTimeCourse(newAlignment);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const labels = ['0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8',];
|
||||||
|
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Dataset 1',
|
||||||
|
data: [1, 2, 3, 5, 7, 8, 9, 8, 9, 7, 8, 6, 4, 3, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 9, 10, 11, 12, 12, 14, 15, 17, 20, 21, 18, 15, 14, 12, 11, 10, 8, 6, 7, 8, 7, 9],
|
||||||
|
borderColor: 'rgb(53, 162, 235)',
|
||||||
|
backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: 'Dataset 2',
|
||||||
|
// data: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],
|
||||||
|
// borderColor: 'rgb(255, 114, 32)',
|
||||||
|
// backgroundColor: 'rgba(255, 145, 0, 0.5)',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'Dataset 3',
|
||||||
|
// data: [1, 2, 3, 5, 7, 8, 9, 8, 9, 7, 8, 6, 4, 3, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 9, 10, 11, 12, 12, 14, 15, 17, 20, 21, 18, 15, 14, 12, 11, 10, 8, 6, 7, 8, 7, 9],
|
||||||
|
// borderColor: 'rgb(109, 109, 109)',
|
||||||
|
// backgroundColor: 'rgba(90, 90, 90, 0.5)',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'Dataset4',
|
||||||
|
// data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||||
|
// borderColor: 'rgb(255, 166, 0)',
|
||||||
|
// backgroundColor: 'rgba(255, 187, 0, 0.5)',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChartCardView className={className} >
|
<ChartCardView className={className} >
|
||||||
<div className='content' >
|
<div className='content' >
|
||||||
@ -49,7 +87,18 @@ export default function ChartCard({ title, subtitle, consumption, className }: C
|
|||||||
<></>
|
<></>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
<RenderIf isTrue={line? true : false}>
|
||||||
|
<LineChart title='' data={data}/>
|
||||||
|
</RenderIf>
|
||||||
|
<RenderIf isTrue={line? false : true}>
|
||||||
|
<RenderIf isTrue={singleBar? true : false}>
|
||||||
|
<SingleBar/>
|
||||||
|
</RenderIf>
|
||||||
|
|
||||||
|
<RenderIf isTrue={singleBar? false : true}>
|
||||||
<Chart title='' />
|
<Chart title='' />
|
||||||
|
</RenderIf>
|
||||||
|
</RenderIf>
|
||||||
</ChartCardView>
|
</ChartCardView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,4 +104,13 @@ export const ChartCardView = styled.article`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 13px;
|
||||||
|
min-height: 28rem;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
max-width: 4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export default function MapCard({ title, subtitle, statistic, imgSource }: MapCa
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MapCardView>
|
<MapCardView>
|
||||||
<Image src={imgSource} width={110} height={110}/>
|
<Image src={imgSource} width={90} height={90}/>
|
||||||
<div>
|
<div>
|
||||||
<h4>{title}</h4>
|
<h4>{title}</h4>
|
||||||
<span>{subtitle}</span>
|
<span>{subtitle}</span>
|
||||||
@ -22,7 +22,7 @@ export default function MapCard({ title, subtitle, statistic, imgSource }: MapCa
|
|||||||
{
|
{
|
||||||
statistic?
|
statistic?
|
||||||
<>
|
<>
|
||||||
<Image src="/graphLineIcon.svg" width={20} height={20} />
|
<Image src="/graphLineIcon.svg" width={14} height={14} />
|
||||||
<p>{statistic}</p>
|
<p>{statistic}</p>
|
||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
|
|||||||
@ -29,4 +29,9 @@ export const MapCardView = styled.figure`
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
margin-right: 0px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -24,4 +24,8 @@ p {
|
|||||||
|
|
||||||
color: #969BA0;
|
color: #969BA0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export default function Sidebar() {
|
|||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<Link href='/dashboard'><li className={router.pathname=='/dashboard'? 'actualPath' : null} ><Image src='/assets/sidebar/dashboardIcon.svg' width={25} height={25} />{'Visão Geral'}</li></Link>
|
<Link href='/dashboard'><li className={router.pathname=='/dashboard'? 'actualPath' : null} ><Image src='/assets/sidebar/dashboardIcon.svg' width={25} height={25} />{'Visão Geral'}</li></Link>
|
||||||
<li onClick={() => setEconomiaDrawer(!economiaDrawer)} className={router.pathname=='/grossSavings' || router.pathname=='/accumulatedSavings' || router.pathname=='/estimatedCost' || router.pathname=='/costIndicator' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Economia'}</li>
|
<li onClick={() => setEconomiaDrawer(!economiaDrawer)} className={router.pathname=='/grossSavings' || router.pathname=='/accumulatedSavings' || router.pathname=='/estimatedCost' || router.pathname=='/costIndicator' ? 'actualPath' : null } ><Image src='/assets/sidebar/economyIcon.svg' width={25} height={25} />{'Economia >'}</li>
|
||||||
<div className='economiaDrawer drawer' >
|
<div className='economiaDrawer drawer' >
|
||||||
<Link href='/grossSavings'><li>Economia Bruta</li></Link>
|
<Link href='/grossSavings'><li>Economia Bruta</li></Link>
|
||||||
<Link href='/accumulatedSavings'><li>Economia Acumulada</li></Link>
|
<Link href='/accumulatedSavings'><li>Economia Acumulada</li></Link>
|
||||||
|
|||||||
@ -180,4 +180,13 @@ export const SidebarView = styled.nav<SidebarViewInterface>`
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 14px;
|
||||||
|
ul {
|
||||||
|
li {
|
||||||
|
height: 3.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import InputAdornment from '@mui/material/InputAdornment';
|
|||||||
import FormHelperText from '@mui/material/FormHelperText';
|
import FormHelperText from '@mui/material/FormHelperText';
|
||||||
import FormControl from '@mui/material/FormControl';
|
import FormControl from '@mui/material/FormControl';
|
||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
|
import LineChart from '../components/graph/LineChart'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +43,8 @@ export default function areaTest() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl sx={{ m: 1, width: '25ch' }} variant="outlined">
|
<>
|
||||||
|
{/* <FormControl sx={{ m: 1, width: '25ch' }} variant="outlined">
|
||||||
<InputLabel htmlFor="outlined-ad
|
<InputLabel htmlFor="outlined-ad
|
||||||
ornment-password">Password</InputLabel>
|
ornment-password">Password</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
@ -64,7 +66,8 @@ export default function areaTest() {
|
|||||||
}
|
}
|
||||||
label="Password"
|
label="Password"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl> */}
|
||||||
|
{/* <LineChart title='title' /> */}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import PageTitle from '../components/pageTitle/PageTitle'
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardView>
|
<DashboardView>
|
||||||
<Header name='' />
|
<Header name='' />
|
||||||
@ -24,9 +25,9 @@ export default function Dashboard() {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<section className='dashboard'>
|
<section className='dashboard'>
|
||||||
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' consumption={25} />
|
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' consumption={25} line />
|
||||||
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' />
|
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' />
|
||||||
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' className='footerGraph' />
|
<GraphCard title='Consumo' subtitle='Gráfico de Consumo' className='footerGraph' singleBar />
|
||||||
</section>
|
</section>
|
||||||
</DashboardView>
|
</DashboardView>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { useRouter } from 'next/router'
|
|||||||
import LoginButton from '../components/buttons/loginButton/LoginButton';
|
import LoginButton from '../components/buttons/loginButton/LoginButton';
|
||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
import { ForgotPasswordContainer, ForgotPasswordView } from '../styles/layouts/forgotPassword/ForgotPasswordView';
|
import { ForgotPasswordContainer, ForgotPasswordView } from '../styles/layouts/forgotPassword/ForgotPasswordView';
|
||||||
|
import RenderIf from '../utils/renderIf';
|
||||||
|
import Alert from '@mui/material/Alert';
|
||||||
|
|
||||||
export default function ForgotPassword() {
|
export default function ForgotPassword() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -12,15 +14,34 @@ export default function ForgotPassword() {
|
|||||||
|
|
||||||
const [password, setPassword] = useState<string>('')
|
const [password, setPassword] = useState<string>('')
|
||||||
const [confirmPassword, setConfirmPassword] = useState<string>('')
|
const [confirmPassword, setConfirmPassword] = useState<string>('')
|
||||||
|
const [same, setSame] = useState<boolean>(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPassword('')
|
setPassword('')
|
||||||
setConfirmPassword('')
|
setConfirmPassword('')
|
||||||
|
setSame(false)
|
||||||
}, [rota])
|
}, [rota])
|
||||||
|
|
||||||
|
function handleChangePassword() {
|
||||||
|
if (same) {
|
||||||
|
router.push('/')
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (password == confirmPassword && password != '') {
|
||||||
|
setSame(false)
|
||||||
|
} else {
|
||||||
|
setSame(true)
|
||||||
|
}
|
||||||
|
}, [password])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ForgotPasswordView auth={rota} >
|
<ForgotPasswordView auth={rota} >
|
||||||
<Image src='/assets/marca1.svg' width={500} height={500} />
|
<Image src='/assets/marca1.svg' width={350} height={350} />
|
||||||
<ForgotPasswordContainer>
|
<ForgotPasswordContainer>
|
||||||
<h1>Bem-Vindo</h1>
|
<h1>Bem-Vindo</h1>
|
||||||
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
||||||
@ -28,7 +49,7 @@ export default function ForgotPassword() {
|
|||||||
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }} value={password} label="Senha" onChange={value => setPassword(value.target.value)} variant="outlined"/>
|
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }} value={password} label="Senha" onChange={value => setPassword(value.target.value)} variant="outlined"/>
|
||||||
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }} value={confirmPassword} label="Confirmar Senha" onChange={value => setConfirmPassword(value.target.value)} variant="outlined"/>
|
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }} value={confirmPassword} label="Confirmar Senha" onChange={value => setConfirmPassword(value.target.value)} variant="outlined"/>
|
||||||
|
|
||||||
<LoginButton title='Redefinir Senha' onClick={() => router.push('/')} />
|
<LoginButton title='Redefinir Senha' onClick={() => handleChangePassword()} />
|
||||||
|
|
||||||
<fieldset className="line">
|
<fieldset className="line">
|
||||||
<legend className="text">Ou</legend>
|
<legend className="text">Ou</legend>
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export default function Home() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<LoginView auth={rota} >
|
<LoginView auth={rota} >
|
||||||
<Image src='/assets/marca1.svg' width={500} height={500} />
|
<Image src='/assets/marca1.svg' width={350} height={350} />
|
||||||
<LoginContainer>
|
<LoginContainer>
|
||||||
<h1>Bem-Vindo</h1>
|
<h1>Bem-Vindo</h1>
|
||||||
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
|||||||
import Chart from '../../components/graph/Chart';
|
import Chart from '../../components/graph/Chart';
|
||||||
import PageTitle from '../../components/pageTitle/PageTitle';
|
import PageTitle from '../../components/pageTitle/PageTitle';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import LineChart from '../../components/graph/LineChart';
|
||||||
|
|
||||||
export default function region() {
|
export default function region() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -28,6 +29,39 @@ export default function region() {
|
|||||||
console.log(page)
|
console.log(page)
|
||||||
}, [page])
|
}, [page])
|
||||||
|
|
||||||
|
const labels = ['0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8',];
|
||||||
|
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Dataset 1',
|
||||||
|
data: [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9],
|
||||||
|
borderColor: 'rgb(53, 162, 235)',
|
||||||
|
backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Dataset 2',
|
||||||
|
data: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],
|
||||||
|
borderColor: 'rgb(255, 114, 32)',
|
||||||
|
backgroundColor: 'rgba(255, 145, 0, 0.5)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Dataset 3',
|
||||||
|
data: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
|
||||||
|
borderColor: 'rgb(109, 109, 109)',
|
||||||
|
backgroundColor: 'rgba(90, 90, 90, 0.5)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Dataset4',
|
||||||
|
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||||
|
borderColor: 'rgb(255, 166, 0)',
|
||||||
|
backgroundColor: 'rgba(255, 187, 0, 0.5)',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main style={{
|
<main style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@ -208,7 +242,7 @@ export default function region() {
|
|||||||
<input type="date" data-date="" data-date-format="DD MMMM YYYY" value="2015-08-09"/>
|
<input type="date" data-date="" data-date-format="DD MMMM YYYY" value="2015-08-09"/>
|
||||||
<BasicButton title='Download (csv)' />
|
<BasicButton title='Download (csv)' />
|
||||||
</section>
|
</section>
|
||||||
<Chart title='' />
|
<LineChart title='' data={data}/>
|
||||||
</PldGraphView>
|
</PldGraphView>
|
||||||
</RenderIf>
|
</RenderIf>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export default function VerifyEmail() {
|
|||||||
function verifyConfirmationCode() {
|
function verifyConfirmationCode() {
|
||||||
if (code === '0000') {
|
if (code === '0000') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push('/')
|
router.push('/forgotPassword')
|
||||||
}, 2500);
|
}, 2500);
|
||||||
setCodeStatus(true)
|
setCodeStatus(true)
|
||||||
} else {
|
} else {
|
||||||
@ -42,7 +42,7 @@ export default function VerifyEmail() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<VerifyEmailView auth={rota} >
|
<VerifyEmailView auth={rota} >
|
||||||
<Image src='/assets/marca1.svg' width={500} height={500} />
|
<Image src='/assets/marca1.svg' width={350} height={350} />
|
||||||
<VerifyEmailContainer>
|
<VerifyEmailContainer>
|
||||||
<h1>Bem-Vindo</h1>
|
<h1>Bem-Vindo</h1>
|
||||||
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
||||||
|
|||||||
@ -75,4 +75,5 @@ export const DashboardView = styled.main`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|||||||
@ -22,6 +22,17 @@ export const ForgotPasswordView = styled.main<{auth: string}>`
|
|||||||
|
|
||||||
padding: 100px;
|
padding: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 80%;
|
||||||
|
h2 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const ForgotPasswordContainer = styled.section`
|
export const ForgotPasswordContainer = styled.section`
|
||||||
@ -98,4 +109,15 @@ export const ForgotPasswordContainer = styled.section`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 80%;
|
||||||
|
h2 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -98,4 +98,15 @@ export const VerifyEmailContainer = styled.section`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 80%;
|
||||||
|
h2 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -98,4 +98,14 @@ export const LoginContainer = styled.section`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@media (max-width: 1640px) {
|
||||||
|
font-size: 80%;
|
||||||
|
h2 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user