maintenance input,header
This commit is contained in:
commit
2b194dc5d1
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"cSpell.language": "pt-BR,en"
|
||||
}
|
||||
@ -8,6 +8,7 @@ export const BannerView = styled.div`
|
||||
|
||||
width: 100%;
|
||||
height: 20%;
|
||||
max-height: 200px;
|
||||
|
||||
margin-bottom: 30px;
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red
|
||||
type: 'bar' as const,
|
||||
label: dataset2? dataset2 : 'Dataset 2',
|
||||
backgroundColor: (value, ctx) => {
|
||||
return hashurado? data1[value.dataIndex].dad_estimado == false? '#C2D5FB' : pattern.draw('diagonal', '#C2D5FB') : '#C2D5FB'
|
||||
return hashurado? data1[value.dataIndex]?.dad_estimado == false? '#C2D5FB' : pattern.draw('diagonal', '#C2D5FB') : '#C2D5FB'
|
||||
},
|
||||
data: data3.map(value => value.custo_cativo),
|
||||
},
|
||||
@ -134,7 +134,7 @@ export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red
|
||||
label: dataset3? dataset3 : 'Dataset 2',
|
||||
// backgroundColor: '#255488',
|
||||
backgroundColor: (value, ctx) => {
|
||||
return hashurado? data1[value.dataIndex].dad_estimado == false? '#255488' : pattern.draw('diagonal', '#255488') : '#255488'
|
||||
return hashurado? data1[value.dataIndex]?.dad_estimado == false? '#255488' : pattern.draw('diagonal', '#255488') : '#255488'
|
||||
},
|
||||
data: data2.map(value => value.custo_livre),
|
||||
},
|
||||
|
||||
@ -75,9 +75,9 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, barLabel
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: '',
|
||||
label: 'Estimado',
|
||||
data: [],
|
||||
backgroundColor: 'transparent',
|
||||
backgroundColor: '#C2d5fb',
|
||||
},
|
||||
{
|
||||
label: dataset,
|
||||
|
||||
@ -9,59 +9,28 @@ import { parseCookies } from 'nookies';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import getAPIClient from '../../services/ssrApi';
|
||||
|
||||
function stringToColor(string: string) {
|
||||
let hash = 0;
|
||||
let i;
|
||||
|
||||
for (i = 0; i < string.length; i += 1) {
|
||||
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
|
||||
let color = '#';
|
||||
|
||||
for (i = 0; i < 3; i += 1) {
|
||||
const value = (hash >> (i * 8)) & 0xff;
|
||||
color += `00${value.toString(16)}`.slice(-2);
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
function stringAvatar(profile_picture: string) {
|
||||
return {
|
||||
|
||||
children: `${profile_picture}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
interface headerInterface {
|
||||
name: string,
|
||||
admin?: boolean | undefined
|
||||
logo?: string
|
||||
profile_picture: string
|
||||
}
|
||||
|
||||
export default function Header({ name, admin, }: headerInterface) {
|
||||
export default function Header({name, admin}: headerInterface) {
|
||||
const { ['user-profile_picture']: profile_picture } = parseCookies()
|
||||
|
||||
return (
|
||||
<HeaderView>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
{
|
||||
!admin?
|
||||
// <Image src={logo} width={170} height={50} />
|
||||
null
|
||||
:
|
||||
null
|
||||
}
|
||||
<div className='icon' >
|
||||
<p>
|
||||
olá, {name}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{
|
||||
!admin && profile_picture?
|
||||
<Image src={profile_picture} height={50} width={75}/>
|
||||
:
|
||||
null
|
||||
}
|
||||
</HeaderView>
|
||||
)
|
||||
}
|
||||
@ -70,6 +39,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const apiClient = getAPIClient(ctx)
|
||||
const { ['@smartAuth-token']: token } = parseCookies(ctx)
|
||||
const { ['user-name']: userName } = parseCookies(ctx)
|
||||
const { ['user-profile_picture']: profile_picture } = parseCookies()
|
||||
|
||||
let userData = [];
|
||||
|
||||
@ -91,7 +61,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
return {
|
||||
props: {
|
||||
userData,
|
||||
userName
|
||||
userName,
|
||||
profile_picture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,24 +2,10 @@ import styled from "styled-components";
|
||||
|
||||
export const HeaderView = styled.header`
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
margin: 0 0 75px 0;
|
||||
justify-content: flex-end;
|
||||
|
||||
width: 100%;
|
||||
|
||||
section {
|
||||
width: 30%;
|
||||
|
||||
:last-child {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
height: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -32,6 +18,8 @@ export const HeaderView = styled.header`
|
||||
|
||||
background-color: #254F7F;
|
||||
|
||||
margin-right: 20px;
|
||||
|
||||
p{
|
||||
color: white;
|
||||
margin-left: 15%;
|
||||
|
||||
@ -64,6 +64,9 @@ export function AuthProvider({children}: {children: React.ReactNode}) {
|
||||
if (user.client_id)
|
||||
setCookie(undefined, 'user-client_id', user.client_id)
|
||||
|
||||
if (user.profile_picture)
|
||||
setCookie(undefined, 'user-profile_picture', user.profile_picture)
|
||||
|
||||
api.defaults.headers['Authorization'] = `Bearer ${token}`
|
||||
|
||||
if (!exception) {
|
||||
|
||||
@ -5,42 +5,22 @@ import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
import Banner from '../components/banner/Banner'
|
||||
import Header from '../components/header/Header'
|
||||
import getAPIClient from '../services/ssrApi'
|
||||
import { AboutUsView } from '../styles/layouts/aboutUs/AboutUsView'
|
||||
|
||||
export default function aboutUs({userName}) {
|
||||
export default function aboutUs({userName, text}) {
|
||||
return (
|
||||
<AboutUsView>
|
||||
<Head>
|
||||
<title>Smart Energia - About Us</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
|
||||
{/* <Header name={userName}/> */}
|
||||
<Banner title='Quem Somos' subtitle='Soluções inteligentes em Gestão de Energia' imgSource='/assets/banners/aboutUsBanner.png' />
|
||||
|
||||
<section>
|
||||
<p>A <strong>SMART ENERGIA</strong> é uma consultoria independente especializada em Gestão de Energia Elétrica, consolidada como uma das três maiores consultorias do Brasil.
|
||||
Devido à grande experiência em operações na CCEE – Câmara de Comercialização de Energia Elétrica e ANEEL, entrega resultados que superam as expectativas.</p>
|
||||
|
||||
<p>Nasceu para gerenciar a compra de energia com inovação, transparência e imparcialidade sendo o elo forte e necessário entre os Consumidores e os
|
||||
Vendedores de energia. </p>
|
||||
|
||||
<p>Baseada em sua experiência no setor elétrico adquirida desde 2001 e em mais de 900 unidades migradas, atua na negociação de contratos de compra e venda de
|
||||
energia, na Gestão de Energia no Mercado Livre e criação de produtos diferenciados para atender as necessidades específicas dos consumidores.</p>
|
||||
|
||||
<p>Apoiada pela sólida experiência de seus gestores, conhecendo as premissas dos agentes de Comercialização e Geração para a compra e venda de energia,
|
||||
aplicamos as mesmas premissas a favor dos Consumidores, disponibilizando assim um diferencial único para a tomada de decisão e elaboração das estratégias de
|
||||
contratação de energia.</p>
|
||||
<ul>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Informação'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Economia'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Gestão de Energia'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Imparcialidade'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Previsão de Custos'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Experiência'}</li>
|
||||
<li><Image src='/assets/listIcon.svg' width={25} height={25} />{'Relacionamento'}</li>
|
||||
</ul>
|
||||
|
||||
<section dangerouslySetInnerHTML={{__html: text[0].about}}/>
|
||||
<article>
|
||||
<aside>
|
||||
<aside style={{alignSelf: 'flex-end'}}>
|
||||
<h2>Apoio a projetos sociais</h2>
|
||||
<div>
|
||||
<Image src='/assets/stamps/whiteStamp.png' width={200} height={200} />
|
||||
@ -48,15 +28,23 @@ export default function aboutUs({userName}) {
|
||||
</div>
|
||||
</aside>
|
||||
</article>
|
||||
</section>
|
||||
</AboutUsView>
|
||||
)
|
||||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const apiClient = getAPIClient(ctx)
|
||||
const { ['@smartAuth-token']: token } = parseCookies(ctx)
|
||||
const { ['user-name']: userName } = parseCookies(ctx)
|
||||
|
||||
let text = []
|
||||
|
||||
await apiClient.get('/aboutUs').then(res => {
|
||||
text = res.data.data
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
return {
|
||||
redirect: {
|
||||
@ -68,7 +56,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
|
||||
return {
|
||||
props: {
|
||||
userName
|
||||
userName,
|
||||
text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,16 +19,16 @@ export default function AccumulatedSavings({graphData, years, userName}: any) {
|
||||
<title>Smart Energia - Economia Bruta Mensal</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
<PageTitle title='Economia Bruta Mensal' subtitle='Economia Bruta Estimada e Acumulada mensal (Valores em R$ mil)' />
|
||||
<PageTitle title='Economia Bruta Mensal' subtitle='Economia Bruta Estimada e Acumulada mensal - Valores em R$ mil' />
|
||||
<section>
|
||||
<SingleBar title='Economia Bruta Estimada e Acumulada' subtitle='(Valores em R$ mil)' dataset='Consolidada'
|
||||
dataset1='Estimada' dataProps={graphData.sort((a, b) => {
|
||||
<SingleBar title='' subtitle='' dataset='Consolidada'
|
||||
dataProps={graphData.sort((a, b) => {
|
||||
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
|
||||
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
|
||||
|
||||
return 0
|
||||
})}
|
||||
label={years} barLabel month/>
|
||||
label={years} barLabel/>
|
||||
</section>
|
||||
</AccumulatedSavingsView>
|
||||
)
|
||||
|
||||
@ -8,12 +8,23 @@ import Header from '../../components/header/Header';
|
||||
import PageTitle from '../../components/pageTitle/PageTitle';
|
||||
import { api } from '../../services/api';
|
||||
import { GeneralView } from '../../styles/layouts/general/GeneralView'
|
||||
import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
||||
import Snackbar from '@mui/material/Snackbar';
|
||||
|
||||
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
props,
|
||||
ref
|
||||
) {
|
||||
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />
|
||||
})
|
||||
|
||||
export default function index({userName}: any) {
|
||||
const editorRef = useRef(null);
|
||||
const [text, setText] = useState('');
|
||||
|
||||
const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false)
|
||||
const [openSnackError, setOpenSnackError] = useState<boolean>(false)
|
||||
|
||||
const log = () => {
|
||||
if (editorRef.current) {
|
||||
console.log(editorRef.current.getContent());
|
||||
@ -24,16 +35,54 @@ export default function index({userName}: any) {
|
||||
setText(event.target.value);
|
||||
};
|
||||
|
||||
const handleCloseSnack = (
|
||||
event?: React.SyntheticEvent | Event,
|
||||
reason?: string
|
||||
) => {
|
||||
if (reason === 'clickaway') {
|
||||
return
|
||||
}
|
||||
|
||||
setOpenSnackError(false)
|
||||
setOpenSnackSuccess(false)
|
||||
}
|
||||
|
||||
async function handleRegisterAboutUs() {
|
||||
await api.post('/aboutUs', {
|
||||
about: editorRef.current.value
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
}).catch(res => console.log(res))
|
||||
about: text
|
||||
})
|
||||
.then(res => setOpenSnackSuccess(true))
|
||||
.catch(res => setOpenSnackError(false))
|
||||
}
|
||||
|
||||
return (
|
||||
<GeneralView>
|
||||
<Snackbar
|
||||
open={openSnackSuccess}
|
||||
autoHideDuration={4000}
|
||||
onClose={handleCloseSnack}
|
||||
>
|
||||
<Alert
|
||||
onClose={handleCloseSnack}
|
||||
severity="success"
|
||||
sx={{ width: '100%' }}
|
||||
>
|
||||
Cadastrado com Sucesso!
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
<Snackbar
|
||||
open={openSnackError}
|
||||
autoHideDuration={4000}
|
||||
onClose={handleCloseSnack}
|
||||
>
|
||||
<Alert
|
||||
onClose={handleCloseSnack}
|
||||
severity="error"
|
||||
sx={{ width: '100%' }}
|
||||
>
|
||||
Não cadastrado!
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
<Header name={userName} admin/>
|
||||
<PageTitle title='Sobre nós' subtitle='Alterar texto de sobre nós'/>
|
||||
<div style={{width: '100%', display: 'flex', justifyContent: 'flex-start', alignItems: 'flex-start', marginTop: '30px', marginBottom: '10px'}}>
|
||||
@ -43,6 +92,8 @@ export default function index({userName}: any) {
|
||||
<br />
|
||||
<Editor
|
||||
onInit={(evt, editor) => editorRef.current = editor}
|
||||
onChange={value => console.log(value)}
|
||||
onEditorChange={(newText) => setText(newText)}
|
||||
initialValue=' <p>A <strong>SMART ENERGIA</strong> é uma consultoria independente especializada em Gestão de Energia Elétrica, consolidada como uma das três maiores consultorias do Brasil.
|
||||
Devido à grande experiência em operações na CCEE – Câmara de Comercialização de Energia Elétrica e ANEEL, entrega resultados que superam as expectativas.</p>
|
||||
|
||||
|
||||
@ -4,50 +4,21 @@ import { parseCookies } from 'nookies'
|
||||
import React from 'react'
|
||||
|
||||
import Chart from '../components/graph/Chart'
|
||||
import { SingleBar } from '../components/graph/SingleBar'
|
||||
import Header from '../components/header/Header'
|
||||
import PageTitle from '../components/pageTitle/PageTitle'
|
||||
import { dataEconomiaBruta } from '../services/economiaBruta'
|
||||
import { dataEconomiaIndicador } from '../services/economiaIndicador'
|
||||
import getAPIClient from '../services/ssrApi'
|
||||
import { CostIndicatorView } from '../styles/layouts/economy/costIndicator/CostIndicatorView'
|
||||
|
||||
function verifyDataByYear(data) {
|
||||
const currentYear = []
|
||||
const currentYearAux = data.filter(value => value.mes.slice(3, 7).includes('2021'))
|
||||
console.log(currentYear.length)
|
||||
console.log(currentYearAux.length)
|
||||
|
||||
currentYearAux.sort((a, b) => {
|
||||
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
|
||||
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
|
||||
|
||||
return 0
|
||||
})
|
||||
|
||||
// for (let i=0; currentYear.length <= currentYearAux.length; i++) {
|
||||
// console.log(i, 'dentro do for')
|
||||
// // console.log(currentYearAux.length, 'tamanho aux')
|
||||
// if (currentYearAux[i].mes.slice(1,2)==i) {
|
||||
// currentYear.push(currentYearAux[i])
|
||||
// console.log(currentYear.length, 'tamanho')
|
||||
// }
|
||||
// }
|
||||
console.log(currentYearAux)
|
||||
}
|
||||
|
||||
export default function CostIndicator({graphData, userName}: any) {
|
||||
// console.log(graphData.filter((value, index) => value.mes.slice(3, 7).includes('2021')).map(value => value.custo_unit))
|
||||
|
||||
return (
|
||||
<CostIndicatorView>
|
||||
<Head>
|
||||
<title>Smart Energia - Indicador de Custos</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
<PageTitle title='Indicador de Custo' subtitle='Valores em R$/MWh'/>
|
||||
<PageTitle title='Indicador de Custo' subtitle='Indicador de Custo - Valores em R$/MWh'/>
|
||||
<section>
|
||||
<Chart title='Indicador de Custo' subtitle='(Valores em R$/MWh)'
|
||||
<Chart title='' subtitle=''
|
||||
data1={graphData.filter((value, index) => value.mes.slice(3, 7).includes('2021')).sort((a, b) => {
|
||||
if (parseFloat(a.mes.slice(0,2)) > parseFloat(b.mes.slice(1,2))) return 1
|
||||
if (parseFloat(a.mes.slice(0,2)) < parseFloat(b.mes.slice(1,2))) return -1
|
||||
|
||||
@ -19,11 +19,11 @@ export default function EstimatedCost({graphData, userName}: any) {
|
||||
<title>Smart Energia - Custos Estimados</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
<PageTitle title='Cativo x Livre mensal' subtitle='Comparativo de Custo Estimado' />
|
||||
<PageTitle title='Cativo x Livre mensal' subtitle='Comparativo de custo Estimado - Valores em R$' />
|
||||
<section>
|
||||
<LineBarChart2 data1={graphData} data2={graphData} data3={graphData}
|
||||
dataset1="Economia (R$)" dataset2='Cativo' dataset3='Livre'
|
||||
label={ConsumoEstimado.label} title='Cativo x Livre mensal' subtitle='' barLabel hashurado />
|
||||
label={ConsumoEstimado.label} title='' subtitle='' barLabel hashurado />
|
||||
</section>
|
||||
</EstimatedCostView>
|
||||
)
|
||||
|
||||
@ -19,13 +19,13 @@ export default function GrossSavings({graphData, years, userName}: any) {
|
||||
<title>Smart Energia - Economia Acumulada</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
<PageTitle title='Economia Bruta Anual' subtitle='Economia Bruta Estimada e Acumulada anual (Valores em R$ mil)' />
|
||||
<PageTitle title='Economia Bruta Anual' subtitle='Economia Bruta Estimada e Acumulada anual - Valores em R$ mil' />
|
||||
<section>
|
||||
<SingleBar title='Economia Bruta' subtitle='(Valores em R$ mil)'
|
||||
dataset='Consolidada' dataset1='Estimada'
|
||||
<SingleBar title='' subtitle=''
|
||||
dataset='Consolidada'
|
||||
|
||||
dataProps={graphData}
|
||||
label={years} barLabel year/>
|
||||
label={years} barLabel/>
|
||||
|
||||
</section>
|
||||
</GrossSavingsView>
|
||||
|
||||
@ -146,7 +146,7 @@ export default function Home() {
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
}
|
||||
label="Password"
|
||||
label="Senha"
|
||||
/>
|
||||
</FormControl>
|
||||
<Link href='verifyEmail'>Esqueceu a senha ?</Link>
|
||||
|
||||
@ -12,44 +12,38 @@ import getAPIClient from '../services/ssrApi';
|
||||
import { Button, NewsView } from '../styles/layouts/news/NewsView'
|
||||
|
||||
export default function aboutUs({userName, news}: any) {
|
||||
console.log(news)
|
||||
console.log(news.channel.item)
|
||||
|
||||
return (
|
||||
<NewsView>
|
||||
<Head>
|
||||
<title>Smart Energia - Noticias</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
{/* <Header name={userName} /> */}
|
||||
<Banner title='Notícias' subtitle='Tudo de importante no setor de energia' imgSource='/assets/banners/news.png'/>
|
||||
|
||||
{
|
||||
news.channel.item.map(data => {
|
||||
|
||||
return <>
|
||||
<section>
|
||||
<h2>19 Abril 2022</h2>
|
||||
<h2 dangerouslySetInnerHTML={{__html: data.pubDate}} />
|
||||
<strong dangerouslySetInnerHTML={{__html: data.title}} />
|
||||
<strong>ANEEL APROVA REAJUSTE TARIFÁRIO ANUAL DA ENERGISA SERGIPE DE 16,46 % PARA O CONSUMIDOR RESIDENCIAL</strong>
|
||||
<br />
|
||||
<br />
|
||||
<p>A Agência Nacional de Energia Elétrica (ANEEL) aprovou, nesta terça-feira (19/04) o reajuste tarifário anual da Energisa Sergipe – Distribuidora de Energia S.A (ESE).
|
||||
As novas tarifas da empresa, que atende cerca de e 825 mil unidades consumidoras no Sergipe, entram em vigor nesta sexta, 22/04, com reajuste de 16,46 % para
|
||||
o consumidor residencial. <br />
|
||||
Os itens que mais impactaram a correção foram os encargos setoriais, os custos de distribuição, a retirada dos componentes financeiros..</p>
|
||||
<Button>
|
||||
<fieldset>
|
||||
<legend> <BasicButton title='Ver Mais...' onClick={() => console.log()}/></legend>
|
||||
</fieldset>
|
||||
</Button>
|
||||
|
||||
<h2>19 Abril 2022</h2>
|
||||
<strong>NEEL APROVA REAJUSTE MÉDIO DE 20,36% NA TARIFA DE ENERGIA NO RN</strong>
|
||||
<br />
|
||||
<br />
|
||||
<p>A Agência Nacional de Energia Elétrica (ANEEL) aprovou, nesta terça-feira (19/04) o reajuste tarifário anual da Energisa Sergipe – Distribuidora de Energia S.A (ESE).
|
||||
As novas tarifas da empresa, que atende cerca de e 825 mil unidades consumidoras no Sergipe, entram em vigor nesta sexta, 22/04, com reajuste de 16,46 % para
|
||||
o consumidor residencial. <br />
|
||||
Os itens que mais impactaram a correção foram os encargos setoriais, os custos de distribuição, a retirada dos componentes financeiros..</p>
|
||||
{
|
||||
<p dangerouslySetInnerHTML={{__html: data.description}} />
|
||||
}
|
||||
<Button>
|
||||
<fieldset>
|
||||
<legend> <BasicButton title='Ver Mais...' onClick={() => console.log()}/></legend>
|
||||
</fieldset>
|
||||
</Button>
|
||||
</section>
|
||||
</>
|
||||
})
|
||||
}
|
||||
|
||||
<a href='https://www.energiasmart.com.br/noticias/'
|
||||
target={"_blank"}
|
||||
@ -63,10 +57,10 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const { ['@smartAuth-token']: token } = parseCookies(ctx)
|
||||
const { ['user-name']: userName } = parseCookies(ctx)
|
||||
|
||||
let news;
|
||||
let news = [];
|
||||
|
||||
await axios.get('https://www.energiasmart.com.br/noticias/feed/').then(res => {
|
||||
news = res.data
|
||||
await apiClient.get('/news').then(res => {
|
||||
news = res.data.data
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
@ -16,15 +16,18 @@ export default function Notifications({notificationData, userName}: any) {
|
||||
<title>Smart Energia - Notificações</title>
|
||||
</Head>
|
||||
<Header name={userName} />
|
||||
<PageTitle title='Notificações' subtitle='Aqui estão as notificaões publicadas para voce!' />
|
||||
<PageTitle title='Notificações' subtitle='Aqui estão as notificações publicadas para você!' />
|
||||
<section className='CommonQuestionsSection' >
|
||||
{
|
||||
notificationData?
|
||||
notificationData.map((value, index ) => {
|
||||
return <>
|
||||
<NotificationQuestionsCard key={index} title={value.title} body={value.body}/>
|
||||
<hr />
|
||||
</>
|
||||
})
|
||||
:
|
||||
<p style={{alignSelf: 'center'}}>Você não tem notificações!</p>
|
||||
}
|
||||
</section>
|
||||
</FaqView>
|
||||
|
||||
@ -160,7 +160,12 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
tableData.data.map(data => {
|
||||
tableData.data.sort((a, b) => {
|
||||
if (parseFloat(a.year_month_formatted.slice(0,2)) > parseFloat(b.year_month_formatted.slice(1,2))) return 1
|
||||
if (parseFloat(a.year_month_formatted.slice(0,2)) < parseFloat(b.year_month_formatted.slice(1,2))) return -1
|
||||
|
||||
return 0
|
||||
}).map(data => {
|
||||
return <>
|
||||
<tr>
|
||||
<td className='tg-gceh'>{data.year_month_formatted}</td>
|
||||
@ -210,7 +215,7 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
|
||||
</tbody>
|
||||
</table>
|
||||
<div className='btnDownload'>
|
||||
<BasicButton onClick={''} title='Download'/>
|
||||
<BasicButton onClick={() => console.log()} title='Download'/>
|
||||
</div>
|
||||
<section>
|
||||
|
||||
@ -261,7 +266,6 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
|
||||
displayEmpty
|
||||
placeholder='dia'
|
||||
label="Age"
|
||||
|
||||
>
|
||||
<MenuItem value={'0'}>Nenhum</MenuItem>
|
||||
{
|
||||
|
||||
@ -163,7 +163,7 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
|
||||
<tr>
|
||||
<td key={index} className='tg-gceh'>{value.cod_smart_unidade}</td>
|
||||
<td key={index} className='tg-uulg'>{value.operacao}</td>
|
||||
<td key={index} className='tg-gceh'>{value.montante_nf}</td>
|
||||
<td key={index} className='tg-gceh'>{parseFloat(value.montante_nf).toLocaleString('pt-br')}</td>
|
||||
<td key={index} className='tg-gceh'>{value.contraparte}</td>
|
||||
<td key={index} className='tg-uulg'>{parseFloat(value.nf_c_icms).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
|
||||
<td key={index} className='tg-gceh'>{parseFloat(value.preco_nf).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}</td>
|
||||
|
||||
@ -14,9 +14,10 @@ interface SignInRequestData {
|
||||
type UserObjectType = {
|
||||
name: string;
|
||||
email: string;
|
||||
client_id: number
|
||||
id: number,
|
||||
role: number
|
||||
client_id: number;
|
||||
id: number;
|
||||
role: number;
|
||||
profile_picture?: string
|
||||
}
|
||||
|
||||
export async function signInRequest(data: SignInRequestData) {
|
||||
@ -33,7 +34,8 @@ export async function signInRequest(data: SignInRequestData) {
|
||||
email: res.data.user.email,
|
||||
client_id: res.data.user.client_id,
|
||||
id: res.data.user.id,
|
||||
role: res.data.user.roles[0].pivot.role_id
|
||||
role: res.data.user.roles[0].pivot.role_id,
|
||||
profile_picture: res.data.user.profile_picture
|
||||
}
|
||||
}).catch(res => {
|
||||
exception = res
|
||||
@ -46,7 +48,8 @@ export async function signInRequest(data: SignInRequestData) {
|
||||
email: user?.email,
|
||||
client_id: user?.client_id,
|
||||
id: user?.id,
|
||||
role: user?.role
|
||||
role: user?.role,
|
||||
profile_picture: user?.profile_picture
|
||||
},
|
||||
exception
|
||||
}
|
||||
@ -62,7 +65,8 @@ export default async function recoverUserInformation(id) {
|
||||
email: res.data.user.email,
|
||||
client_id: res.data.user.client_id,
|
||||
id: res.data.user.id,
|
||||
role: res.data.user.roles[0].pivot.role_id
|
||||
role: res.data.user.roles[0].pivot.role_id,
|
||||
profile_picture: res.data.user.profile_picture
|
||||
}
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
@ -73,7 +77,8 @@ export default async function recoverUserInformation(id) {
|
||||
name: user?.name,
|
||||
email: user?.email,
|
||||
client_id: user?.client_id,
|
||||
id: user?.id
|
||||
id: user?.id,
|
||||
profile_picture: user?.profile_picture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,6 @@ export const AboutUsView = styled.main`
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
article {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
@ -38,7 +37,6 @@ export const AboutUsView = styled.main`
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1008px) {
|
||||
li {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user