diff --git a/package.json b/package.json index d462a729..6d3a10e9 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "react-ga": "^3.3.0", "react-modal": "^3.14.2", "react-share": "^4.4.0", + "react-toggle-button": "^2.2.0", "styled-components": "^5.2.3" }, "devDependencies": { diff --git a/public/img/indice.png b/public/img/indice.png deleted file mode 100644 index cde0b38b..00000000 Binary files a/public/img/indice.png and /dev/null differ diff --git a/public/img/indice_mps.png b/public/img/indice_mps.png new file mode 100644 index 00000000..93134ea9 Binary files /dev/null and b/public/img/indice_mps.png differ diff --git a/public/img/indice_tjs.png b/public/img/indice_tjs.png new file mode 100644 index 00000000..3f540afa Binary files /dev/null and b/public/img/indice_tjs.png differ diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 8231068b..67f86613 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -2,6 +2,7 @@ import Head from 'next/head'; import styled from 'styled-components'; import { GetServerSideProps } from 'next'; import { useEffect, useMemo, useState } from 'react'; +import ToggleButton from 'react-toggle-button' import Footer from '../components/Footer'; import Nav from '../components/Header'; import DropDownGroupSelector from '../components/DropDownGroupSelector'; @@ -32,6 +33,7 @@ export default function Index({ [year], ); const previousDateIsNavigable = useMemo(() => year !== 2018, [year]); + const [indexChart, setIndexChart] = useState(true); useEffect(() => { fetchGeneralChartData(); }, [year]); @@ -101,14 +103,32 @@ export default function Index({


- Dados atualizados até 8 Fev de 2022. + Dados atualizados até 3 Mai de 2022.

+ + { + setIndexChart(!value); + }}/> + Legenda do índice de transparência - Índice de transparência + {indexChart && Índice de transparência} + {!indexChart && Índice de transparência} @@ -363,3 +383,10 @@ const Negrito = styled.span` font-weight: 700; font-size: 1.8rem; `; +const ToggleChartButton = styled.div` + display: flex; + align-items: center; + justify-content: center; + text-align: center; + padding-top: 4rem; +`; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 42801790..fb8e2085 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2574,6 +2574,16 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + integrity sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU= + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" @@ -2682,6 +2692,15 @@ prop-types@15.7.2, prop-types@^15.5.7, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +prop-types@^15.5.8, prop-types@^15.6.0: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -2729,6 +2748,13 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +raf@^3.1.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -2775,7 +2801,7 @@ react-ga@^3.3.0: resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca" integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ== -react-is@16.13.1, react-is@^16.7.0, react-is@^16.8.1: +react-is@16.13.1, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -2795,6 +2821,15 @@ react-modal@^3.14.2: react-lifecycles-compat "^3.0.0" warning "^4.0.3" +react-motion@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/react-motion/-/react-motion-0.5.2.tgz#0dd3a69e411316567927917c6626551ba0607316" + integrity sha512-9q3YAvHoUiWlP3cK0v+w1N5Z23HXMj4IF4YuvjvWegWqNPfLXsOBE/V7UvQGpXxHFKRQQcNcVQE31g9SB/6qgQ== + dependencies: + performance-now "^0.2.0" + prop-types "^15.5.8" + raf "^3.1.0" + react-refresh@0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f" @@ -2808,6 +2843,14 @@ react-share@^4.4.0: classnames "^2.2.5" jsonp "^0.2.1" +react-toggle-button@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/react-toggle-button/-/react-toggle-button-2.2.0.tgz#a1b92143aa0df414642fcb141f0879f545bc5a89" + integrity sha1-obkhQ6oN9BRkL8sUHwh59UW8Wok= + dependencies: + prop-types "^15.6.0" + react-motion "^0.5.2" + react@17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"