diff --git a/package.json b/package.json index d57d55f..b87ac3b 100644 --- a/package.json +++ b/package.json @@ -17,20 +17,26 @@ ] }, "dependencies": { + "@date-io/date-fns": "^2.14.0", "@emotion/react": "^11.9.0", "@emotion/styled": "^11.8.1", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@mui/material": "^5.6.4", + "@mui/x-data-grid": "^5.11.0", + "@mui/x-date-pickers": "^5.0.0-alpha.3", "@typescript-eslint/eslint-plugin": "^5.22.0", "@typescript-eslint/parser": "^5.22.0", "chart.js": "^3.7.1", "eslint-plugin-react": "^7.29.4", "eslit": "^6.0.0", "faker": "5.5.3", + "install": "^0.13.0", "next": "12.1.6", + "npm": "^8.10.0", "nprogress": "^0.2.0", "react": "18.1.0", + "react-calendar": "^3.7.0", "react-chartjs-2": "^4.1.0", "react-dom": "18.1.0", "react-icons": "^4.3.1", diff --git a/public/assets/logout.svg b/public/assets/logout.svg new file mode 100644 index 0000000..ac136c2 --- /dev/null +++ b/public/assets/logout.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/buttons/loginButton/LoginButton.tsx b/src/components/buttons/loginButton/LoginButton.tsx index 54214a8..100b60b 100644 --- a/src/components/buttons/loginButton/LoginButton.tsx +++ b/src/components/buttons/loginButton/LoginButton.tsx @@ -1,17 +1,29 @@ -import Link from 'next/link' import React from 'react' +import Link from 'next/link' +import RenderIf from '../../../utils/renderIf' import { LoginButtonView } from './LoginButtonView' interface LoginButtonInterface { - title: string + title: string, + link?: boolean | undefined, + onClick?: () => void } -export default function LoginButton({ title }: LoginButtonInterface) { +export default function LoginButton({ title, link, onClick }: LoginButtonInterface) { return ( - - - {title} - - + <> + + + + {title} + + + + + onClick()}> + {title} + + + ) } diff --git a/src/components/mapCard/MapCard.tsx b/src/components/mapCard/MapCard.tsx index 1c5fb45..367178f 100644 --- a/src/components/mapCard/MapCard.tsx +++ b/src/components/mapCard/MapCard.tsx @@ -1,6 +1,7 @@ import React from 'react' import Image from 'next/image' import { MapCardView } from './MapCardView' +import Link from 'next/link' interface MapCardInterface { title: string, @@ -10,25 +11,26 @@ interface MapCardInterface { } export default function MapCard({ title, subtitle, statistic, imgSource }: MapCardInterface) { + const route = title==='R$/MWh'? '/consumption': `pld/${title.slice(0,2).toLocaleLowerCase()}-${title.slice(3,5).toLocaleLowerCase()}` return ( - - -
-

{title}

- {subtitle} -
- { - statistic? - <> - -

{statistic}

- - : - null - } -
-
-
+ + +
+

{title}

+ {subtitle} +
+ { + statistic? + <> + +

{statistic}

+ + : + null + } +
+
+
) } diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index a867c68..6a62ebb 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -26,21 +26,22 @@ export default function Sidebar() {