+ useEffect(() => {
+ resetForm();
+ }, []);
+ const handleSubmit = (e) => {
+ e.preventDefault();
+ };
+ return (
+
+ );
+};
-export default Footer;
\ No newline at end of file
+export default Footer;
diff --git a/web/src/components/Footer/Footer.module.css b/web/src/components/Footer/Footer.module.css
index 19cded5..196042b 100644
--- a/web/src/components/Footer/Footer.module.css
+++ b/web/src/components/Footer/Footer.module.css
@@ -1,326 +1,319 @@
.footer {
- position: relative;
+ position: relative;
- padding-top: 108px;
- padding-bottom: 100px;
+ padding-top: 108px;
+ padding-bottom: 100px;
- margin: 0 auto;
-
- background-color: rgb(0, 0, 0);
+ margin: 0 auto;
+ background-color: rgb(0, 0, 0);
}
.footer__container {
- max-width: 1680px;
- margin: 0 auto;
- padding: 0 90px;
+ max-width: 1680px;
+ margin: 0 auto;
+ padding: 0 90px;
}
.footer_row_top {
- display: flex;
- justify-content: space-between;
- margin-bottom: 124px;
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 124px;
}
.footer__flex-container {
- display: flex;
- width: 30%;
- min-width: 345px;
- flex-direction: column;
- row-gap: 31px;
+ display: flex;
+ width: 30%;
+ min-width: 345px;
+ flex-direction: column;
+ row-gap: 31px;
}
.footer_row_bottom {
- display: flex;
- justify-content: space-between;
+ display: flex;
+ justify-content: space-between;
}
.footer_column_left,
.footer_column_right {
- display: flex;
- justify-content: space-between;
+ display: flex;
+ justify-content: space-between;
}
.footer_column_left {
- width: 36%;
- min-width: 240px;
- padding-right: 20px;
+ width: 36%;
+ min-width: 240px;
+ padding-right: 20px;
}
.footer_column_right {
- width: 48%;
- min-width: 340px;
+ width: 48%;
+ min-width: 340px;
}
.footer__text {
- max-width: 450px;
+ max-width: 450px;
}
.footer__form {
- position: relative;
+ position: relative;
- width: 50%;
- min-width: 345px;
- align-self: center;
+ width: 50%;
+ min-width: 345px;
+ align-self: center;
}
.footer__input {
- display: block;
+ display: block;
- margin-bottom: 10px;
- padding: 19px 40px 20px 24px;
- width: 100%;
+ margin-bottom: 10px;
+ padding: 19px 40px 20px 24px;
+ width: 100%;
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 15px;
- line-height: 21px;
- color: rgba(255, 255, 255);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 15px;
+ line-height: 21px;
+ color: rgba(255, 255, 255);
- background-color: rgba(196, 196, 196, 0.15);
+ background-color: rgba(196, 196, 196, 0.15);
- border: 1px solid transparent;
- border-radius: 16px;
- box-sizing: border-box;
- outline: none;
+ border: 1px solid transparent;
+ border-radius: 16px;
+ box-sizing: border-box;
+ outline: none;
}
.footer__input:placeholder {
- color: rgba(196, 196, 196, 0.5);
+ color: rgba(196, 196, 196, 0.5);
}
.footer__input:hover {
- background-color: rgba(196, 196, 196, 0.2);
+ background-color: rgba(196, 196, 196, 0.2);
}
.footer__input:focus {
- border-color: rgb(255, 255, 255);
+ border-color: rgb(255, 255, 255);
}
-
.footer__input_type_error {
- border-color: rgb(239, 70, 70);
+ border-color: rgb(239, 70, 70);
}
.footer__error {
- min-width: 16px;
- padding-left: 24px;
+ min-width: 16px;
+ padding-left: 24px;
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(239, 70, 70);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(239, 70, 70);
- opacity: 0;
- text-transform: uppercase;
+ opacity: 0;
+ text-transform: uppercase;
}
.footer__error_show {
- opacity: 1;
+ opacity: 1;
}
.footer__submit {
- position: absolute;
- top: 26px;
- right: 35px;
+ position: absolute;
+ top: 26px;
+ right: 35px;
- width: 15px;
- height: 7px;
+ width: 15px;
+ height: 7px;
- background-color: transparent;
- background-image: url("../../images/arrow.svg");
- background-position: center;
- background-repeat: no-repeat;
- border: none;
+ background-color: transparent;
+ background-image: url("../../images/arrow.svg");
+ background-position: center;
+ background-repeat: no-repeat;
+ border: none;
}
.footer__flex-column {
- display: flex;
- justify-content: space-between;
- width: 60%;
+ display: flex;
+ justify-content: space-between;
+ width: 60%;
}
.footer__submit:hover {
- cursor: pointer;
+ cursor: pointer;
}
.footer__input:hover > .footer__submit {
- background-image: url("../../images/arrow-green.svg");
+ background-image: url("../../images/arrow-green.svg");
}
.footer__span {
- position: absolute;
- z-index: 10;
-
- width: 12px;
- height: 8px;
-
+ position: absolute;
+ z-index: 10;
+ width: 12px;
+ height: 8px;
}
.footer__column_flex-end {
- margin-bottom: 10px;
- align-self: flex-end;
+ margin-bottom: 10px;
+ align-self: flex-end;
}
-
.footer__item {
- margin-bottom: 16px;
+ margin-bottom: 16px;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 15px;
- line-height: 21px;
- color: rgb(204, 204, 204);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 15px;
+ line-height: 21px;
+ color: rgb(204, 204, 204);
}
.footer__item_disabled {
- color: rgba(196, 196, 196, 0.5)
+ color: rgba(196, 196, 196, 0.5);
}
.footer__item:last-child {
- margin-bottom: 0;
+ margin-bottom: 0;
}
.footer__item_mr {
- margin-right: 18px;
+ margin-right: 18px;
}
.footer__item_mr:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.footer__link {
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 15px;
+ line-height: 21px;
+ color: rgb(204, 204, 204);
- font-family: "Hauora_Bold", sans-serif;
- font-size: 15px;
- line-height: 21px;
- color: rgb(204, 204, 204);
-
- letter-spacing: 0.2px;
- text-decoration: none;
- transition: opacity 0.2s linear 0.2s;
+ letter-spacing: 0.2px;
+ text-decoration: none;
+ transition: opacity 0.2s linear 0.2s;
}
.footer__link:hover {
- opacity: 0.6;
- cursor: pointer;
+ opacity: 0.6;
+ cursor: pointer;
}
.footer__caption {
- color: rgba(196, 196, 196, 0.5);
- font-size: 10px;
- line-height: 16px;
+ color: rgba(196, 196, 196, 0.5);
+ font-size: 10px;
+ line-height: 16px;
- letter-spacing: 1px;
+ letter-spacing: 1px;
}
.footer__item_list_arrow {
- list-style-image: url("../../images/arrow\ 45.svg");
+ list-style-image: url("../../images/arrow\ 45.svg");
}
.footer__corner {
- position: absolute;
- bottom: 0;
- left: 0;
- z-index: 20;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ z-index: 20;
- width: 54%;
- height: 207px;
- background-image: url("../../images/footer\ corner.png");
- overflow: hidden;
+ width: 54%;
+ height: 207px;
+ background-image: url("../../images/footer\ corner.png");
+ overflow: hidden;
}
@media screen and (max-width: 1100px) {
- .footer__container {
- padding: 0 40px;
- }
+ .footer__container {
+ padding: 0 40px;
+ }
}
@media screen and (max-width: 900px) {
+ .footer__container {
+ flex-wrap: wrap;
+ padding: 0 15px;
+ }
+
+ .footer_row_top {
+ justify-content: center;
+ flex-wrap: wrap;
+ }
+
+ .footer_row_bottom {
+ justify-content: center;
+ flex-wrap: wrap;
+ }
+
+ .footer__corner {
+ width: 100%;
+ }
+}
+
+@media screen and (max-width: 800px) {
+ .footer__flex-container {
+ margin-bottom: 35px;
+ width: 100%;
+ }
+ .footer__form {
+ width: 100%;
+ }
- .footer__container {
- flex-wrap: wrap;
- padding: 0 15px;
- }
+ .footer_row_top {
+ margin-bottom: 91px;
+ }
- .footer_row_top {
- justify-content: center;
- flex-wrap: wrap;
- }
+ .footer_row_bottom {
+ display: block;
+ width: 100%;
+ margin: 0 auto;
+ }
- .footer_row_bottom {
- justify-content: center;
- flex-wrap: wrap;
- }
+ .footer_column_left,
+ .footer_column_right {
+ width: 100%;
+ }
- .footer__corner {
- width: 100%;
- }
-}
+ .footer_column_left {
+ margin-bottom: 40px;
+ }
-@media screen and (max-width: 800px) {
- .footer__flex-container {
- margin-bottom: 35px;
- width: 100%;
- }
- .footer__form {
- width: 100%;
- }
-
- .footer_row_top {
- margin-bottom: 91px;
- }
-
- .footer_row_bottom {
- display: block;
- width: 100%;
- margin: 0 auto;
- }
-
- .footer_column_left,
- .footer_column_right {
- width: 100%;
- }
-
- .footer_column_left {
- margin-bottom: 40px;
- }
-
- .footer_column_right {
- display: block;
- }
-
- .footer__flex-column {
- width: 95%;
- margin-bottom: 85px;
- }
-
- .footer__item_mr {
- margin-right: 30px
- }
-
- .footer__column_flex-end {
- margin: 0 auto;
- width: 40%;
- }
-
- .footer__icon_discord {
- width: 25px;
- }
-
- .footer__icon_twitter {
- width: 20px;
- }
-
- .footer__icon_telegram {
- width: 20px;
- }
-
- .footer__icon_youtube {
- width: 23px;
- }
+ .footer_column_right {
+ display: block;
+ }
+
+ .footer__flex-column {
+ width: 95%;
+ margin-bottom: 85px;
+ }
+
+ .footer__item_mr {
+ margin-right: 30px;
+ }
+
+ .footer__column_flex-end {
+ margin: 0 auto;
+ width: 40%;
+ }
+
+ .footer__icon_discord {
+ width: 25px;
+ }
+
+ .footer__icon_twitter {
+ width: 20px;
+ }
+
+ .footer__icon_telegram {
+ width: 20px;
+ }
+
+ .footer__icon_youtube {
+ width: 23px;
+ }
}
@media screen and (max-width: 435px) {
- .footer__column_flex-end {
- width: 60%
- }
-}
\ No newline at end of file
+ .footer__column_flex-end {
+ width: 60%;
+ }
+}
diff --git a/web/src/components/Header/Header.js b/web/src/components/Header/Header.js
index ac4bbd3..bfab791 100644
--- a/web/src/components/Header/Header.js
+++ b/web/src/components/Header/Header.js
@@ -1,46 +1,52 @@
-import React, { useEffect, useState } from 'react';
-import { Link, useNavigate } from 'react-router-dom';
-
-import MainNavigation from '../MainNavigation/MainNavigation';
-import Button from '../Button/Button'
-
-import logo from '../../images/logo.svg'
-import styles from './Header.module.css';
-
-const Header = ({ button=false }) => {
- const [currentWidthWindow, setCurrentWidthWindow] = useState(window.innerWidth);
-
- const navigate = useNavigate();
-
- const handleClick = () => {
- navigate('/');
- }
-
-
- useEffect(() => {
- const resizeCurrentWidth = () => {
- setCurrentWidthWindow(window.innerWidth)
- }
-
- window.addEventListener('resize', resizeCurrentWidth);
-
- return () => {
- window.removeEventListener('resize', resizeCurrentWidth);
- }
-
- }, [])
- return (
-
- )
-}
-
-export default Header;
\ No newline at end of file
+import React, { useEffect, useState } from "react";
+import { Link, useNavigate } from "react-router-dom";
+
+import MainNavigation from "../MainNavigation/MainNavigation";
+import Button from "../Button/Button";
+
+import logo from "../../images/logo.svg";
+import styles from "./Header.module.css";
+
+const Header = ({ button = false }) => {
+ const [currentWidthWindow, setCurrentWidthWindow] = useState(
+ window.innerWidth,
+ );
+
+ const navigate = useNavigate();
+
+ const handleClick = () => {
+ navigate("/");
+ };
+
+ useEffect(() => {
+ const resizeCurrentWidth = () => {
+ setCurrentWidthWindow(window.innerWidth);
+ };
+
+ window.addEventListener("resize", resizeCurrentWidth);
+
+ return () => {
+ window.removeEventListener("resize", resizeCurrentWidth);
+ };
+ }, []);
+ return (
+
+ );
+};
+
+export default Header;
diff --git a/web/src/components/Header/Header.module.css b/web/src/components/Header/Header.module.css
index d50fde9..16219ec 100644
--- a/web/src/components/Header/Header.module.css
+++ b/web/src/components/Header/Header.module.css
@@ -1,41 +1,41 @@
.header {
- max-width: 1680px;
- padding: 0 90px;
- margin: 0 auto 103px;
- display: flex;
- justify-content: space-between;
+ max-width: 1680px;
+ padding: 0 90px;
+ margin: 0 auto 103px;
+ display: flex;
+ justify-content: space-between;
}
.header__flex-container {
- display: flex;
- align-items: center;
+ display: flex;
+ align-items: center;
}
.header__logo {
- width: 118px;
- height: 32px;
- margin-right: 60px;
+ width: 118px;
+ height: 32px;
+ margin-right: 60px;
}
@media screen and (max-width: 1100px) {
- .header {
- padding: 0 40px;
- }
+ .header {
+ padding: 0 40px;
+ }
}
@media screen and (max-width: 768px) {
- .header {
- display: block;
- }
-
- .header__flex-container {
- align-items: flex-start;
- justify-content: space-between;
- }
+ .header {
+ display: block;
+ }
+
+ .header__flex-container {
+ align-items: flex-start;
+ justify-content: space-between;
+ }
}
@media screen and (max-width: 900px) {
- .header {
- padding: 0 15px;
- }
-}
\ No newline at end of file
+ .header {
+ padding: 0 15px;
+ }
+}
diff --git a/web/src/components/LinkWithIcon/LinkWithIcon.js b/web/src/components/LinkWithIcon/LinkWithIcon.js
index 04939aa..6b79ca8 100644
--- a/web/src/components/LinkWithIcon/LinkWithIcon.js
+++ b/web/src/components/LinkWithIcon/LinkWithIcon.js
@@ -1,48 +1,53 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
-
-
-import styles from './LinkWithIcon.module.css';
-
-const LinkWithIcon = ({ color='', text, icon, iconWidth="", iconHeight="", url='/' }) => {
-
-
- const style = {
- width: "38px",
- height: "38px",
- "marginRight": "10px",
- display: "inline-block",
-
-
- backgroundPosition: "center",
- backgroundRepeat:" no-repeat",
-
- border: "1px solid #000000",
- borderRadius: "50%",
- backgroundImage: `url(${icon})`
- }
-
- const styleWhite = {
- width: "38px",
- height: "38px",
- "marginRight": "10px",
- display: "inline-block",
-
-
- backgroundPosition: "center",
- backgroundRepeat:" no-repeat",
-
- border: "1px solid #CFFFC4",
- borderRadius: "50%",
- backgroundImage: `url(${icon})`
- }
-
- return (
-
-
- )
-}
-
-export default LinkWithIcon;
\ No newline at end of file
+import React from "react";
+import { Link } from "react-router-dom";
+
+import styles from "./LinkWithIcon.module.css";
+
+const LinkWithIcon = ({
+ color = "",
+ text,
+ icon,
+ iconWidth = "",
+ iconHeight = "",
+ url = "/",
+}) => {
+ const style = {
+ width: "38px",
+ height: "38px",
+ marginRight: "10px",
+ display: "inline-block",
+
+ backgroundPosition: "center",
+ backgroundRepeat: " no-repeat",
+
+ border: "1px solid #000000",
+ borderRadius: "50%",
+ backgroundImage: `url(${icon})`,
+ };
+
+ const styleWhite = {
+ width: "38px",
+ height: "38px",
+ marginRight: "10px",
+ display: "inline-block",
+
+ backgroundPosition: "center",
+ backgroundRepeat: " no-repeat",
+
+ border: "1px solid #CFFFC4",
+ borderRadius: "50%",
+ backgroundImage: `url(${icon})`,
+ };
+
+ return (
+
+
+ );
+};
+
+export default LinkWithIcon;
diff --git a/web/src/components/LinkWithIcon/LinkWithIcon.module.css b/web/src/components/LinkWithIcon/LinkWithIcon.module.css
index 806832b..86840f2 100644
--- a/web/src/components/LinkWithIcon/LinkWithIcon.module.css
+++ b/web/src/components/LinkWithIcon/LinkWithIcon.module.css
@@ -1,28 +1,26 @@
.link-with-icon {
- display: flex;
- align-items: center;
+ display: flex;
+ align-items: center;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 19px;
- line-height: 24px;
- color: rgba(0, 0, 0, 1);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 19px;
+ line-height: 24px;
+ color: rgba(0, 0, 0, 1);
- text-decoration: none;
- transition: opacity 0.2s linear 0.3s;
+ text-decoration: none;
+ transition: opacity 0.2s linear 0.3s;
}
.link-with-icon_color_white {
- color: rgb(255, 255, 255);
+ color: rgb(255, 255, 255);
}
.link-with-icon:hover {
- opacity: 0.6;
- cursor: pointer;
+ opacity: 0.6;
+ cursor: pointer;
}
-
-
.link-with-icon__icon_color_white {
- background-image: url("../../images/dialog.svg");
- border-color: rgb(207, 255, 196);
-}
\ No newline at end of file
+ background-image: url("../../images/dialog.svg");
+ border-color: rgb(207, 255, 196);
+}
diff --git a/web/src/components/List/List.js b/web/src/components/List/List.js
index 6e1d00b..a9bb5f6 100644
--- a/web/src/components/List/List.js
+++ b/web/src/components/List/List.js
@@ -1,25 +1,21 @@
-import React from 'react';
+import React from "react";
-import Title from '../Title/Title';
+import Title from "../Title/Title";
-import styles from './List.module.css';
+import styles from "./List.module.css";
-const List = ({ title = '', social = false, children }) => {
- if (social) {
- return (
-
- )
-}
+const List = ({ title = "", social = false, children }) => {
+ if (social) {
+ return
+ );
+};
export default List;
diff --git a/web/src/components/List/List.module.css b/web/src/components/List/List.module.css
index bf56293..89ecc65 100644
--- a/web/src/components/List/List.module.css
+++ b/web/src/components/List/List.module.css
@@ -1,25 +1,25 @@
.container {
- display: flex;
- flex-direction: column;
+ display: flex;
+ flex-direction: column;
}
.list {
- margin: 0;
- margin-top: 30px;
- margin-bottom: 30px;
- padding-left: 15px;
+ margin: 0;
+ margin-top: 30px;
+ margin-bottom: 30px;
+ padding-left: 15px;
- list-style-image: url('../../images/list-image.svg');
+ list-style-image: url("../../images/list-image.svg");
}
.list_social {
- margin: 0;
- padding: 0;
- display: flex;
+ margin: 0;
+ padding: 0;
+ display: flex;
- list-style: none;
+ list-style: none;
}
.container_jc_end {
- justify-content: flex-end;
-}
\ No newline at end of file
+ justify-content: flex-end;
+}
diff --git a/web/src/components/ListItem/ListItem.module.css b/web/src/components/ListItem/ListItem.module.css
index 8b13789..e69de29 100644
--- a/web/src/components/ListItem/ListItem.module.css
+++ b/web/src/components/ListItem/ListItem.module.css
@@ -1 +0,0 @@
-
diff --git a/web/src/components/MainNavigation/MainNavigation.js b/web/src/components/MainNavigation/MainNavigation.js
index 046257e..54bb0e9 100644
--- a/web/src/components/MainNavigation/MainNavigation.js
+++ b/web/src/components/MainNavigation/MainNavigation.js
@@ -1,99 +1,154 @@
-import React, { useState } from 'react';
-import { Link, NavLink } from 'react-router-dom';
+import React, { useState } from "react";
+import { Link, NavLink } from "react-router-dom";
-import Button from '../Button/Button';
+import Button from "../Button/Button";
-import styles from './MainNavigation.module.css';
-import discord from '../../images/discord-black.svg';
-import telegram from '../../images/telegram-black.svg';
-import twitter from '../../images/twitter-black.svg';
-import youtube from '../../images/youtube-black.svg';
+import styles from "./MainNavigation.module.css";
+import discord from "../../images/discord-black.svg";
+import telegram from "../../images/telegram-black.svg";
+import twitter from "../../images/twitter-black.svg";
+import youtube from "../../images/youtube-black.svg";
const MainNavigation = ({ width }) => {
- const [active, setActive] = useState('dao');
+ const [active, setActive] = useState("dao");
- const [IsOpenMenu, setIsOpenMenu] = useState(false);
+ const [IsOpenMenu, setIsOpenMenu] = useState(false);
- const handleOpenMenu = ()=> {
- setIsOpenMenu(true);
- }
+ const handleOpenMenu = () => {
+ setIsOpenMenu(true);
+ };
- const handleCloseMenu = ()=> {
- setIsOpenMenu(false);
- }
-
+ const handleCloseMenu = () => {
+ setIsOpenMenu(false);
+ };
- // eslint-disable-next-line no-lone-blocks
- return (<>
- {width < 769
- ?
-
- }
- >)
-
+ // eslint-disable-next-line no-lone-blocks
+ return (
+ <>
+ {width < 769 ? (
+
+ )}
+ >
+ );
+};
-
-}
-
-export default MainNavigation;
\ No newline at end of file
+export default MainNavigation;
diff --git a/web/src/components/MainNavigation/MainNavigation.module.css b/web/src/components/MainNavigation/MainNavigation.module.css
index 1b72394..7ab1bdf 100644
--- a/web/src/components/MainNavigation/MainNavigation.module.css
+++ b/web/src/components/MainNavigation/MainNavigation.module.css
@@ -1,200 +1,200 @@
.nav__list {
- margin: 0;
- padding: 0;
- display: flex;
+ margin: 0;
+ padding: 0;
+ display: flex;
- list-style: none;
+ list-style: none;
}
.burger {
- position: relative;
+ position: relative;
- width: 28px;
- height: 16px;
- padding: 0;
+ width: 28px;
+ height: 16px;
+ padding: 0;
- background-color: inherit;
+ background-color: inherit;
- border: none;
+ border: none;
}
.overlay {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 500;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 500;
- width: 100%;
- height: calc(var(--vh) * 100);
+ width: 100%;
+ height: calc(var(--vh) * 100);
- visibility: hidden;
- opacity: 0;
- background-color: #fff;
+ visibility: hidden;
+ opacity: 0;
+ background-color: #fff;
- overflow-y: hidden;
- transition: all 0.7s linear 0.2s;
+ overflow-y: hidden;
+ transition: all 0.7s linear 0.2s;
}
.overlay_active {
- visibility: visible;
- opacity: 1;
+ visibility: visible;
+ opacity: 1;
}
.body {
- position: absolute;
- top:0;
- right: 0;
- z-index: 50033;
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 50033;
- width: fit-content;
- top: 50%;
- left: 50%;
+ width: fit-content;
+ top: 50%;
+ left: 50%;
- transform: translate(-50%, -50%);
-
- background-color: rgb(255, 255, 255);
+ transform: translate(-50%, -50%);
+ background-color: rgb(255, 255, 255);
}
.close {
- position: absolute;
- top: 2rem;
- right: 3rem;
- width: 21px;
- height: 21px;
- background-color: transparent;
- border: none;
-}
-
+ position: absolute;
+ top: 2rem;
+ right: 3rem;
+ width: 21px;
+ height: 21px;
+ background-color: transparent;
+ border: none;
+}
+
.close::before,
.close::after {
- content: "";
- position: absolute;
- top: 18px;
- left: 0;
- width: 100%;
- height: 3px;
- background-color: rgb(0, 0, 0);
+ content: "";
+ position: absolute;
+ top: 18px;
+ left: 0;
+ width: 100%;
+ height: 3px;
+ background-color: rgb(0, 0, 0);
- transition: background-color 0.5s, linear, 0.5s;
+ transition:
+ background-color 0.5s,
+ linear,
+ 0.5s;
}
-
+
.close::before {
- transform: rotate(45deg);
+ transform: rotate(45deg);
}
-
+
.close::after {
- transform: rotate(-45deg);
+ transform: rotate(-45deg);
}
-
+
.close:hover {
- cursor: pointer;
+ cursor: pointer;
}
-
+
.close:hover.close::before,
.close:hover.close::after,
.close:focus.close::before,
.close:focus.close::after {
- background-color: rgba(0, 0, 0, 0.6);
- outline: none;
+ background-color: rgba(0, 0, 0, 0.6);
+ outline: none;
}
.burger::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- z-index:10;
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 10;
- width: 28px;
- height: 3px;
+ width: 28px;
+ height: 3px;
- background-color: rgb(255, 255, 255);
- box-shadow: 0 16px 0 0 rgb(255, 255, 255);
+ background-color: rgb(255, 255, 255);
+ box-shadow: 0 16px 0 0 rgb(255, 255, 255);
}
.burger__list {
- margin: 0;
- margin-bottom: 52px;
- padding: 0;
+ margin: 0;
+ margin-bottom: 52px;
+ padding: 0;
- list-style: none;
+ list-style: none;
}
.burger__item {
- margin-bottom: 42px;
+ margin-bottom: 42px;
}
.burger__item:last-child {
- margin-bottom: 0;
+ margin-bottom: 0;
}
.burger__link {
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 21px;
- line-height: 30px;
- color: rgb(0, 0, 0);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 21px;
+ line-height: 30px;
+ color: rgb(0, 0, 0);
- letter-spacing: 0.6;
- text-decoration: none;
+ letter-spacing: 0.6;
+ text-decoration: none;
}
.burger__socials {
- display: flex;
- margin: 0;
- margin-top: 162px;
- padding: 0;
+ display: flex;
+ margin: 0;
+ margin-top: 162px;
+ padding: 0;
- list-style: none;
+ list-style: none;
}
.burger__social {
- margin-right: 30px;
+ margin-right: 30px;
}
.burger__social:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.nav__link:hover {
- color: rgba(207, 255, 196, 0.7);
- text-decoration: underline;
- cursor: pointer;
+ color: rgba(207, 255, 196, 0.7);
+ text-decoration: underline;
+ cursor: pointer;
}
-
-
.nav__item {
- margin-right: 40px;
+ margin-right: 40px;
}
.nav__item:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.nav__link {
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 15px;
- line-height: 21px;
- color: rgb(255, 255, 255);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 15px;
+ line-height: 21px;
+ color: rgb(255, 255, 255);
- letter-spacing: 0.2px;
- text-decoration: none;
- transition: all 0.2s linear 0.4s;
+ letter-spacing: 0.2px;
+ text-decoration: none;
+ transition: all 0.2s linear 0.4s;
}
.nav__link:hover {
- color: rgba(207, 255, 196, 0.7);
- text-decoration: underline;
- cursor: pointer;
+ color: rgba(207, 255, 196, 0.7);
+ text-decoration: underline;
+ cursor: pointer;
}
.nav__link_active {
- color: rgba(207, 255, 196, 1);
+ color: rgba(207, 255, 196, 1);
}
.nav__link_active:hover {
- color: rgba(207, 255, 196, 1);
- text-decoration: none;
- cursor: default;
-}
\ No newline at end of file
+ color: rgba(207, 255, 196, 1);
+ text-decoration: none;
+ cursor: default;
+}
diff --git a/web/src/components/Progress/Progress.js b/web/src/components/Progress/Progress.js
index 774bf64..02eb2ef 100644
--- a/web/src/components/Progress/Progress.js
+++ b/web/src/components/Progress/Progress.js
@@ -1,32 +1,55 @@
-import React, { useEffect } from 'react';
-import { useLocation } from 'react-router-dom';
+import React, { useEffect } from "react";
+import { useLocation } from "react-router-dom";
-import styles from './Progress.module.css';
+import styles from "./Progress.module.css";
const Progress = () => {
+ const location = useLocation();
- const location = useLocation();
+ useEffect(() => {
+ console.log(location);
+ }, []);
- useEffect(() => {
- console.log(location)
- }, []);
+ return (
+
- )
-}
-
-export default Progress;
\ No newline at end of file
+export default Progress;
diff --git a/web/src/components/Progress/Progress.module.css b/web/src/components/Progress/Progress.module.css
index 5dc31fc..e978559 100644
--- a/web/src/components/Progress/Progress.module.css
+++ b/web/src/components/Progress/Progress.module.css
@@ -1,103 +1,95 @@
.progress-list {
- display: flex;
- margin: 0;
- padding: 0;
+ display: flex;
+ margin: 0;
+ padding: 0;
- list-style: none;
+ list-style: none;
- overflow: hidden;
+ overflow: hidden;
}
.progress-list__item {
- position: relative;
+ position: relative;
- margin-right: 10px;
- padding-left: 33px;
- display: flex;
- align-items: center;
+ margin-right: 10px;
+ padding-left: 33px;
+ display: flex;
+ align-items: center;
- opacity: 0.4;
+ opacity: 0.4;
}
.progress-item_current {
- opacity: 1;
+ opacity: 1;
}
.progress-list__item:first-child {
- padding-left: 0;
+ padding-left: 0;
}
.progress-list__item:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.progress-list__caption {
- position: relative;
+ position: relative;
- padding-left: 21px;
+ padding-left: 21px;
- font-family: "Hauora_Bold";
- font-size: 10px;
- line-height: 16px;
- color: rgb(255,255,255);
+ font-family: "Hauora_Bold";
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(255, 255, 255);
- letter-spacing: 1px;
- text-transform: uppercase;
+ letter-spacing: 1px;
+ text-transform: uppercase;
}
.progress-list__caption_done {
- color: rgb(207, 255, 196);
+ color: rgb(207, 255, 196);
}
-
.progress-list__item::before {
- content: '';
- position: absolute;
+ content: "";
+ position: absolute;
- left: 0;
+ left: 0;
- width: 21px;
- height: 2px;
+ width: 21px;
+ height: 2px;
- background-color: rgb(255,255,255);
- border-radius: 43px;
+ background-color: rgb(255, 255, 255);
+ border-radius: 43px;
}
.progress-list__item:first-child::before {
- opacity: 0;
+ opacity: 0;
}
-.progress-list__item_done::before {
- background-color: rgb(207, 255, 196);
+.progress-list__item_done::before {
+ background-color: rgb(207, 255, 196);
}
.progress-list__caption::before {
- content: '';
- position: absolute;
+ content: "";
+ position: absolute;
- top: 1px;
- left: 0;
+ top: 1px;
+ left: 0;
- width: 12px;
- height: 12px;
+ width: 12px;
+ height: 12px;
- border: 2px solid rgb(255,255,255);
- border-radius: 50%;
- box-sizing: border-box;
+ border: 2px solid rgb(255, 255, 255);
+ border-radius: 50%;
+ box-sizing: border-box;
}
.progress-list__caption_done::before {
-
-
- background-color:rgb(207, 255, 196);
- background-image: url("../../images/check.svg");
- background-repeat: no-repeat;
- background-position: center;
+ background-color: rgb(207, 255, 196);
+ background-image: url("../../images/check.svg");
+ background-repeat: no-repeat;
+ background-position: center;
- border: none;
+ border: none;
}
-
-
-
-
-
diff --git a/web/src/components/Proposal/Proposal.js b/web/src/components/Proposal/Proposal.js
index 643cac4..e499692 100644
--- a/web/src/components/Proposal/Proposal.js
+++ b/web/src/components/Proposal/Proposal.js
@@ -1,30 +1,39 @@
-import React from 'react';
+import React from "react";
-import RatingRange from '../../components/RatingRange/RatingRange';
+import RatingRange from "../../components/RatingRange/RatingRange";
-import styles from './Proposal.module.css';
+import styles from "./Proposal.module.css";
const Proposal = ({ card }) => {
+ const statusStile =
+ card.status === "failed"
+ ? styles.card__status_failed
+ : card.status === "executed"
+ ? styles.card__status_executed
+ : "";
- const statusStile =
- card.status === 'failed' ? styles.card__status_failed
- : card.status === 'executed' ? styles.card__status_executed
- : ''
+ return (
+
- )
-}
-
-export default Proposal;
\ No newline at end of file
+export default Proposal;
diff --git a/web/src/components/Proposal/Proposal.module.css b/web/src/components/Proposal/Proposal.module.css
index c564919..70e6c57 100644
--- a/web/src/components/Proposal/Proposal.module.css
+++ b/web/src/components/Proposal/Proposal.module.css
@@ -1,155 +1,147 @@
.card {
- padding: 21px 42px 26px 30px;
+ padding: 21px 42px 26px 30px;
- background-color: rgb(37, 39, 43);
+ background-color: rgb(37, 39, 43);
- border-radius: 20px;
+ border-radius: 20px;
}
.card_status_failed {
- background-color: rgba(37, 39, 43, 0.5);
+ background-color: rgba(37, 39, 43, 0.5);
}
.flex-container {
- margin-bottom: 15px;
- display: flex;
+ margin-bottom: 15px;
+ display: flex;
- justify-content: space-between;
+ justify-content: space-between;
}
.card__rating {
- align-self: center;
+ align-self: center;
}
.card__text {
+ width: 63.13%;
- width: 63.13%;
-
- font-family: "Hauora_Bold", sans-serif;
- font-size: 19px;
- line-height: 24px;
- color: rgb(204, 204, 204);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 19px;
+ line-height: 24px;
+ color: rgb(204, 204, 204);
}
.card__text_status_failed {
- color: rgba(196, 196, 196, 0.5);
+ color: rgba(196, 196, 196, 0.5);
}
.card__status {
- padding: 2px 7px;
+ padding: 2px 7px;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(255, 255, 255);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(255, 255, 255);
- border: 1px solid rgb(255, 255, 255);
- border-radius: 7px;
- text-transform: uppercase;
- letter-spacing: 1px;
+ border: 1px solid rgb(255, 255, 255);
+ border-radius: 7px;
+ text-transform: uppercase;
+ letter-spacing: 1px;
}
.card__status_failed {
- color: rgba(196, 196, 196, 0.5);
+ color: rgba(196, 196, 196, 0.5);
- border-color: rgba(196, 196, 196, 0.5);
+ border-color: rgba(196, 196, 196, 0.5);
}
.card__status_executed {
- position: relative;
+ position: relative;
- padding-left: 24px;
- padding-top: 5px;
- padding-bottom: 5px;
+ padding-left: 24px;
+ padding-top: 5px;
+ padding-bottom: 5px;
- color: rgba(207, 255, 196, 1);
+ color: rgba(207, 255, 196, 1);
- border-color: rgba(207, 255, 196, 1);
+ border-color: rgba(207, 255, 196, 1);
}
.card__status_executed::before {
- content: '';
+ content: "";
- position: absolute;
- top: 5px;
- left: 4px;
+ position: absolute;
+ top: 5px;
+ left: 4px;
- width: 13px;
- height: 13px;
+ width: 13px;
+ height: 13px;
- background-color: rgba(207, 255, 196, 1);
- background-image: url("../../images/check.svg");
- background-position: center;
- background-repeat: no-repeat;
+ background-color: rgba(207, 255, 196, 1);
+ background-image: url("../../images/check.svg");
+ background-position: center;
+ background-repeat: no-repeat;
- border-radius: 50%;
+ border-radius: 50%;
}
.card__number {
- padding: 0 11px;
+ padding: 0 11px;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(255, 255, 255);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(255, 255, 255);
- text-transform: uppercase;
- border-right: 1px solid rgb(255, 255, 255);
- letter-spacing: 1px;
+ text-transform: uppercase;
+ border-right: 1px solid rgb(255, 255, 255);
+ letter-spacing: 1px;
}
.card__date {
- padding-left: 11px;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(255, 255, 255);
-
-
- text-transform: uppercase;
- letter-spacing: 1px;
+ padding-left: 11px;
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(255, 255, 255);
+
+ text-transform: uppercase;
+ letter-spacing: 1px;
}
@media screen and (max-width: 1060px) {
- .card {
- padding-left: 15px;
- padding-right: 15px;
- }
-
+ .card {
+ padding-left: 15px;
+ padding-right: 15px;
+ }
}
@media screen and (max-width: 1005px) {
- .card__text {
-
- width: 60%;
-
- font-family: "Hauora_Bold", sans-serif;
- font-size: 19px;
- line-height: 24px;
- }
+ .card__text {
+ width: 60%;
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 19px;
+ line-height: 24px;
+ }
}
@media screen and (max-width: 750px) {
-
- .card {
- padding-left: 40px;
- padding-right: 30px;
- }
- .flex-container {
- display: block;
- }
-
- .card__text {
- width: 100%;
- }
+ .card {
+ padding-left: 40px;
+ padding-right: 30px;
+ }
+ .flex-container {
+ display: block;
+ }
+
+ .card__text {
+ width: 100%;
+ }
}
@media screen and (max-width: 750px) {
-
- .card {
- padding-left: 5%;
- padding-right: 5%;
-
- }
-}
\ No newline at end of file
+ .card {
+ padding-left: 5%;
+ padding-right: 5%;
+ }
+}
diff --git a/web/src/components/RatingRange/RatingRange.js b/web/src/components/RatingRange/RatingRange.js
index 9edccb0..088a2d9 100644
--- a/web/src/components/RatingRange/RatingRange.js
+++ b/web/src/components/RatingRange/RatingRange.js
@@ -1,50 +1,53 @@
-import React, { useCallback, useEffect, useState } from 'react';
+import React, { useCallback, useEffect, useState } from "react";
+import { roundNumber } from "../../utils/utils";
-import { roundNumber } from '../../utils/utils';
-
-import styles from './RatingRange.module.css';
+import styles from "./RatingRange.module.css";
const RatingRange = ({ nice, bad }) => {
+ const [width, setWidth] = useState("51%");
-const [width, setWidth] = useState('51%')
-
- const stylesIndicator = useCallback(() => {
- if (nice > 0) {
- return String(nice / (nice + bad) * 100) + "%"
- }
- return '1%'
- }, [bad, nice])
+ const stylesIndicator = useCallback(() => {
+ if (nice > 0) {
+ return String((nice / (nice + bad)) * 100) + "%";
+ }
+ return "1%";
+ }, [bad, nice]);
-useEffect(() => {
- setWidth(stylesIndicator())
-}, [stylesIndicator])
+ useEffect(() => {
+ setWidth(stylesIndicator());
+ }, [stylesIndicator]);
- const style = {
- position: "absolute",
+ const style = {
+ position: "absolute",
top: 0,
left: 0,
- "zIndex": 10,
+ zIndex: 10,
height: "3px",
width: `${width}`,
- "backgroundColor": "#CFFFC4",
- }
-
-
- return(
-
-
-
{roundNumber(nice)}
-
-
-
-
{roundNumber(bad)}
-
-
{roundNumber(nice + bad)} votes
+ backgroundColor: "#CFFFC4",
+ };
+
+ return (
+
+
+
+ {roundNumber(nice)}
+
+
+
- )
-}
-
-export default RatingRange;
\ No newline at end of file
+
+ {roundNumber(bad)}
+
+
+
+ {roundNumber(nice + bad)} votes
+
+
+ );
+};
+
+export default RatingRange;
diff --git a/web/src/components/RatingRange/RatingRange.module.css b/web/src/components/RatingRange/RatingRange.module.css
index 9dbba00..d264348 100644
--- a/web/src/components/RatingRange/RatingRange.module.css
+++ b/web/src/components/RatingRange/RatingRange.module.css
@@ -1,74 +1,72 @@
.range {
- display: flex;
+ display: flex;
}
.container {
- min-width: 305px;
+ min-width: 305px;
}
.count {
- font-family: "Hauora_Bold", sans-serif;
+ font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(207, 255, 196);
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(207, 255, 196);
- letter-spacing: 1px;
- text-transform: uppercase;
+ letter-spacing: 1px;
+ text-transform: uppercase;
}
.count_nice {
- margin-right: 7px;
+ margin-right: 7px;
}
.range__body {
- position: relative;
+ position: relative;
- align-self: center;
- width: 75%;
- height: 3px;
+ align-self: center;
+ width: 75%;
+ height: 3px;
- background-color:rgb(220, 32, 32);
+ background-color: rgb(220, 32, 32);
}
-
.count_bad {
- margin-left: 10px;
+ margin-left: 10px;
- color: rgb(220, 32, 32);
+ color: rgb(220, 32, 32);
}
.count_total {
- margin-top: 25px;
- margin-left: 37%;
-
- color: rgb(255, 255, 255);
+ margin-top: 25px;
+ margin-left: 37%;
+ color: rgb(255, 255, 255);
}
@media screen and (max-width: 1245px) {
- .range__body {
- width: 60%;
- }
- .container {
- min-width: 200px;
- }
+ .range__body {
+ width: 60%;
+ }
+ .container {
+ min-width: 200px;
+ }
}
@media screen and (max-width: 1005px) {
- .container {
- width: 100%
- }
- /* .range__body {
+ .container {
+ width: 100%;
+ }
+ /* .range__body {
width: 80%;
} */
}
@media screen and (max-width: 750px) {
- .range {
- justify-content: center;
- }
- .range__body {
- width: 75%;
- }
-}
\ No newline at end of file
+ .range {
+ justify-content: center;
+ }
+ .range__body {
+ width: 75%;
+ }
+}
diff --git a/web/src/components/Text/Text.js b/web/src/components/Text/Text.js
index f5de8db..47244bc 100644
--- a/web/src/components/Text/Text.js
+++ b/web/src/components/Text/Text.js
@@ -1,17 +1,14 @@
-import React from 'react';
+import React from "react";
-import styles from './Text.module.css';
+import styles from "./Text.module.css";
-const Text = ({ type, color='default', children }) => {
-
- const textStyle = `
+const Text = ({ type, color = "default", children }) => {
+ const textStyle = `
${styles.text}
- ${type === 'large' ? styles.text_type_large : type === 'mid' ? styles.text_type_mid : type === 'default' ? styles.text_type_default : type === 'small' ? styles.text_type_small : ''}
- ${color === 'default' ? styles.text_color_default : color === 'black' ? styles.text_color_black : color === 'grey' ? styles.text_color_grey : ''}
- `
- return (
-
{children}
- )
-}
+ ${type === "large" ? styles.text_type_large : type === "mid" ? styles.text_type_mid : type === "default" ? styles.text_type_default : type === "small" ? styles.text_type_small : ""}
+ ${color === "default" ? styles.text_color_default : color === "black" ? styles.text_color_black : color === "grey" ? styles.text_color_grey : ""}
+ `;
+ return
{children}
;
+};
export default Text;
diff --git a/web/src/components/Text/Text.module.css b/web/src/components/Text/Text.module.css
index 8849f71..00815ab 100644
--- a/web/src/components/Text/Text.module.css
+++ b/web/src/components/Text/Text.module.css
@@ -1,47 +1,47 @@
.text {
- margin: 0;
- padding: 0;
+ margin: 0;
+ padding: 0;
- font-family: "Hauora_Regular";
+ font-family: "Hauora_Regular";
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
.text_type_large {
- font-size: 24px;
- line-height: 32px;
+ font-size: 24px;
+ line-height: 32px;
}
.text_type_mid {
- font-size: 18px;
- line-height: 24px;
+ font-size: 18px;
+ line-height: 24px;
}
.text_type_default {
- font-size: 15px;
- line-height: 21px;
+ font-size: 15px;
+ line-height: 21px;
}
.text_type_small {
- font-size: 13px;
- line-height: 18px;
+ font-size: 13px;
+ line-height: 18px;
}
.text_color_default {
- color: rgb(255, 255, 255);
+ color: rgb(255, 255, 255);
}
.text_color_black {
- color: rgb(0, 0, 0);
+ color: rgb(0, 0, 0);
}
.text_color_grey {
- color: rgb(204, 204, 204);
+ color: rgb(204, 204, 204);
}
-@media screen and (max-width:768px) {
- .text_type_large {
- font-size: 21px;
- line-height: 30px;
- }
-}
\ No newline at end of file
+@media screen and (max-width: 768px) {
+ .text_type_large {
+ font-size: 21px;
+ line-height: 30px;
+ }
+}
diff --git a/web/src/components/TextArea/TextArea.js b/web/src/components/TextArea/TextArea.js
index 895a764..485e83e 100644
--- a/web/src/components/TextArea/TextArea.js
+++ b/web/src/components/TextArea/TextArea.js
@@ -1,19 +1,18 @@
-import React from 'react';
-import styles from './TextArea.module.css';
+import React from "react";
+import styles from "./TextArea.module.css";
+const TextArea = ({ name, rows = "1", disabled = false, onChange }) => {
+ const handleChange = onChange;
-const TextArea = ({ name, rows = "1", disabled=false, onChange }) => {
- const handleChange = onChange
+ return (
+
+ );
+};
- return (
-
- )
-}
-
-export default TextArea;
\ No newline at end of file
+export default TextArea;
diff --git a/web/src/components/TextArea/TextArea.module.css b/web/src/components/TextArea/TextArea.module.css
index ba70e72..52a5683 100644
--- a/web/src/components/TextArea/TextArea.module.css
+++ b/web/src/components/TextArea/TextArea.module.css
@@ -1,23 +1,23 @@
.area {
- width: 100%;
- padding: 14px;
+ width: 100%;
+ padding: 14px;
- font-family: 'Roboto_Regular' sans-serif;
- font-size: 15px;
- line-height: 18px;
- color: rgb(0, 0, 0);
+ font-family: "Roboto_Regular" sans-serif;
+ font-size: 15px;
+ line-height: 18px;
+ color: rgb(0, 0, 0);
- background-color: rgba(196, 196, 196, 0.5);
+ background-color: rgba(196, 196, 196, 0.5);
- border-radius: 5px;
- overflow-y: scroll;
- resize: none;
+ border-radius: 5px;
+ overflow-y: scroll;
+ resize: none;
}
.area::-webkit-scrollbar {
- width: 0px;
- background-color: rgba(196, 196, 196, 0.5);
- }
- .area::-webkit-scrollbar-thumb {
- background-color: rgb(196, 196, 196);
- }
\ No newline at end of file
+ width: 0px;
+ background-color: rgba(196, 196, 196, 0.5);
+}
+.area::-webkit-scrollbar-thumb {
+ background-color: rgb(196, 196, 196);
+}
diff --git a/web/src/components/TimeUntilReduce/TimeUntilReduce.js b/web/src/components/TimeUntilReduce/TimeUntilReduce.js
index 7764ddf..a508942 100644
--- a/web/src/components/TimeUntilReduce/TimeUntilReduce.js
+++ b/web/src/components/TimeUntilReduce/TimeUntilReduce.js
@@ -1,17 +1,31 @@
-import { useSelector } from "react-redux"
-import { useCountdown } from "../../hooks/useCountdown"
-import DefinitionList from "../DefinitionList/DefinitionList"
+import { useSelector } from "react-redux";
+import { useCountdown } from "../../hooks/useCountdown";
+import DefinitionList from "../DefinitionList/DefinitionList";
const TimeUntilReduce = () => {
- const { nextHalvePeriod } = useSelector(state => state.distributor)
- const [ timer ] = useCountdown(nextHalvePeriod || 0)
+ const { nextHalvePeriod } = useSelector((state) => state.distributor);
+ const [timer] = useCountdown(nextHalvePeriod || 0);
- // loading
- if (!nextHalvePeriod) {
- return
- }
+ // loading
+ if (!nextHalvePeriod) {
+ return (
+
+ );
+ }
- return
-}
+ return (
+
+ );
+};
-export default TimeUntilReduce
\ No newline at end of file
+export default TimeUntilReduce;
diff --git a/web/src/components/Title/Title.js b/web/src/components/Title/Title.js
index 770040d..2157429 100644
--- a/web/src/components/Title/Title.js
+++ b/web/src/components/Title/Title.js
@@ -1,38 +1,40 @@
-import React from 'react';
-
-import styles from './Title.module.css';
-
-const Title = ({ size='default', text, type, color='' }) => {
-
- const styleSize = size === 'large' ? styles.title_size_large : size === 'big' ? styles.title_size_big : size === 'medium' ? styles.title_size_medium : size === 'default' ? styles.title_size_default : size === 'small' ? styles.title_size_small : '';
-
- const styleColor = color === 'black' ? styles.title_color_black : '';
-
-
-
- return (<>
- {
- type === 'h1'
- ?
-
{text}
-
- : type === 'h2'
- ?
-
{text}
-
- : type === 'h3'
- ?
-
{text}
- : type === 'h4'
- ?
-
{text}
- : type === 'h5'
- ?
-
{text}
- : <>>
- }
-
- >)
-}
+import React from "react";
+
+import styles from "./Title.module.css";
+
+const Title = ({ size = "default", text, type, color = "" }) => {
+ const styleSize =
+ size === "large"
+ ? styles.title_size_large
+ : size === "big"
+ ? styles.title_size_big
+ : size === "medium"
+ ? styles.title_size_medium
+ : size === "default"
+ ? styles.title_size_default
+ : size === "small"
+ ? styles.title_size_small
+ : "";
+
+ const styleColor = color === "black" ? styles.title_color_black : "";
+
+ return (
+ <>
+ {type === "h1" ? (
+
{text}
+ ) : type === "h2" ? (
+
{text}
+ ) : type === "h3" ? (
+
{text}
+ ) : type === "h4" ? (
+
{text}
+ ) : type === "h5" ? (
+
{text}
+ ) : (
+ <>>
+ )}
+ >
+ );
+};
export default Title;
diff --git a/web/src/components/Title/Title.module.css b/web/src/components/Title/Title.module.css
index fee0103..b698f51 100644
--- a/web/src/components/Title/Title.module.css
+++ b/web/src/components/Title/Title.module.css
@@ -1,77 +1,77 @@
.title {
- margin: 0;
+ margin: 0;
- font-family: "Hauora_Regular";
-
- color: rgb(255, 255, 255);
+ font-family: "Hauora_Regular";
- letter-spacing: 1px;
+ color: rgb(255, 255, 255);
+
+ letter-spacing: 1px;
}
.title_size_large {
- font-size: 80px;
- line-height: 88px;
+ font-size: 80px;
+ line-height: 88px;
}
.title_size_big {
- font-size: 60px;
- line-height: 70px;
+ font-size: 60px;
+ line-height: 70px;
}
.title_size_medium {
- font-size: 42px;
- line-height: 50px;
+ font-size: 42px;
+ line-height: 50px;
}
.title_size_default {
- font-size: 30px;
- line-height: 36px;
+ font-size: 30px;
+ line-height: 36px;
}
.title_size_small {
- font-size: 19px;
- line-height: 24px;
+ font-size: 19px;
+ line-height: 24px;
}
.title_color_black {
- color: rgb(0, 0, 0);
+ color: rgb(0, 0, 0);
}
-@media screen and (max-width: 1366px) {
- .title_size_large {
- font-size: 60px;
- line-height: 70px;
- }
+@media screen and (max-width: 1366px) {
+ .title_size_large {
+ font-size: 60px;
+ line-height: 70px;
+ }
}
-@media screen and (max-width: 900px) {
- .title_size_large {
- font-size: 60px;
- line-height: 70px;
- }
- .title_size_big {
- font-size: 42px;
- line-height: 50px;
- }
+@media screen and (max-width: 900px) {
+ .title_size_large {
+ font-size: 60px;
+ line-height: 70px;
+ }
+ .title_size_big {
+ font-size: 42px;
+ line-height: 50px;
+ }
}
-@media screen and (max-width: 600px) {
- .title_size_large {
- font-size: 42px;
- line-height: 50px;
- }
- .title_size_big {
- font-size: 30px;
- line-height: 36px;
- }
+@media screen and (max-width: 600px) {
+ .title_size_large {
+ font-size: 42px;
+ line-height: 50px;
+ }
+ .title_size_big {
+ font-size: 30px;
+ line-height: 36px;
+ }
- .title_size_medium {
- font-size: 30px;
- line-height: 36px;
- }
+ .title_size_medium {
+ font-size: 30px;
+ line-height: 36px;
+ }
- .title_size_default {
- font-size: 19px;
- line-height: 23px;
- }
-}
\ No newline at end of file
+ .title_size_default {
+ font-size: 19px;
+ line-height: 23px;
+ }
+}
diff --git a/web/src/components/Url/Url.js b/web/src/components/Url/Url.js
index 1b1dce8..404847c 100644
--- a/web/src/components/Url/Url.js
+++ b/web/src/components/Url/Url.js
@@ -1,12 +1,17 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
+import React from "react";
+import { Link } from "react-router-dom";
-import styles from './Url.module.css';
+import styles from "./Url.module.css";
-const Url = ({ text, color='' }) => {
- return (
-
{text}
- )
-}
+const Url = ({ text, color = "" }) => {
+ return (
+
+ {text}
+
+ );
+};
-export default Url;
\ No newline at end of file
+export default Url;
diff --git a/web/src/components/Url/Url.module.css b/web/src/components/Url/Url.module.css
index 30a5695..dbfebea 100644
--- a/web/src/components/Url/Url.module.css
+++ b/web/src/components/Url/Url.module.css
@@ -1,26 +1,26 @@
.url {
- font-family: "Hauora_Bold";
- font-size: 15px;
- line-height: 21px;
- color: rgba(255, 255, 255, 1);
+ font-family: "Hauora_Bold";
+ font-size: 15px;
+ line-height: 21px;
+ color: rgba(255, 255, 255, 1);
- text-decoration: none;
- letter-spacing: 0.2px;
- border-bottom: 2px solid rgba(207, 255, 196, 1);
+ text-decoration: none;
+ letter-spacing: 0.2px;
+ border-bottom: 2px solid rgba(207, 255, 196, 1);
}
.url_color_black {
- color: rgb(0, 0, 0);
- border-bottom: 2px solid rgba(0, 0, 0, 1);
+ color: rgb(0, 0, 0);
+ border-bottom: 2px solid rgba(0, 0, 0, 1);
}
.url:hover {
- color: rgb(255, 255, 255, 0.6);
- cursor: pointer;
- border-bottom: 2px solid rgba(207, 255, 196, 0.6);
+ color: rgb(255, 255, 255, 0.6);
+ cursor: pointer;
+ border-bottom: 2px solid rgba(207, 255, 196, 0.6);
}
.url_color_black:hover {
- border-bottom: 2px solid rgba(0, 0, 0, 0.6);
- color: rgb(0, 0, 0, 0.6);
-}
\ No newline at end of file
+ border-bottom: 2px solid rgba(0, 0, 0, 0.6);
+ color: rgb(0, 0, 0, 0.6);
+}
diff --git a/web/src/components/WalletInfo/WalletInfo.js b/web/src/components/WalletInfo/WalletInfo.js
index 6e7ea48..2b8ea87 100644
--- a/web/src/components/WalletInfo/WalletInfo.js
+++ b/web/src/components/WalletInfo/WalletInfo.js
@@ -1,14 +1,14 @@
-import React from 'react';
+import React from "react";
-import styles from './WalletInfo.module.css';
+import styles from "./WalletInfo.module.css";
-const WalletInfo = ({ wallet='', account='' }) => {
- return (
-
- - {wallet}
- - {account}
-
- )
-}
+const WalletInfo = ({ wallet = "", account = "" }) => {
+ return (
+
+ - {wallet}
+ - {account}
+
+ );
+};
-export default WalletInfo;
\ No newline at end of file
+export default WalletInfo;
diff --git a/web/src/components/WalletInfo/WalletInfo.module.css b/web/src/components/WalletInfo/WalletInfo.module.css
index eb8b6fe..0dba2c9 100644
--- a/web/src/components/WalletInfo/WalletInfo.module.css
+++ b/web/src/components/WalletInfo/WalletInfo.module.css
@@ -1,38 +1,38 @@
.wallet {
- padding: 5px 11px;
- display: flex;
+ padding: 5px 11px;
+ display: flex;
- background-color: rgb(255, 255, 255);
+ background-color: rgb(255, 255, 255);
- border-radius: 5px;
+ border-radius: 5px;
}
.wallet__name {
- margin: 0;
- padding: 0;
- padding-right: 16px;
-
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(0, 0, 0);
-
- text-transform: uppercase;
- letter-spacing: 1px;
- border-right: 1px solid rgba(0, 0, 0, 0.5)
+ margin: 0;
+ padding: 0;
+ padding-right: 16px;
+
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(0, 0, 0);
+
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ border-right: 1px solid rgba(0, 0, 0, 0.5);
}
.wallet__account {
- margin: 0;
- padding: 0;
- padding-left: 16px;
-
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgb(0, 0, 0);
-
- text-transform: uppercase;
- letter-spacing: 1px;
- border-left: 1px solid rgba(0, 0, 0, 0.5)
-}
\ No newline at end of file
+ margin: 0;
+ padding: 0;
+ padding-left: 16px;
+
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgb(0, 0, 0);
+
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ border-left: 1px solid rgba(0, 0, 0, 0.5);
+}
diff --git a/web/src/constants/index.js b/web/src/constants/index.js
index ff7f35c..61d5539 100644
--- a/web/src/constants/index.js
+++ b/web/src/constants/index.js
@@ -1,3 +1,3 @@
-export * from './addresses'
-export * from './chains'
-export * from './statuses'
\ No newline at end of file
+export * from "./addresses";
+export * from "./chains";
+export * from "./statuses";
diff --git a/web/src/constants/proof.json b/web/src/constants/proof.json
index 36ec647..a37e830 100644
--- a/web/src/constants/proof.json
+++ b/web/src/constants/proof.json
@@ -1 +1,21 @@
-{"merkleProof":["0x701c84afde3d3ddeb253ac61b7c6aa8988bbb17bec0e7ab0eadff49bc73c1401","0x3a28792bf42a488e2101f0756b0a9b0d76fca209b8f0c54d71b37687006cd4e4","0x826365b123a28788e95ad3aedd62e3754f984ca5fd5b5dd8d69044372ac339f7","0x060db2fd01d7b69055b36e8bfdfdfae8d360ff4f82476a5b4fbaa4024ba01d62","0x97638f6e7fa76cda2534cd8d11b2ba98e1dc7de3696dae76ccff8ba9bd12a972","0x8134f297cef3ae5bd5adc505ad7c299f5d7ff5ba7a58a8f5f9e40af4ebe10ab4","0x04d5963fce386cae017b6d6ec30db7e3cfe3716ccb416a3fded6ec52ff0ed09c"],"signature":"0x1d93c6edb4904e95bfaeb73db117b71d6c2643b3a44ac6edaf468711447f68ea26eb2f88d6c7d467b39405428a022915855c9bef5d679ee5e1e76071b4c8f9461c","leaf":{"type":"Buffer","data":[165,24,88,44,147,251,39,48,236,195,183,162,42,165,33,205,202,87,66,122,253,186,199,110,230,253,157,251,51,141,71,50]},"publicKey":"0x3B0Cbd99ED2CC8d36c73F56dB56000562b7A0ff1","userId":74}
\ No newline at end of file
+{
+ "merkleProof": [
+ "0x701c84afde3d3ddeb253ac61b7c6aa8988bbb17bec0e7ab0eadff49bc73c1401",
+ "0x3a28792bf42a488e2101f0756b0a9b0d76fca209b8f0c54d71b37687006cd4e4",
+ "0x826365b123a28788e95ad3aedd62e3754f984ca5fd5b5dd8d69044372ac339f7",
+ "0x060db2fd01d7b69055b36e8bfdfdfae8d360ff4f82476a5b4fbaa4024ba01d62",
+ "0x97638f6e7fa76cda2534cd8d11b2ba98e1dc7de3696dae76ccff8ba9bd12a972",
+ "0x8134f297cef3ae5bd5adc505ad7c299f5d7ff5ba7a58a8f5f9e40af4ebe10ab4",
+ "0x04d5963fce386cae017b6d6ec30db7e3cfe3716ccb416a3fded6ec52ff0ed09c"
+ ],
+ "signature": "0x1d93c6edb4904e95bfaeb73db117b71d6c2643b3a44ac6edaf468711447f68ea26eb2f88d6c7d467b39405428a022915855c9bef5d679ee5e1e76071b4c8f9461c",
+ "leaf": {
+ "type": "Buffer",
+ "data": [
+ 165, 24, 88, 44, 147, 251, 39, 48, 236, 195, 183, 162, 42, 165, 33, 205,
+ 202, 87, 66, 122, 253, 186, 199, 110, 230, 253, 157, 251, 51, 141, 71, 50
+ ]
+ },
+ "publicKey": "0x3B0Cbd99ED2CC8d36c73F56dB56000562b7A0ff1",
+ "userId": 74
+}
diff --git a/web/src/constants/routes.js b/web/src/constants/routes.js
index 0b7e3d1..a23ff99 100644
--- a/web/src/constants/routes.js
+++ b/web/src/constants/routes.js
@@ -1,8 +1,8 @@
-export const ROUTE_INDEX = '/'
-export const ROUTE_WALLET = '/wallet'
-export const ROUTE_CONNECT = '/connect'
-export const ROUTE_PROOF = '/proof'
-export const ROUTE_DONE = '/done'
-export const ROUTE_FINISH = '/finish'
-export const ROUTE_NOT_FOUND = '/not-found'
-export const ROUTE_CLAIMED = '/claimed'
\ No newline at end of file
+export const ROUTE_INDEX = "/";
+export const ROUTE_WALLET = "/wallet";
+export const ROUTE_CONNECT = "/connect";
+export const ROUTE_PROOF = "/proof";
+export const ROUTE_DONE = "/done";
+export const ROUTE_FINISH = "/finish";
+export const ROUTE_NOT_FOUND = "/not-found";
+export const ROUTE_CLAIMED = "/claimed";
diff --git a/web/src/constants/statuses.js b/web/src/constants/statuses.js
index 624555d..2086a35 100644
--- a/web/src/constants/statuses.js
+++ b/web/src/constants/statuses.js
@@ -1,7 +1,7 @@
-export const SUCCESS = 'SUCCESS'
-export const APPROVED = 'APPROVED'
-export const MINED = 'MINED'
-export const PENDING = 'PENDING'
-export const MINING = 'MINING'
-export const FAIL = 'FAIL'
-export const REJECTED = 'REJECTED'
\ No newline at end of file
+export const SUCCESS = "SUCCESS";
+export const APPROVED = "APPROVED";
+export const MINED = "MINED";
+export const PENDING = "PENDING";
+export const MINING = "MINING";
+export const FAIL = "FAIL";
+export const REJECTED = "REJECTED";
diff --git a/web/src/constants/treeData.json b/web/src/constants/treeData.json
index 3c72272..c7d0c52 100644
--- a/web/src/constants/treeData.json
+++ b/web/src/constants/treeData.json
@@ -1 +1,3 @@
-{"merkleRoot":"0x151249827dc1bac65f752ec8bcd504955bca3d0fa86c6f750f28d26f91d1ab7d"}
\ No newline at end of file
+{
+ "merkleRoot": "0x151249827dc1bac65f752ec8bcd504955bca3d0fa86c6f750f28d26f91d1ab7d"
+}
diff --git a/web/src/context/web3Context.js b/web/src/context/web3Context.js
new file mode 100644
index 0000000..f8188ca
--- /dev/null
+++ b/web/src/context/web3Context.js
@@ -0,0 +1,140 @@
+import {
+ createContext,
+ useCallback,
+ useContext,
+ useEffect,
+ useState,
+} from "react";
+import WalletConnectProvider from "@walletconnect/web3-provider";
+import Web3Modal from "web3modal";
+import { providers } from "ethers";
+import supportedChains from "../constants/chains";
+import Web3 from "web3";
+import { toast } from "react-toastify";
+
+const { REACT_APP_INFURA_KEY: INFURA_ID } = process.env;
+
+const providerOptions = {
+ walletconnect: {
+ package: WalletConnectProvider, // required
+ options: {
+ infuraId: INFURA_ID, // required
+ },
+ },
+};
+
+let web3Modal;
+if (typeof window !== "undefined") {
+ web3Modal = new Web3Modal({
+ network: "sepolia", // optional
+ cacheProvider: true,
+ providerOptions, // required
+ });
+}
+
+const defaultProvider = new providers.JsonRpcProvider(
+ supportedChains[0].rpc_url,
+ {
+ name: supportedChains[0].network,
+ chainId: supportedChains[0].chain_id,
+ },
+);
+
+export const Web3Context = createContext(null);
+
+export const Web3ContextProvider = ({ children }) => {
+ const [provider, setProvider] = useState(defaultProvider);
+ const [address, setAddress] = useState(null);
+
+ const connect = useCallback(async () => {
+ try {
+ const modal = await web3Modal.connect();
+ const networkData = supportedChains.find(
+ (chain) => chain.network_id === Number(modal.networkVersion),
+ );
+ const web3Provider = new providers.Web3Provider(
+ await web3Modal.connect(),
+ {
+ name: networkData.network,
+ chainId: networkData.chain_id,
+ },
+ );
+
+ const signer = web3Provider.getSigner();
+ const address = await signer.getAddress();
+ setProvider(web3Provider);
+ setAddress(address);
+ } catch (e) {
+ console.log(e);
+ }
+ }, []);
+
+ const disconnect = useCallback(async function () {
+ await web3Modal.clearCachedProvider();
+ setProvider(defaultProvider);
+ setAddress(null);
+ }, []);
+
+ useEffect(() => {
+ if (web3Modal.cachedProvider) {
+ void connect();
+ }
+ }, []);
+
+ useEffect(() => {
+ if (provider?.on) {
+ const handleAccountsChanged = (accounts) => {
+ console.log("accountsChanged", accounts);
+ };
+
+ const handleChainChanged = (_hexChainId) => {
+ let chainSupported = false;
+
+ supportedChains.forEach((chain) => {
+ if (Web3.utils.hexToNumber(_hexChainId) === chain.chain_id) {
+ chainSupported = true;
+ }
+ });
+
+ chainSupported
+ ? window.location.reload()
+ : toast(
+ `Network not supported. Please switch to ${supportedChains[0].name}.`,
+ );
+ };
+
+ const handleDisconnect = (error) => {
+ console.log("disconnect", error);
+ disconnect();
+ };
+
+ provider.on("accountsChanged", handleAccountsChanged);
+ provider.on("chainChanged", handleChainChanged);
+ provider.on("disconnect", handleDisconnect);
+
+ // Subscription Cleanup
+ return () => {
+ if (provider.removeListener) {
+ provider.removeListener("accountsChanged", handleAccountsChanged);
+ provider.removeListener("chainChanged", handleChainChanged);
+ provider.removeListener("disconnect", handleDisconnect);
+ }
+ };
+ }
+ }, [provider, disconnect]);
+
+ return (
+
+ {children}
+
+ );
+};
diff --git a/web/src/contracts/index.js b/web/src/contracts/index.js
index 8c1366d..1bdfa1d 100644
--- a/web/src/contracts/index.js
+++ b/web/src/contracts/index.js
@@ -1,17 +1,17 @@
-import Comp from './Comp.json'
-import GovernorAlpha from './GovernorAlpha.json'
-import GovernorBravoDelegate from './GovernorBravoDelegate.json'
-import GovernorBravoDelegator from './GovernorBravoDelegator.json'
-import Mock from './Mock.json'
-import DevRewardDistributor from './DevRewardDistributor.json'
+import Comp from "./Comp.json";
+import GovernorAlpha from "./GovernorAlpha.json";
+import GovernorBravoDelegate from "./GovernorBravoDelegate.json";
+import GovernorBravoDelegator from "./GovernorBravoDelegator.json";
+import Mock from "./Mock.json";
+import DevRewardDistributor from "./DevRewardDistributor.json";
const abis = {
- Comp,
- GovernorBravoDelegate,
- GovernorBravoDelegator,
- GovernorAlpha,
- Mock,
- DevRewardDistributor
-}
+ Comp,
+ GovernorBravoDelegate,
+ GovernorBravoDelegator,
+ GovernorAlpha,
+ Mock,
+ DevRewardDistributor,
+};
-export default abis
\ No newline at end of file
+export default abis;
diff --git a/web/src/globals.js b/web/src/globals.js
index d351838..93dbf21 100644
--- a/web/src/globals.js
+++ b/web/src/globals.js
@@ -1,3 +1,3 @@
import { Buffer } from "buffer";
-window.Buffer = Buffer;
\ No newline at end of file
+window.Buffer = Buffer;
diff --git a/web/src/hoc/TwitterShare.js b/web/src/hoc/TwitterShare.js
index e953b73..ff12b20 100644
--- a/web/src/hoc/TwitterShare.js
+++ b/web/src/hoc/TwitterShare.js
@@ -1,14 +1,16 @@
-const TwitterShare = Component => ({caption, url='', target='_blank', hashtags='', ...props}) => {
- const formattedText = caption.replace(' ', '%20')
+const TwitterShare =
+ (Component) =>
+ ({ caption, url = "", target = "_blank", hashtags = "", ...props }) => {
+ const formattedText = caption.replace(" ", "%20");
- return(
-
-
-
- )
-}
-
-export default TwitterShare
\ No newline at end of file
+ return (
+
+
+
+ );
+ };
+
+export default TwitterShare;
diff --git a/web/src/hooks/useCountdown.js b/web/src/hooks/useCountdown.js
index 8c952b6..c75cd27 100644
--- a/web/src/hooks/useCountdown.js
+++ b/web/src/hooks/useCountdown.js
@@ -1,30 +1,33 @@
-import { intervalToDuration, isPast } from 'date-fns'
-import { useEffect, useState } from 'react'
+import { intervalToDuration, isPast } from "date-fns";
+import { useEffect, useState } from "react";
export const useCountdown = (date) => {
- const format = ({ days, hours, minutes, seconds }) => `${days}d ${hours}h ${minutes}m ${seconds}s`
+ const format = ({ days, hours, minutes, seconds }) =>
+ `${days}d ${hours}h ${minutes}m ${seconds}s`;
- const [ended, setEnded] = useState(isPast(date))
- const [duration, setDuration] = useState(intervalToDuration({
- start: date,
- end: new Date(),
- }))
- const [formatted, setFormatted] = useState(format(duration))
+ const [ended, setEnded] = useState(isPast(date));
+ const [duration, setDuration] = useState(
+ intervalToDuration({
+ start: date,
+ end: new Date(),
+ }),
+ );
+ const [formatted, setFormatted] = useState(format(duration));
- useEffect(() => {
- const timer = setInterval(() => {
- const intToDur = intervalToDuration({
- start: date,
- end: new Date(),
- })
- setDuration(intToDur)
- setFormatted(format(intToDur))
- setEnded(isPast(date))
- }, 1000);
+ useEffect(() => {
+ const timer = setInterval(() => {
+ const intToDur = intervalToDuration({
+ start: date,
+ end: new Date(),
+ });
+ setDuration(intToDur);
+ setFormatted(format(intToDur));
+ setEnded(isPast(date));
+ }, 1000);
- ended && clearInterval(timer)
- return () => clearInterval(timer);
- }, [])
+ ended && clearInterval(timer);
+ return () => clearInterval(timer);
+ }, []);
- return [ formatted, duration ]
-}
\ No newline at end of file
+ return [formatted, duration];
+};
diff --git a/web/src/hooks/useForm.js b/web/src/hooks/useForm.js
index b1fa2d6..1b13df1 100644
--- a/web/src/hooks/useForm.js
+++ b/web/src/hooks/useForm.js
@@ -1,29 +1,35 @@
import React, { useCallback } from "react";
-
export function useFormWithValidation() {
- const [values, setValues] = React.useState({});
- const [errors, setErrors] = React.useState({});
- const [isValid, setIsValid] = React.useState(false);
+ const [values, setValues] = React.useState({});
+ const [errors, setErrors] = React.useState({});
+ const [isValid, setIsValid] = React.useState(false);
- const handleChange = (evt) => {
- const input = evt.target;
- const value = input.value;
- const name = input.name;
- setValues({ ...values, [name]: value });
- setErrors({ ...errors, [name]: input.validationMessage });
- setIsValid(input.closest("form").checkValidity());
- };
+ const handleChange = (evt) => {
+ const input = evt.target;
+ const value = input.value;
+ const name = input.name;
+ setValues({ ...values, [name]: value });
+ setErrors({ ...errors, [name]: input.validationMessage });
+ setIsValid(input.closest("form").checkValidity());
+ };
- const resetForm = useCallback(
-
- (newValues = {}, newErrors = {}, newIsValid = false) => {
- setValues(newValues);
- setErrors(newErrors);
- setIsValid(newIsValid);
- },
- [setValues, setErrors, setIsValid]
- );
+ const resetForm = useCallback(
+ (newValues = {}, newErrors = {}, newIsValid = false) => {
+ setValues(newValues);
+ setErrors(newErrors);
+ setIsValid(newIsValid);
+ },
+ [setValues, setErrors, setIsValid],
+ );
- return { values, handleChange, resetForm, errors, isValid, setIsValid, setValues };
-}
\ No newline at end of file
+ return {
+ values,
+ handleChange,
+ resetForm,
+ errors,
+ isValid,
+ setIsValid,
+ setValues,
+ };
+}
diff --git a/web/src/hooks/useVh.js b/web/src/hooks/useVh.js
index 23659ed..41b2ad7 100644
--- a/web/src/hooks/useVh.js
+++ b/web/src/hooks/useVh.js
@@ -1,13 +1,15 @@
import { useEffect } from "react";
export const useVh = () => {
- useEffect(() => {
- document.querySelector(':root').style
- .setProperty('--vh', window.innerHeight/100 + 'px');
-
- window.addEventListener('resize', () => {
- document.querySelector(':root').style
- .setProperty('--vh', window.innerHeight/100 + 'px');
- })
- }, [])
-}
\ No newline at end of file
+ useEffect(() => {
+ document
+ .querySelector(":root")
+ .style.setProperty("--vh", window.innerHeight / 100 + "px");
+
+ window.addEventListener("resize", () => {
+ document
+ .querySelector(":root")
+ .style.setProperty("--vh", window.innerHeight / 100 + "px");
+ });
+ }, []);
+};
diff --git a/web/src/hooks/useWeb3Connection.js b/web/src/hooks/useWeb3Connection.js
index b4d2a46..5dd4582 100644
--- a/web/src/hooks/useWeb3Connection.js
+++ b/web/src/hooks/useWeb3Connection.js
@@ -1,128 +1,6 @@
-import WalletConnectProvider from "@walletconnect/web3-provider";
-import { providers } from "ethers";
-import { useCallback, useEffect, useState } from "react";
-import { useDispatch } from "react-redux";
-import Web3 from "web3";
-import Web3Modal from "web3modal";
-import supportedChains from "../constants/chains";
-import { toast } from "react-toastify";
-
-const { REACT_APP_INFURA_KEY: INFURA_ID } = process.env;
-
-const providerOptions = {
- walletconnect: {
- package: WalletConnectProvider, // required
- options: {
- infuraId: INFURA_ID, // required
- },
- },
-};
-
-let web3Modal;
-if (typeof window !== "undefined") {
- web3Modal = new Web3Modal({
- network: "sepolia", // optional
- cacheProvider: true,
- providerOptions, // required
- });
-}
-
-const defaultProvider = new providers.JsonRpcProvider(supportedChains[0].rpc_url, {
- name: supportedChains[0].network,
- chainId: supportedChains[0].chain_id
-});
+import { useContext } from "react";
+import { Web3Context } from "../context/web3Context";
export const useWeb3Connection = () => {
- const dispatch = useDispatch();
- const [provider, setProvider] = useState(defaultProvider);
- const [address, setAddress] = useState(null);
- const network = provider.network;
-
- async function sendTransaction(_tx) {
- return provider.sendTransaction(_tx).then(tx => tx.hash);
- }
-
- const connect = useCallback(async () => {
- const modal = await web3Modal.connect();
- const networkData = supportedChains.find(chain => chain.network_id === Number(modal.networkVersion));
- const web3Provider = new providers.Web3Provider(await web3Modal.connect(), {
- name: networkData.network,
- chainId: networkData.chain_id
- });
-
- const signer = web3Provider.getSigner();
- const address = await signer.getAddress();
- console.log(address, web3Provider.network);
- setAddress(address)
- setProvider(web3Provider);
- }, []);
-
- const disconnect = useCallback(
- async function () {
- await web3Modal.clearCachedProvider();
- setProvider(defaultProvider);
- setAddress(null);
- if (provider?.disconnect && typeof provider.disconnect === "function") {
- await provider.disconnect();
- }
- },
- [provider, dispatch]
- );
-
- useEffect(() => {
- if (web3Modal.cachedProvider) {
- connect();
- }
- }, [connect]);
-
- useEffect(() => {
- if (provider?.on) {
- const handleAccountsChanged = (accounts) => {
- console.log("accountsChanged", accounts);
- };
-
- const handleChainChanged = (_hexChainId) => {
- let chainSupported = false;
-
- supportedChains.forEach((chain) => {
- if (Web3.utils.hexToNumber(_hexChainId) === chain.chain_id) {
- chainSupported = true;
- }
- });
-
- chainSupported
- ? window.location.reload()
- : toast(
- `Network not supported. Please switch to ${supportedChains[0].name}.`
- );
- };
-
- const handleDisconnect = (error) => {
- console.log("disconnect", error);
- disconnect();
- };
-
- provider.on("accountsChanged", handleAccountsChanged);
- provider.on("chainChanged", handleChainChanged);
- provider.on("disconnect", handleDisconnect);
-
- // Subscription Cleanup
- return () => {
- if (provider.removeListener) {
- provider.removeListener("accountsChanged", handleAccountsChanged);
- provider.removeListener("chainChanged", handleChainChanged);
- provider.removeListener("disconnect", handleDisconnect);
- }
- };
- }
- }, [provider, disconnect, dispatch]);
-
- return {
- connect,
- disconnect,
- provider,
- address,
- network,
- sendTransaction,
- };
+ return useContext(Web3Context);
};
diff --git a/web/src/index.css b/web/src/index.css
index 6ebbea1..620a070 100644
--- a/web/src/index.css
+++ b/web/src/index.css
@@ -6,15 +6,15 @@
body {
margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
+ "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+ font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
diff --git a/web/src/index.js b/web/src/index.js
index 355503c..450b447 100644
--- a/web/src/index.js
+++ b/web/src/index.js
@@ -1,53 +1,52 @@
-import './globals';
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { HashRouter as Router } from 'react-router-dom';
-import { Provider } from 'react-redux';
-import './index.css';
-import App from './components/App/App';
-import reportWebVitals from './reportWebVitals';
-import rootReducer from './store/reducers/root';
-import { applyMiddleware, compose, createStore } from 'redux';
-import thunk from 'redux-thunk';
-import { persistReducer, persistStore } from 'redux-persist';
-import { PersistGate } from 'redux-persist/integration/react';
-import storage from 'redux-persist/lib/storage';
-import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
+import "./globals";
+import React from "react";
+import ReactDOM from "react-dom";
+import { HashRouter as Router } from "react-router-dom";
+import { Provider } from "react-redux";
+import "./index.css";
+import App from "./components/App/App";
+import reportWebVitals from "./reportWebVitals";
+import rootReducer from "./store/reducers/root";
+import { applyMiddleware, compose, createStore } from "redux";
+import thunk from "redux-thunk";
+import { persistReducer, persistStore } from "redux-persist";
+import { PersistGate } from "redux-persist/integration/react";
+import storage from "redux-persist/lib/storage";
+import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
+import { Web3ContextProvider } from "./context/web3Context";
+const composeEnhancers =
+ (process.env.NODE_ENV === "development"
+ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
+ : null) || compose;
-const composeEnhancers =
- (process.env.NODE_ENV === 'development'
- ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ :
- null)
- || compose;
-
-const enhancer = composeEnhancers(
- applyMiddleware(thunk)
-)
+const enhancer = composeEnhancers(applyMiddleware(thunk));
const persistConfig = {
- key: 'root',
+ key: "root",
storage,
stateReconciler: autoMergeLevel2,
- blacklist: ['error', 'wallet']
-}
+ blacklist: ["error", "wallet"],
+};
-const persistedReducer = persistReducer(persistConfig, rootReducer)
+const persistedReducer = persistReducer(persistConfig, rootReducer);
// const store = createStore(rootReducer, applyMiddleware(thunk))
-const store = createStore(persistedReducer, enhancer)
-const persistor = persistStore(store)
+const store = createStore(persistedReducer, enhancer);
+const persistor = persistStore(store);
ReactDOM.render(
-
-
+
+
+
-
-
+
+
+
,
- document.getElementById('root')
+ document.getElementById("root"),
);
// If you want to start measuring performance in your app, pass a function
diff --git a/web/src/pages/begin-page/begin-page.js b/web/src/pages/begin-page/begin-page.js
index badf460..a95f1d0 100644
--- a/web/src/pages/begin-page/begin-page.js
+++ b/web/src/pages/begin-page/begin-page.js
@@ -1,140 +1,150 @@
-import React, { memo, useEffect, useState } from 'react';
-import { useNavigate } from 'react-router-dom';
-import { useDispatch, useSelector } from 'react-redux';
-import githubUsernameRegex from 'github-username-regex';
+import React, { memo, useEffect, useState } from "react";
+import { useNavigate } from "react-router-dom";
+import { useDispatch, useSelector } from "react-redux";
+import githubUsernameRegex from "github-username-regex";
-import Header from '../../components/Header/Header';
-import Title from '../../components/Title/Title';
-import Text from '../../components/Text/Text';
-import Button from '../../components/Button/Button';
-import Url from '../../components/Url/Url';
-import Dashboard from '../../components/Dashboard/Dashboard'
-import DefinitionList from '../../components/DefinitionList/DefinitionList';
-import Footer from '../../components/Footer/Footer'
-import TimeUntilReduce from '../../components/TimeUntilReduce/TimeUntilReduce';
+import Header from "../../components/Header/Header";
+import Title from "../../components/Title/Title";
+import Text from "../../components/Text/Text";
+import Button from "../../components/Button/Button";
+import Url from "../../components/Url/Url";
+import Dashboard from "../../components/Dashboard/Dashboard";
+import DefinitionList from "../../components/DefinitionList/DefinitionList";
+import Footer from "../../components/Footer/Footer";
+import TimeUntilReduce from "../../components/TimeUntilReduce/TimeUntilReduce";
-import styles from './begin-page.module.css';
-import { setUsername, storeKey } from '../../store/actions/user';
-import { ROUTE_WALLET } from '../../constants/routes';
+import styles from "./begin-page.module.css";
+import { setUsername, storeKey } from "../../store/actions/user";
+import { ROUTE_WALLET } from "../../constants/routes";
import { useWeb3Connection } from "../../hooks/useWeb3Connection";
const PageBegin = memo(() => {
- const navigate = useNavigate()
- const { provider } = useWeb3Connection();
- const { currentAward, nextHalvePeriod } = useSelector(state => state.distributor)
- const { username, key } = useSelector(state => state.user)
- const [name, setName] = useState('')
- const dispatch = useDispatch()
+ const navigate = useNavigate();
+ const { provider } = useWeb3Connection();
+ const { currentAward, nextHalvePeriod } = useSelector(
+ (state) => state.distributor,
+ );
+ const { username, key } = useSelector((state) => state.user);
+ const [name, setName] = useState("");
+ const dispatch = useDispatch();
- const time = new Date(nextHalvePeriod * 1000)
- console.log(time)
+ const time = new Date(nextHalvePeriod * 1000);
+ console.log(time);
- useEffect(() => {
- key && dispatch(storeKey(key))
- }, [provider, key])
+ useEffect(() => {
+ key && dispatch(storeKey(key));
+ }, [provider, key]);
- useEffect(() => {
- if (username) {
- navigate(ROUTE_WALLET)
- }
- }, [username])
-
- const [inputValid, setInputValid] = useState(true)
- const [inputPressed, setInputPressed] = useState(false)
+ useEffect(() => {
+ if (username) {
+ navigate(ROUTE_WALLET);
+ }
+ }, [username]);
- const handleChangeUsername = (e) => {
- e.target.value !== '' ? setInputPressed(true) : setInputPressed(false)
- setInputValid(githubUsernameRegex.test(e.target.value))
- setName(e.target.value)
- }
+ const [inputValid, setInputValid] = useState(true);
+ const [inputPressed, setInputPressed] = useState(false);
- const getInputClassName = () => {
- if (!inputValid) {
- return `${styles.input} ${styles.input__invalid}`
- }
+ const handleChangeUsername = (e) => {
+ e.target.value !== "" ? setInputPressed(true) : setInputPressed(false);
+ setInputValid(githubUsernameRegex.test(e.target.value));
+ setName(e.target.value);
+ };
- if (inputPressed) {
- return `${styles.input} ${styles.input__pressed}`
- }
+ const getInputClassName = () => {
+ if (!inputValid) {
+ return `${styles.input} ${styles.input__invalid}`;
+ }
- return styles.input
+ if (inputPressed) {
+ return `${styles.input} ${styles.input__pressed}`;
}
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- 10% of the FLT supply is distributed to ~10,000 selected Web3 developers and contributors. Public keys of selected Github accounts were added into a smart contract on Ethereum. Claim your allocation and help us build the decentralized internet together!
-
-
- -
-
- Authenticate via Github, to check if you are eligible and proceed with claiming.
-
-
-
-
+ return styles.input;
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+ 10% of the FLT supply is distributed to ~10,000 selected
+ Web3 developers and contributors. Public keys of
+ selected Github accounts were added into a smart
+ contract on Ethereum. Claim your allocation and help us
+ build the decentralized internet together!
+
+
+ -
+
+ Authenticate via Github, to check if you are eligible
+ and proceed with claiming.
+
+
+
+
-
{inputValid ? <> > : 'Incorrect username'}
+
+ {inputValid ? <> > : "Incorrect username"}
+
-
- -
- {
-
- -
- or
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
-})
+
+ -
+ {
+
+ -
+ or
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+});
-export default PageBegin;
\ No newline at end of file
+export default PageBegin;
diff --git a/web/src/pages/begin-page/begin-page.module.css b/web/src/pages/begin-page/begin-page.module.css
index 96a1be3..36efcc8 100644
--- a/web/src/pages/begin-page/begin-page.module.css
+++ b/web/src/pages/begin-page/begin-page.module.css
@@ -1,255 +1,246 @@
.background {
- padding-top: 54px;
+ padding-top: 54px;
- background: rgba(177, 169, 153, 1);
- background-image: url('../../images/Rectangle 76.21553159.webp');
- background-repeat: no-repeat;
- background-size: 100% 100%;
+ background: rgba(177, 169, 153, 1);
+ background-image: url("../../images/Rectangle 76.21553159.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
}
.progress {
- margin-bottom: 30px;
+ margin-bottom: 30px;
}
.title {
- max-width: 475px;
- margin-bottom: 65px;
+ max-width: 475px;
+ margin-bottom: 65px;
}
.flex-container {
- display: flex;
- justify-content: space-between;
-
+ display: flex;
+ justify-content: space-between;
}
.flex-container__part-left {
- max-width: 715px;
- width: 65%;
+ max-width: 715px;
+ width: 65%;
}
.dashboard {
- margin-bottom: 80px;
+ margin-bottom: 80px;
}
.flex-container__part-right {
- max-width: 277px;
+ max-width: 277px;
}
.texts {
- margin: 0 0 36px;
- padding: 0;
-
- list-style: none;
+ margin: 0 0 36px;
+ padding: 0;
+
+ list-style: none;
}
.text {
- margin-bottom: 20px;
+ margin-bottom: 20px;
}
.text:last-child {
- margin-bottom: 0;
+ margin-bottom: 0;
}
.buttons {
- margin: 0;
- padding: 0;
- display: flex;
- align-items: center;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ align-items: center;
- list-style: none;
+ list-style: none;
}
.button {
- margin-right: 21px;
+ margin-right: 21px;
}
.button:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.span {
- margin-right: 15px;
+ margin-right: 15px;
- font-family: 'Hauora_Bold', sans-serif;
- font-size: 15px;
- line-height: 21px;
- color: rgba(0, 0, 0, 0.6);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 15px;
+ line-height: 21px;
+ color: rgba(0, 0, 0, 0.6);
}
.definitions {
- margin: 0 0 45px;
- padding: 0;
+ margin: 0 0 45px;
+ padding: 0;
- list-style: none;
+ list-style: none;
}
.definition {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
.definition:last-child {
- margin-bottom: 0;
+ margin-bottom: 0;
}
.input {
- padding: 11px 20px;
- max-width: 394px;
- width: 100%;
+ padding: 11px 20px;
+ max-width: 394px;
+ width: 100%;
- font-family: "Hauora_Regular", sans-serif;
- font-size: 18px;
- line-height: 24px;
- letter-spacing: 0.5px;
- color: rgba(0, 0, 0, 0.5);
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 18px;
+ line-height: 24px;
+ letter-spacing: 0.5px;
+ color: rgba(0, 0, 0, 0.5);
- background: rgba(196, 196, 196, 0.5);
-/* Grey */
+ background: rgba(196, 196, 196, 0.5);
+ /* Grey */
- border: 1px solid #CCCCCC;
- border-radius: 5px;
+ border: 1px solid #cccccc;
+ border-radius: 5px;
}
.input__invalid {
- border: 1px solid #EF4646;
+ border: 1px solid #ef4646;
}
.input__pressed {
- border: 1px solid #4D4D4D;
+ border: 1px solid #4d4d4d;
}
.input::placeholder {
- font-family: "Hauora_Regular", sans-serif;
- font-size: 18px;
- line-height: 24px;
- letter-spacing: 0.5px;
- color: rgba(0, 0, 0, 0.5);
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 18px;
+ line-height: 24px;
+ letter-spacing: 0.5px;
+ color: rgba(0, 0, 0, 0.5);
}
.incorrect {
- margin-top: 10px;
- margin-bottom: 20px;
- margin-left: 20px;
- color: #EF4646;
- font-style: normal;
- font-weight: bold;
- font-size: 10px;
- line-height: 16px;
- letter-spacing: 1px;
- text-transform: uppercase;
+ margin-top: 10px;
+ margin-bottom: 20px;
+ margin-left: 20px;
+ color: #ef4646;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 10px;
+ line-height: 16px;
+ letter-spacing: 1px;
+ text-transform: uppercase;
}
.input:focus {
- outline: none;
+ outline: none;
}
-
-@media screen and (max-width: 1366px) {
- .title {
- max-width: 315px;
- }
+@media screen and (max-width: 1366px) {
+ .title {
+ max-width: 315px;
+ }
}
-
-@media screen and (max-width: 1100px) {
- .texts {
- max-width: 465px;
- }
- .definitions {
- margin-bottom: 140px;
- }
+@media screen and (max-width: 1100px) {
+ .texts {
+ max-width: 465px;
+ }
+ .definitions {
+ margin-bottom: 140px;
+ }
}
@media screen and (max-width: 900px) {
- .main {
- padding: 0 15px;
- }
+ .main {
+ padding: 0 15px;
+ }
}
-@media screen and (max-width: 803px) {
-
- .flex-container {
- flex-direction: column-reverse;
- justify-content: flex-start;
- }
-
- .flex-container__part-left {
- max-width: 715px;
- width: 100%;
- }
+@media screen and (max-width: 803px) {
+ .flex-container {
+ flex-direction: column-reverse;
+ justify-content: flex-start;
+ }
- .texts {
- max-width: 715px;
+ .flex-container__part-left {
+ max-width: 715px;
+ width: 100%;
+ }
- }
- .flex-container__part-right {
- max-width: 345px;
- margin-bottom: 30px;
- }
+ .texts {
+ max-width: 715px;
+ }
+ .flex-container__part-right {
+ max-width: 345px;
+ margin-bottom: 30px;
+ }
- .definitions {
- margin-bottom: 30px;
- }
+ .definitions {
+ margin-bottom: 30px;
+ }
- .dashboard {
- margin-bottom: 40px;
- }
+ .dashboard {
+ margin-bottom: 40px;
+ }
- .definition {
- margin-bottom: 40px;
- }
-
- .definition:last-child {
- margin-bottom: 0;
- }
+ .definition {
+ margin-bottom: 40px;
+ }
-
-
+ .definition:last-child {
+ margin-bottom: 0;
+ }
}
@media screen and (max-width: 519px) {
+ .title {
+ margin-bottom: 60px;
+ }
+ .buttons {
+ flex-direction: column;
+ align-items: center;
+ }
- .title {
- margin-bottom: 60px;
- }
- .buttons {
- flex-direction: column;
- align-items: center;
- }
-
- .button:first-child {
- margin-bottom: 20px;
- margin-right: 0;
- }
+ .button:first-child {
+ margin-bottom: 20px;
+ margin-right: 0;
+ }
}
@media screen and (max-width: 560px) {
- .buttons {
- display: block;
- margin: 0 auto;
- max-width: 300px;
- }
+ .buttons {
+ display: block;
+ margin: 0 auto;
+ max-width: 300px;
+ }
- .button {
- margin: 0;
- margin-bottom: 20px;
- }
+ .button {
+ margin: 0;
+ margin-bottom: 20px;
+ }
- .button:last-child {
- margin: 0;
- text-align: center;
- margin-right: 70px;
- }
+ .button:last-child {
+ margin: 0;
+ text-align: center;
+ margin-right: 70px;
+ }
}
@media screen and (max-width: 500px) {
- .container {
- padding: 0;
- }
- .title {
- margin-left: 15px;
- }
-
- .main {
- padding: 0;
- }
-}
\ No newline at end of file
+ .container {
+ padding: 0;
+ }
+ .title {
+ margin-left: 15px;
+ }
+
+ .main {
+ padding: 0;
+ }
+}
diff --git a/web/src/pages/claimed-page/claimed-page.js b/web/src/pages/claimed-page/claimed-page.js
index ffe4f55..8dfed4e 100644
--- a/web/src/pages/claimed-page/claimed-page.js
+++ b/web/src/pages/claimed-page/claimed-page.js
@@ -1,63 +1,68 @@
-import React from 'react';
-
-import Header from '../../components/Header/Header';
-import Title from '../../components/Title/Title';
-import Button from '../../components/Button/Button';
-import Footer from '../../components/Footer/Footer';
-import Url from '../../components/Url/Url';
-import TwitterShare from '../../hoc/TwitterShare';
-import { addTokenToMetamask } from '../../utils/metamask';
-import { governanceContracts } from '../../constants';
-import styles from './claimed-page.module.css';
+import React from "react";
+
+import Header from "../../components/Header/Header";
+import Title from "../../components/Title/Title";
+import Button from "../../components/Button/Button";
+import Footer from "../../components/Footer/Footer";
+import Url from "../../components/Url/Url";
+import TwitterShare from "../../hoc/TwitterShare";
+import { addTokenToMetamask } from "../../utils/metamask";
+import { governanceContracts } from "../../constants";
+import styles from "./claimed-page.module.css";
import { useWeb3Connection } from "../../hooks/useWeb3Connection";
-const TwitterShareButton = TwitterShare(Button)
+const TwitterShareButton = TwitterShare(Button);
const ClaimedPage = () => {
- const { network } = useWeb3Connection();
-
- const handleAddToken = () => {
- addTokenToMetamask(governanceContracts[network.name].token)
- }
-
- return (
-
- )
-}
-
-export default ClaimedPage;
\ No newline at end of file
+ const { network } = useWeb3Connection();
+
+ const handleAddToken = () => {
+ addTokenToMetamask(governanceContracts[network.name].token);
+ };
+
+ return (
+
+ );
+};
+
+export default ClaimedPage;
diff --git a/web/src/pages/claimed-page/claimed-page.module.css b/web/src/pages/claimed-page/claimed-page.module.css
index 22773ec..0ec16fa 100644
--- a/web/src/pages/claimed-page/claimed-page.module.css
+++ b/web/src/pages/claimed-page/claimed-page.module.css
@@ -1,119 +1,116 @@
.background {
- position: relative;
- padding-top: 54px;
+ position: relative;
+ padding-top: 54px;
- background-color: rgb(0, 0, 0);
+ background-color: rgb(0, 0, 0);
- background-size: 100% 100%;
+ background-size: 100% 100%;
}
.background__image {
- position: absolute;
- top: 0;
- left: 0;
- padding-top: 54px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding-top: 54px;
-
- width: 100%;
- height: 1020px;
- background-image: url('../../images/bg-finish.webp');
- background-repeat: no-repeat;
- background-size: 100% 1020px;
+ width: 100%;
+ height: 1020px;
+ background-image: url("../../images/bg-finish.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 1020px;
}
.header {
- position: relative;
- /* z-index: 2; */
-
- margin-bottom: 149px;
+ position: relative;
+ /* z-index: 2; */
+
+ margin-bottom: 149px;
}
.title {
- position: relative;
- /* z-index: 2; */
+ position: relative;
+ /* z-index: 2; */
- max-width: 900px;
- margin: 0;
- margin-bottom: 37px;
+ max-width: 900px;
+ margin: 0;
+ margin-bottom: 37px;
}
-
-
.buttons {
- position: relative;
- /* z-index: 2; */
-
- margin: 0;
- margin-bottom: 240px;
- padding: 0;
- display: flex;
+ position: relative;
+ /* z-index: 2; */
- list-style: none;
+ margin: 0;
+ margin-bottom: 240px;
+ padding: 0;
+ display: flex;
+
+ list-style: none;
}
.button {
- margin-right: 17px;
+ margin-right: 17px;
}
.button:last-child {
- margin-right: 0;
- align-self: center;
+ margin-right: 0;
+ align-self: center;
}
.involved {
- margin-bottom: 100px;
+ margin-bottom: 100px;
}
.involved__title {
- margin-bottom: 61px;
+ margin-bottom: 61px;
}
.involved__list {
- max-width: 817px;
+ max-width: 817px;
}
.conversation {
- margin-bottom: 136px;
+ margin-bottom: 136px;
}
.conversation__title {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
@media screen and (max-width: 1363px) {
- .involved__title {
- padding-top: 130px;
- }
+ .involved__title {
+ padding-top: 130px;
+ }
}
@media screen and (max-width: 1024px) {
- .involved__title {
- padding-top: 135px;
- }
+ .involved__title {
+ padding-top: 135px;
+ }
}
@media screen and (max-width: 1100px) {
- .main {
- padding: 0 40px;
- }
+ .main {
+ padding: 0 40px;
+ }
}
@media screen and (max-width: 900px) {
- .main {
- padding: 0 15px;
- }
+ .main {
+ padding: 0 15px;
+ }
}
@media screen and (max-width: 810px) {
- .buttons {
- display: block;
- }
-
- .button {
- margin-bottom: 10px;
- }
-
- .involved__title {
- padding-top: 0;
- }
-}
\ No newline at end of file
+ .buttons {
+ display: block;
+ }
+
+ .button {
+ margin-bottom: 10px;
+ }
+
+ .involved__title {
+ padding-top: 0;
+ }
+}
diff --git a/web/src/pages/done-page/done-page.js b/web/src/pages/done-page/done-page.js
index 8fb6d6a..2872ab2 100644
--- a/web/src/pages/done-page/done-page.js
+++ b/web/src/pages/done-page/done-page.js
@@ -1,88 +1,98 @@
-import React, { useEffect, useRef } from 'react';
+import React, { useEffect, useRef } from "react";
-import Header from '../../components/Header/Header';
-import Progress from '../../components/Progress/Progress';
-import Title from '../../components/Title/Title';
-import WalletInfo from '../../components/WalletInfo/WalletInfo';
-import Button from '../../components/Button/Button';
-import Footer from '../../components/Footer/Footer';
+import Header from "../../components/Header/Header";
+import Progress from "../../components/Progress/Progress";
+import Title from "../../components/Title/Title";
+import WalletInfo from "../../components/WalletInfo/WalletInfo";
+import Button from "../../components/Button/Button";
+import Footer from "../../components/Footer/Footer";
-import styles from './done-page.module.css';
-import { useDispatch, useSelector } from 'react-redux';
-import { hideString } from '../../utils';
-import { claim } from '../../store/actions/governance';
-import { useWeb3Connection } from '../../hooks/useWeb3Connection';
-import { useNavigate } from 'react-router-dom';
-import { ROUTE_FINISH } from '../../constants/routes';
-import { MINED, MINING } from '../../constants';
-import { toast } from 'react-toastify';
+import styles from "./done-page.module.css";
+import { useDispatch, useSelector } from "react-redux";
+import { hideString } from "../../utils";
+import { claim } from "../../store/actions/governance";
+import { useWeb3Connection } from "../../hooks/useWeb3Connection";
+import { useNavigate } from "react-router-dom";
+import { ROUTE_FINISH } from "../../constants/routes";
+import { MINED, MINING } from "../../constants";
+import { toast } from "react-toastify";
const DonePage = () => {
- const { provider, address, network } = useWeb3Connection()
- const { claimStatus } = useSelector(state => state.governance)
- const { currentAward } = useSelector(state => state.distributor)
- const { proof } = useSelector(state => state.governance.values)
- const dispatch = useDispatch()
- const navigate = useNavigate()
+ const { provider, address, network } = useWeb3Connection();
+ const { claimStatus } = useSelector((state) => state.governance);
+ const { currentAward } = useSelector((state) => state.distributor);
+ const { proof } = useSelector((state) => state.governance.values);
+ const dispatch = useDispatch();
+ const navigate = useNavigate();
- const handleClaim = () => {
- // { userId, tmpEthAddr, signature, merkleProof }
+ const handleClaim = () => {
+ // { userId, tmpEthAddr, signature, merkleProof }
- dispatch(
- claim(
- proof?.userId,
- proof?.merkleProof,
- proof?.tmpEthAddr,
- proof?.signature,
- provider,
- network.name
- )
- )
+ dispatch(
+ claim(
+ proof?.userId,
+ proof?.merkleProof,
+ proof?.tmpEthAddr,
+ proof?.signature,
+ provider,
+ network.name,
+ ),
+ );
+ };
+
+ const loader = useRef();
+
+ useEffect(() => {
+ if (claimStatus === MINING) {
+ loader.current = toast.loading(
+ "Please wait while the transaction is being mined...",
+ );
+ }
+ if (claimStatus === MINED) {
+ toast.update(loader.current, {
+ render: "Transaction mined succesfully",
+ type: "success",
+ isLoading: false,
+ });
+ navigate(ROUTE_FINISH);
+ toast.dismiss(loader.current);
}
+ }, [claimStatus]);
- const loader = useRef()
+ return (
+
+
+
+
+
+
- useEffect(() => {
- if (claimStatus === MINING) {
- loader.current = toast.loading("Please wait while the transaction is being mined...")
- }
- if (claimStatus === MINED) {
- toast.update(loader.current, { render: "Transaction mined succesfully", type: "success", isLoading: false });
- navigate(ROUTE_FINISH)
- toast.dismiss(loader.current)
- }
- }, [claimStatus])
+
+
+
- return (
-
-
-
-
-
-
-
-
-
-
+
+ 0.002 ETH (~$30) gas fee will be involved for claiming transaction
+
-
- 0.002 ETH (~$30) gas fee will be involved for claiming transaction
-
-
-
-
-
-
-
-
-
- )
-}
+
+
+
+
+
+
+
+ );
+};
-export default DonePage;
\ No newline at end of file
+export default DonePage;
diff --git a/web/src/pages/done-page/done-page.module.css b/web/src/pages/done-page/done-page.module.css
index 75505ca..1474c37 100644
--- a/web/src/pages/done-page/done-page.module.css
+++ b/web/src/pages/done-page/done-page.module.css
@@ -1,82 +1,86 @@
.background {
- padding-top: 54px;
+ padding-top: 54px;
- background: radial-gradient(50% 45.85% at 50% 54.15%, #C51103 0%, #DC9E61 100%), #C4C4C4;
- background-image: url('../../images/Rectangle 76.21553159.webp');
- background-repeat: no-repeat;
- background-size: 100% 100%;
+ background: radial-gradient(
+ 50% 45.85% at 50% 54.15%,
+ #c51103 0%,
+ #dc9e61 100%
+ ),
+ #c4c4c4;
+ background-image: url("../../images/Rectangle 76.21553159.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
}
.progress {
- margin-bottom: 51px;
+ margin-bottom: 51px;
}
.title {
- max-width: 1028px;
- margin-bottom: 20px;
+ max-width: 1028px;
+ margin-bottom: 20px;
}
.caption {
- margin: 0;
- margin-bottom: 50px;
- font-family: 'Hauora_Regular', sans-serif;
- font-size: 13px;
- line-height: 18px;
- color: rgb(255, 255, 255);
+ margin: 0;
+ margin-bottom: 50px;
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+ color: rgb(255, 255, 255);
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
.wallets {
- margin: 0;
- padding: 0;
- display: flex;
- margin-bottom: 15px;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ margin-bottom: 15px;
- list-style: none;
+ list-style: none;
}
.wallet {
- margin-right: 10px;
+ margin-right: 10px;
}
.wallet:last-child {
- margin-right: 0;
+ margin-right: 0;
}
.button {
- margin-bottom: 345px;
+ margin-bottom: 345px;
}
@media screen and (max-width: 900px) {
- .main {
- padding: 0 15px;
- }
+ .main {
+ padding: 0 15px;
+ }
}
@media screen and (max-width: 490px) {
- .wallets {
- display: block;
- }
- .wallet {
- margin-right: 0;
- margin-bottom: 10;
- max-width: 200px;
- }
+ .wallets {
+ display: block;
+ }
+ .wallet {
+ margin-right: 0;
+ margin-bottom: 10;
+ max-width: 200px;
+ }
- .wallet:last-child {
- margin-bottom: 0;
-
- }
+ .wallet:last-child {
+ margin-bottom: 0;
+ }
}
@media screen and (max-width: 435px) {
- .progress {
- position: absolute;
- right: 20px;
- }
+ .progress {
+ position: absolute;
+ right: 20px;
+ }
- .wallets {
- margin-top: 60px;
- }
-}
\ No newline at end of file
+ .wallets {
+ margin-top: 60px;
+ }
+}
diff --git a/web/src/pages/finish-page/finish-page.js b/web/src/pages/finish-page/finish-page.js
index f20741f..2495bcf 100644
--- a/web/src/pages/finish-page/finish-page.js
+++ b/web/src/pages/finish-page/finish-page.js
@@ -1,85 +1,90 @@
-import React from 'react';
-import { useSelector } from 'react-redux';
+import React from "react";
+import { useSelector } from "react-redux";
-import Header from '../../components/Header/Header';
-import Progress from '../../components/Progress/Progress';
-import Title from '../../components/Title/Title';
-import WalletInfo from '../../components/WalletInfo/WalletInfo';
-import Button from '../../components/Button/Button';
-import Footer from '../../components/Footer/Footer';
-import Url from '../../components/Url/Url';
-import styles from './finish-page.module.css';
-import { hideString } from '../../utils';
-import { addTokenToMetamask } from '../../utils/metamask';
-import { governanceContracts } from '../../constants';
-import TwitterShare from '../../hoc/TwitterShare';
+import Header from "../../components/Header/Header";
+import Progress from "../../components/Progress/Progress";
+import Title from "../../components/Title/Title";
+import WalletInfo from "../../components/WalletInfo/WalletInfo";
+import Button from "../../components/Button/Button";
+import Footer from "../../components/Footer/Footer";
+import Url from "../../components/Url/Url";
+import styles from "./finish-page.module.css";
+import { hideString } from "../../utils";
+import { addTokenToMetamask } from "../../utils/metamask";
+import { governanceContracts } from "../../constants";
+import TwitterShare from "../../hoc/TwitterShare";
import { useWeb3Connection } from "../../hooks/useWeb3Connection";
-const TwitterShareButton = TwitterShare(Button)
+const TwitterShareButton = TwitterShare(Button);
const FinishPage = () => {
- const { address, network } = useWeb3Connection();
- const { delegatee } = useSelector(state => state.governance.values)
- const { currentAward } = useSelector(state => state.distributor)
+ const { address, network } = useWeb3Connection();
+ const { delegatee } = useSelector((state) => state.governance.values);
+ const { currentAward } = useSelector((state) => state.distributor);
- const handleAddToken = () => {
- addTokenToMetamask(governanceContracts[network.name].token)
- }
+ const handleAddToken = () => {
+ addTokenToMetamask(governanceContracts[network.name].token);
+ };
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 🔥
-
+ return (
+
+
+
+
+
-
- You have successfully claimed the FLT reward!
-
-
-
-
-
-
- )
-}
+
+
+
+
-export default FinishPage;
\ No newline at end of file
+
+
+ 🔥
+
+
+
+ You have successfully claimed the FLT reward!
+
+
+
+
+
+
+ );
+};
+
+export default FinishPage;
diff --git a/web/src/pages/finish-page/finish-page.module.css b/web/src/pages/finish-page/finish-page.module.css
index 61bf224..219498d 100644
--- a/web/src/pages/finish-page/finish-page.module.css
+++ b/web/src/pages/finish-page/finish-page.module.css
@@ -1,194 +1,190 @@
.background {
- position: relative;
- padding-top: 54px;
+ position: relative;
+ padding-top: 54px;
- background-color: rgb(0, 0, 0);
+ background-color: rgb(0, 0, 0);
- background-size: 100% 100%;
+ background-size: 100% 100%;
}
.background__image {
- position: absolute;
- top: 0;
- left: 0;
- padding-top: 54px;
-
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding-top: 54px;
- width: 100%;
- height: 1020px;
- background-image: url('../../images/bg-finish.webp');
- background-repeat: no-repeat;
- background-size: 100% 1020px;
+ width: 100%;
+ height: 1020px;
+ background-image: url("../../images/bg-finish.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 1020px;
}
.header {
- position: relative;
-
- margin-bottom: 103px;
+ position: relative;
+
+ margin-bottom: 103px;
}
.progress {
- margin-bottom: 51px;
+ margin-bottom: 51px;
}
.wallets {
- position: relative;
+ position: relative;
- margin: 0;
- margin-bottom: 15px;
- padding: 0;
- display: flex;
+ margin: 0;
+ margin-bottom: 15px;
+ padding: 0;
+ display: flex;
- list-style: none;
+ list-style: none;
}
.wallet {
- margin-right: 10px;
+ margin-right: 10px;
}
.title {
- position: relative;
+ position: relative;
- display: flex;
+ display: flex;
- margin: 0;
- margin-bottom: 43px;
+ margin: 0;
+ margin-bottom: 43px;
}
.icon-fire {
- font-size: 80px;
- line-height: 88px;
- margin-left: 10px;
+ font-size: 80px;
+ line-height: 88px;
+ margin-left: 10px;
}
.caption {
- position: relative;
- z-index: 2;
+ position: relative;
+ z-index: 2;
- margin: 0;
- margin-bottom: 33px;
+ margin: 0;
+ margin-bottom: 33px;
- font-family: "Hauora_Regular", sans-serif;
+ font-family: "Hauora_Regular", sans-serif;
- font-size: 24px;
- line-height: 33px;
- color: rgb(255, 255, 255);
+ font-size: 24px;
+ line-height: 33px;
+ color: rgb(255, 255, 255);
-
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
-
-
.buttons {
- position: relative;
- z-index: 2;
-
- margin: 0;
- margin-bottom: 276px;
- padding: 0;
- display: flex;
+ position: relative;
+ z-index: 2;
- list-style: none;
+ margin: 0;
+ margin-bottom: 276px;
+ padding: 0;
+ display: flex;
+
+ list-style: none;
}
.button {
- margin-right: 17px;
+ margin-right: 17px;
}
.button:last-child {
- margin-right: 0;
- align-self: center;
+ margin-right: 0;
+ align-self: center;
}
.involved {
- margin-bottom: 100px;
+ margin-bottom: 100px;
}
.involved__title {
- margin-bottom: 61px;
+ margin-bottom: 61px;
}
.involved__list {
- max-width: 817px;
+ max-width: 817px;
}
.conversation {
- margin-bottom: 136px;
+ margin-bottom: 136px;
}
.conversation__title {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
@media screen and (max-width: 1366px) {
- .icon-fire {
- font-size: 60px;
- line-height: 70px;
- }
+ .icon-fire {
+ font-size: 60px;
+ line-height: 70px;
+ }
}
@media screen and (max-width: 1275px) {
- .main {
- width: 100%;
- }
+ .main {
+ width: 100%;
+ }
- .involved__list {
- max-width: 100%;
- }
+ .involved__list {
+ max-width: 100%;
+ }
}
@media screen and (max-width: 810px) {
- .main {
- padding: 0 15px;
- }
+ .main {
+ padding: 0 15px;
+ }
- .buttons {
- display: block;
- margin-bottom: 117px;
- }
+ .buttons {
+ display: block;
+ margin-bottom: 117px;
+ }
- .button {
- margin-right: 0;
- margin-bottom: 10px;
- }
+ .button {
+ margin-right: 0;
+ margin-bottom: 10px;
+ }
- .button:last-child {
- margin-bottom: 0;
- margin-top:20px;
- }
+ .button:last-child {
+ margin-bottom: 0;
+ margin-top: 20px;
+ }
}
@media screen and (max-width: 600px) {
- .icon-fire {
- font-size: 42px;
- line-height: 50px;
- }
+ .icon-fire {
+ font-size: 42px;
+ line-height: 50px;
+ }
}
@media screen and (max-width: 435px) {
- .wallets {
- display: block;
- margin-bottom: 15px;
- margin-top: 60px;
- }
-
- .wallet {
- margin-right: 0;
- margin-bottom: 10px;
- max-width: 200px;
- }
-
- .wallet:last-child {
- margin-bottom: 0;
- }
-
- .icon-fire {
- display: none;
- }
-
- .progress {
- position: absolute;
- right: 20px;
- }
-}
\ No newline at end of file
+ .wallets {
+ display: block;
+ margin-bottom: 15px;
+ margin-top: 60px;
+ }
+
+ .wallet {
+ margin-right: 0;
+ margin-bottom: 10px;
+ max-width: 200px;
+ }
+
+ .wallet:last-child {
+ margin-bottom: 0;
+ }
+
+ .icon-fire {
+ display: none;
+ }
+
+ .progress {
+ position: absolute;
+ right: 20px;
+ }
+}
diff --git a/web/src/pages/not-found-account-page/not-found-account-page.js b/web/src/pages/not-found-account-page/not-found-account-page.js
index 1f891bd..15f14bc 100644
--- a/web/src/pages/not-found-account-page/not-found-account-page.js
+++ b/web/src/pages/not-found-account-page/not-found-account-page.js
@@ -1,71 +1,102 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
+import React from "react";
+import { Link } from "react-router-dom";
-import Header from '../../components/Header/Header';
+import Header from "../../components/Header/Header";
-import Title from '../../components/Title/Title';
-import Dashboard from '../../components/Dashboard/Dashboard';
-import LinkWithIcon from '../../components/LinkWithIcon/LinkWithIcon';
-import Footer from '../../components/Footer/Footer';
+import Title from "../../components/Title/Title";
+import Dashboard from "../../components/Dashboard/Dashboard";
+import LinkWithIcon from "../../components/LinkWithIcon/LinkWithIcon";
+import Footer from "../../components/Footer/Footer";
-import dialogBlack from '../../images/dialog-black.svg';
-import telegramBlack from '../../images/telegram-black.svg';
-import discordBlack from '../../images/discord-black.svg';
-import styles from './not-found-account-page.module.css';
+import dialogBlack from "../../images/dialog-black.svg";
+import telegramBlack from "../../images/telegram-black.svg";
+import discordBlack from "../../images/discord-black.svg";
+import styles from "./not-found-account-page.module.css";
const AccountNotFound = () => {
- return (
-
-
-
-
-
-
-
+ return (
+
+
+
+
-
-
-
-
-
-
- Your account hasn’t been included in the list. Only people who contributed to the development of selected Web3 projects are included. If we missed you ... we are sorry!
-
-
- Also, there could be a case that you haven’t uploaded public keys to your Github account, so we couldn’t add you to the reward. Learn more about how this reward is designed.
-
-
- Don’t worry, there will be other ways to get FLT. The Fluence DAO will work on various programs that would allow to earn FLT for valuable contributions.
-
-
- If you are interested in getting FLT now, you can buy it on Uniswap.
-
-
-
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
-
+
+
+
+
+
+
+
+
+ Your account hasn’t been included in the list. Only people who
+ contributed to the development of selected Web3 projects are
+ included. If we missed you ... we are sorry!
+
+
+ Also, there could be a case that you haven’t uploaded public
+ keys to your Github account, so we couldn’t add you to the
+ reward.{" "}
+
+ Learn more
+ {" "}
+ about how this reward is designed.
+
+
+ Don’t worry, there will be other ways to get FLT. The Fluence
+ DAO will work on various programs that would allow to earn FLT
+ for valuable contributions.
+
+
+ If you are interested in getting FLT now, you can{" "}
+
+ buy it on Uniswap.
+
+
+
+
+
-
+
+
+
+
+
+
+
+ );
+};
-
-
-
-
-
-
- )
-}
-
-export default AccountNotFound;
\ No newline at end of file
+export default AccountNotFound;
diff --git a/web/src/pages/not-found-account-page/not-found-account-page.module.css b/web/src/pages/not-found-account-page/not-found-account-page.module.css
index 3eaaefa..2f0be82 100644
--- a/web/src/pages/not-found-account-page/not-found-account-page.module.css
+++ b/web/src/pages/not-found-account-page/not-found-account-page.module.css
@@ -1,126 +1,121 @@
.background {
- padding-top: 54px;
+ padding-top: 54px;
- background: rgba(177, 169, 153, 1);
- background-image: url('../../images/Rectangle 76.21553159.webp');
- background-repeat: no-repeat;
- background-size: 100% 100%;
+ background: rgba(177, 169, 153, 1);
+ background-image: url("../../images/Rectangle 76.21553159.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
}
.header {
- margin-bottom: 149px;
+ margin-bottom: 149px;
}
.title {
- margin-bottom: 80px;
- max-width: 925px;
+ margin-bottom: 80px;
+ max-width: 925px;
}
.dashboard {
- margin-bottom: 155px;
- max-width: 1028px;
+ margin-bottom: 155px;
+ max-width: 1028px;
}
-
.dashboard__text {
- margin: 0;
- padding: 0;
- margin-bottom: 15px;
+ margin: 0;
+ padding: 0;
+ margin-bottom: 15px;
- font-family: "Hauora_Regular", sans-serif;
- color:rgb(0, 0, 0);
- font-size: 24px;
- line-height: 33px;
+ font-family: "Hauora_Regular", sans-serif;
+ color: rgb(0, 0, 0);
+ font-size: 24px;
+ line-height: 33px;
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
.dashboard__text_mid {
- font-size: 18px;
- line-height: 24px;
+ font-size: 18px;
+ line-height: 24px;
}
-
.dashboard__caption {
- margin-bottom: 40px;
+ margin-bottom: 40px;
- font-family: "Hauora_Regular", sans-serif;
- color:rgba(0, 0, 0, 0.5);
- font-size: 15px;
- line-height: 21px;
+ font-family: "Hauora_Regular", sans-serif;
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 15px;
+ line-height: 21px;
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
.dashboard__link {
- font-family: "Hauora_Bold", sans-serif;
+ font-family: "Hauora_Bold", sans-serif;
}
.dashboard__title {
- margin-top: 79px;
- margin-bottom: 63px;
+ margin-top: 79px;
+ margin-bottom: 63px;
}
.dashboard__list {
- display: flex;
- justify-content: space-between;
- margin: 0 0 30px;
- padding: 0;
+ display: flex;
+ justify-content: space-between;
+ margin: 0 0 30px;
+ padding: 0;
- list-style: none;
+ list-style: none;
}
.dashboard__item {
- display: flex;
-
+ display: flex;
- font-family: "Hauora_Regular", sans-serif;
- font-size: 18px;
- line-height: 32px;
- color: rgb(0, 0, 0);
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 18px;
+ line-height: 32px;
+ color: rgb(0, 0, 0);
}
.dashboard__caption {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
.dashboard__button {
- margin-bottom: 32px;
+ margin-bottom: 32px;
}
-
.dashboard__link {
- color: rgb(0, 0, 0);
+ color: rgb(0, 0, 0);
}
.dashboard__link:hover {
- color: rgba(0, 0, 0, 0.5);
- cursor: pointer;
+ color: rgba(0, 0, 0, 0.5);
+ cursor: pointer;
}
@media screen and (max-width: 1200px) {
- .dashboard__list {
- display: block;
- }
+ .dashboard__list {
+ display: block;
+ }
- .dashboard__item {
- margin-bottom: 32px;
- }
+ .dashboard__item {
+ margin-bottom: 32px;
+ }
}
@media screen and (max-width: 900px) {
- .main {
- padding: 0 15px;
- }
+ .main {
+ padding: 0 15px;
+ }
}
@media screen and (max-width: 500px) {
- .main {
- padding: 0;
- }
+ .main {
+ padding: 0;
+ }
- .title {
- padding: 0 15px;
- }
+ .title {
+ padding: 0 15px;
+ }
}
-
diff --git a/web/src/pages/proof-page/proof-page.js b/web/src/pages/proof-page/proof-page.js
index bb7eb1e..2430de4 100644
--- a/web/src/pages/proof-page/proof-page.js
+++ b/web/src/pages/proof-page/proof-page.js
@@ -1,183 +1,253 @@
-import React, { useEffect, useState } from 'react';
-import { Link, useNavigate } from 'react-router-dom';
-import { useDispatch, useSelector } from 'react-redux';
-
-import Header from '../../components/Header/Header';
-import Progress from '../../components/Progress/Progress';
-import Title from '../../components/Title/Title';
-import Button from '../../components/Button/Button';
-import Dashboard from '../../components/Dashboard/Dashboard';
-import WalletInfo from '../../components/WalletInfo/WalletInfo';
-import TextArea from '../../components/TextArea/TextArea';
-import Footer from '../../components/Footer/Footer';
-
-import danger from '../../images/danger.svg';
-import styles from './proof-page.module.css';
-import { hideString } from '../../utils';
-
-import { checkHasClaimed, storeProof } from '../../store/actions/governance';
-import { ROUTE_CLAIMED, ROUTE_DONE } from '../../constants/routes';
-import { toast } from 'react-toastify';
-import { MerkleTree } from 'merkletreejs';
-import keccak256 from 'keccak256';
-import { hashedLeaf } from '../../utils/award'
+import React, { useEffect, useState } from "react";
+import { Link, useNavigate } from "react-router-dom";
+import { useDispatch, useSelector } from "react-redux";
+
+import Header from "../../components/Header/Header";
+import Progress from "../../components/Progress/Progress";
+import Title from "../../components/Title/Title";
+import Button from "../../components/Button/Button";
+import Dashboard from "../../components/Dashboard/Dashboard";
+import WalletInfo from "../../components/WalletInfo/WalletInfo";
+import TextArea from "../../components/TextArea/TextArea";
+import Footer from "../../components/Footer/Footer";
+
+import danger from "../../images/danger.svg";
+import styles from "./proof-page.module.css";
+import { hideString } from "../../utils";
+
+import { checkHasClaimed, storeProof } from "../../store/actions/governance";
+import { ROUTE_CLAIMED, ROUTE_DONE } from "../../constants/routes";
+import { toast } from "react-toastify";
+import { MerkleTree } from "merkletreejs";
+import keccak256 from "keccak256";
+import { hashedLeaf } from "../../utils/award";
import { Buffer } from "buffer";
-import { validateASN1Signature } from '../../utils/asn1';
-import { ethers } from 'ethers';
+import { validateASN1Signature } from "../../utils/asn1";
+import { ethers } from "ethers";
import { useWeb3Connection } from "../../hooks/useWeb3Connection";
const ProofPage = () => {
- const { address, provider, network } = useWeb3Connection();
- const { proof } = useSelector(state => state.governance.values)
- const [ haveProof, setHaveProof ] = useState(!!proof)
- const { hasClaimed } = useSelector(state => state.governance)
+ const { address, provider, network } = useWeb3Connection();
+ const { proof } = useSelector((state) => state.governance.values);
+ const [haveProof, setHaveProof] = useState(!!proof);
+ const { hasClaimed } = useSelector((state) => state.governance);
- const { merkleRoot } = useSelector(state => state.distributor)
+ const { merkleRoot } = useSelector((state) => state.distributor);
- const navigate = useNavigate()
- const dispatch = useDispatch()
- const [ proofValue, setProofValue ] = useState('')
+ const navigate = useNavigate();
+ const dispatch = useDispatch();
+ const [proofValue, setProofValue] = useState("");
- console.log("merkleRoot is", merkleRoot);
+ console.log("merkleRoot is", merkleRoot);
- window.Buffer = Buffer;
+ window.Buffer = Buffer;
- useEffect(() => {
- if(hasClaimed?.claimed) {
- navigate(ROUTE_CLAIMED)
- }
- }, [hasClaimed])
-
- function fromHex(str) {
- if (str.startsWith('0x')) {
- return Buffer.from(str.slice(2), 'hex');
- } else {
- return Buffer.from(str, 'hex');
- }
+ useEffect(() => {
+ if (hasClaimed?.claimed) {
+ navigate(ROUTE_CLAIMED);
}
+ }, [hasClaimed]);
- const handleForm = async (e) => {
- e.preventDefault()
-
+ function fromHex(str) {
+ if (str.startsWith("0x")) {
+ return Buffer.from(str.slice(2), "hex");
+ } else {
+ return Buffer.from(str, "hex");
+ }
+ }
+
+ const handleForm = async (e) => {
+ e.preventDefault();
+
+ try {
+ // TODO: validate data better
+ let [userId, tmpEthAddrNoPrefix, signatureHex, merkleProofHex] =
+ proofValue.split(",");
+ let tmpEthAddr = "0x" + tmpEthAddrNoPrefix;
+
+ dispatch(checkHasClaimed(userId, provider, network.name));
+
+ try {
+ console.log("signatureHex", signatureHex);
+ console.log("tmpEthAddr", tmpEthAddr);
+ let asn1Signature = Buffer.from(signatureHex, "hex");
+ let merkleProof = JSON.parse(
+ Buffer.from(merkleProofHex, "base64").toString(),
+ );
try {
- // TODO: validate data better
- let [ userId, tmpEthAddrNoPrefix, signatureHex, merkleProofHex ] = proofValue.split(",");
- let tmpEthAddr = '0x' + tmpEthAddrNoPrefix;
-
- dispatch(checkHasClaimed(userId, provider, network.name));
-
- try {
- console.log("signatureHex", signatureHex);
- console.log("tmpEthAddr", tmpEthAddr);
- let asn1Signature = Buffer.from(signatureHex, "hex");
- let merkleProof = JSON.parse(Buffer.from(merkleProofHex, "base64").toString());
- try {
- console.log("address is", fromHex(address));
- let signedHash = ethers.utils.hashMessage(fromHex(address));
- console.log("Signed Hash", signedHash);
- let signature = validateASN1Signature(signedHash, asn1Signature, tmpEthAddr);
- console.log("Signature is correct.", signature);
-
- const leaf = await hashedLeaf(userId, tmpEthAddr);
- const verified = MerkleTree.verify(
- merkleProof,
- leaf,
- merkleRoot,
- keccak256,
- { hashLeaves: false, sortPairs: true }
- )
- if (verified) {
- setHaveProof(true)
- dispatch(storeProof({ userId, tmpEthAddr, signature, merkleProof }))
- } else {
- toast('Invalid merkle proof. Please check the data.')
- }
- } catch (error) {
- console.log(error);
- toast('Invalid signature.')
- }
- } catch (error) {
- console.log(error);
- toast('Invalid proof format. Please check the data. It should be [userId,tmpEthAddr,signatureHex,merkleProofHex].')
- }
+ console.log("address is", fromHex(address));
+ let signedHash = ethers.utils.hashMessage(fromHex(address));
+ console.log("Signed Hash", signedHash);
+ let signature = validateASN1Signature(
+ signedHash,
+ asn1Signature,
+ tmpEthAddr,
+ );
+ console.log("Signature is correct.", signature);
+
+ const leaf = await hashedLeaf(userId, tmpEthAddr);
+ const verified = MerkleTree.verify(
+ merkleProof,
+ leaf,
+ merkleRoot,
+ keccak256,
+ { hashLeaves: false, sortPairs: true },
+ );
+ if (verified) {
+ setHaveProof(true);
+ dispatch(
+ storeProof({ userId, tmpEthAddr, signature, merkleProof }),
+ );
+ } else {
+ toast("Invalid merkle proof. Please check the data.");
+ }
} catch (error) {
- console.log(error);
- toast('The proof should be a valid hex string');
+ console.log(error);
+ toast("Invalid signature.");
}
+ } catch (error) {
+ console.log(error);
+ toast(
+ "Invalid proof format. Please check the data. It should be [userId,tmpEthAddr,signatureHex,merkleProofHex].",
+ );
+ }
+ } catch (error) {
+ console.log(error);
+ toast("The proof should be a valid hex string");
}
+ };
- useEffect(() => {
- if (haveProof & !hasClaimed?.claimed & hasClaimed?.checked) {
- navigate(ROUTE_DONE)
- }
- }, [haveProof, hasClaimed])
-
-
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
+ useEffect(() => {
+ if (haveProof & !hasClaimed?.claimed & hasClaimed?.checked) {
+ navigate(ROUTE_DONE);
+ }
+ }, [haveProof, hasClaimed]);
+
+ return (
+
+
+
+
+
+
+
- )
-}
-
-export default ProofPage;
\ No newline at end of file
+
+
+
+
+
+
+
+ If you are an advanced Ethereum user, you can claim directly
+ from the smart contract.{" "}
+
+ Learn how to do it
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default ProofPage;
diff --git a/web/src/pages/proof-page/proof-page.module.css b/web/src/pages/proof-page/proof-page.module.css
index 2fc4aa9..794faf5 100644
--- a/web/src/pages/proof-page/proof-page.module.css
+++ b/web/src/pages/proof-page/proof-page.module.css
@@ -1,189 +1,194 @@
.background {
- padding-top: 54px;
+ padding-top: 54px;
- background: radial-gradient(50% 45.85% at 50% 54.15%, #C51103 0%, #DC9E61 100%), #C4C4C4;
- background-image: url('../../images/Rectangle 76.21553159.webp');
- background-repeat: no-repeat;
- background-size: 100% 100%;
+ background: radial-gradient(
+ 50% 45.85% at 50% 54.15%,
+ #c51103 0%,
+ #dc9e61 100%
+ ),
+ #c4c4c4;
+ background-image: url("../../images/Rectangle 76.21553159.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
}
.container {
- display: flex;
- box-sizing: border-box;
+ display: flex;
+ box-sizing: border-box;
}
.content {
- padding: 0 90px;
- max-width: 1420px;
- margin: 0 auto;
+ padding: 0 90px;
+ max-width: 1420px;
+ margin: 0 auto;
}
.main1 {
- width: 100%;
+ width: 100%;
}
.wallet {
- max-width: 200px;
+ max-width: 200px;
}
.progress {
- margin-bottom: 30px;
+ margin-bottom: 30px;
}
.title {
- margin-bottom: 82px;
+ margin-bottom: 82px;
}
.dashboard {
- max-width: 1420px;
- padding: 0 90px;
- margin: 0 auto 161px;
- overflow: hidden;
+ max-width: 1420px;
+ padding: 0 90px;
+ margin: 0 auto 161px;
+ overflow: hidden;
}
.dashboard__flex-container {
- display: flex;
- align-items: center;
- margin-bottom: 53px;
+ display: flex;
+ align-items: center;
+ margin-bottom: 53px;
}
.dashboard__logo {
- width: 80px;
- height: 80px;
- margin-right: 19px;
+ width: 80px;
+ height: 80px;
+ margin-right: 19px;
- background-color: rgb(239, 127, 36);
- background-image: url("../../images/Ф.svg");
- background-repeat: no-repeat;
- background-position: center;
+ background-color: rgb(239, 127, 36);
+ background-image: url("../../images/Ф.svg");
+ background-repeat: no-repeat;
+ background-position: center;
- border-radius: 50%;
+ border-radius: 50%;
}
.dashboard__text {
- margin: 0;
- padding: 0;
- margin-bottom: 10px;
+ margin: 0;
+ padding: 0;
+ margin-bottom: 10px;
- font-family: "Hauora_Regular", sans-serif;
- color:rgb(0, 0, 0);
+ font-family: "Hauora_Regular", sans-serif;
+ color: rgb(0, 0, 0);
- letter-spacing: 0.5px;
+ letter-spacing: 0.5px;
}
.paragraph {
- width: 100%;
- padding: 14px;
+ width: 100%;
+ padding: 14px;
- font-family: 'Roboto_Regular' sans-serif;
- font-size: 15px;
- line-height: 18px;
- color: rgb(0, 0, 0);
+ font-family: "Roboto_Regular" sans-serif;
+ font-size: 15px;
+ line-height: 18px;
+ color: rgb(0, 0, 0);
- background-color: rgba(196, 196, 196, 0.5);
+ background-color: rgba(196, 196, 196, 0.5);
- border-radius: 5px;
+ border-radius: 5px;
}
.dashboard__text_size_large {
- font-size: 24px;
- line-height: 33px;
+ font-size: 24px;
+ line-height: 33px;
}
.dashboard__text_size_mid {
- font-size: 18px;
- line-height: 24px;
+ font-size: 18px;
+ line-height: 24px;
}
.dashboard__span {
- font-family: "Hauora_Bold", sans-serif;
+ font-family: "Hauora_Bold", sans-serif;
}
.dashboard__span_decorate_underline {
- text-decoration: underline;
+ text-decoration: underline;
}
.dashboard__list {
- margin: 0 0 30px;
- padding: 0;
- max-width: 711px;
+ margin: 0 0 30px;
+ padding: 0;
+ max-width: 711px;
- list-style: none;
+ list-style: none;
}
.dashboard__item {
- margin-bottom: 16px;
+ margin-bottom: 16px;
- font-family: "Hauora_Regular", sans-serif;
- font-size: 18px;
- line-height: 32px;
- color: rgb(0, 0, 0);
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 18px;
+ line-height: 32px;
+ color: rgb(0, 0, 0);
}
.dashboard__caption {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
.dashboard__button {
- margin-bottom: 32px;
+ margin-bottom: 32px;
}
.dashboard__paragraph {
- position: relative;
+ position: relative;
- font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgba(0, 0, 0, 0.5);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgba(0, 0, 0, 0.5);
- text-transform: uppercase;
- letter-spacing: 1px;
+ text-transform: uppercase;
+ letter-spacing: 1px;
}
.dashboard__link {
- color: rgb(0, 0, 0);
+ color: rgb(0, 0, 0);
}
.dashboard__link:hover {
- color: rgba(0, 0, 0, 0.5);
- cursor: pointer;
+ color: rgba(0, 0, 0, 0.5);
+ cursor: pointer;
}
.dashboard__textarea {
- margin-top: 18px;
+ margin-top: 18px;
}
.dashboard__danger {
- position: absolute;
- top: -2px;
- left: 0;
- width: 23px;
- height: 23px;
+ position: absolute;
+ top: -2px;
+ left: 0;
+ width: 23px;
+ height: 23px;
}
.dashboard__paragraph_pl_27 {
- padding-left: 27px;
+ padding-left: 27px;
}
@media screen and (max-width: 1100px) {
- .content,
- .dashboard {
- padding: 0 40px;
- }
+ .content,
+ .dashboard {
+ padding: 0 40px;
+ }
}
@media screen and (max-width: 900px) {
- .content,
- .dashboard {
- padding: 0 15px;
- }
+ .content,
+ .dashboard {
+ padding: 0 15px;
+ }
}
@media screen and (max-width: 500px) {
- .dashboard {
- padding: 0;
- }
- .dashboard__link {
- display: block;
- }
-}
\ No newline at end of file
+ .dashboard {
+ padding: 0;
+ }
+ .dashboard__link {
+ display: block;
+ }
+}
diff --git a/web/src/pages/step1-page/step1-page.js b/web/src/pages/step1-page/step1-page.js
index f988514..2097be0 100644
--- a/web/src/pages/step1-page/step1-page.js
+++ b/web/src/pages/step1-page/step1-page.js
@@ -1,90 +1,98 @@
-import React, { memo, useEffect } from 'react';
-import { Link, useNavigate } from 'react-router-dom';
+import React, { memo, useEffect, useState } from "react";
+import { Link, useNavigate } from "react-router-dom";
-import Header from '../../components/Header/Header';
-import Progress from '../../components/Progress/Progress';
-import Title from '../../components/Title/Title';
-import Text from '../../components/Text/Text';
-import DefinitionList from '../../components/DefinitionList/DefinitionList';
-import Dashboard from '../../components/Dashboard/Dashboard';
-import Footer from '../../components/Footer/Footer';
+import Header from "../../components/Header/Header";
+import Progress from "../../components/Progress/Progress";
+import Title from "../../components/Title/Title";
+import Text from "../../components/Text/Text";
+import DefinitionList from "../../components/DefinitionList/DefinitionList";
+import Dashboard from "../../components/Dashboard/Dashboard";
+import Footer from "../../components/Footer/Footer";
-import ConnectWallet from '../../components/ConnectWallet/ConnectWallet';
+import ConnectWallet from "../../components/ConnectWallet/ConnectWallet";
-import styles from './step1-page.module.css';
-import { useSelector } from 'react-redux';
-import { ROUTE_PROOF } from '../../constants/routes';
+import styles from "./step1-page.module.css";
+import { useSelector } from "react-redux";
+import { ROUTE_PROOF } from "../../constants/routes";
import { useWeb3Connection } from "../../hooks/useWeb3Connection";
const FirstStepPage = memo(() => {
- const navigate = useNavigate()
- const { address, provider } = useWeb3Connection();
- const { currentAward } = useSelector(state => state.distributor)
+ const navigate = useNavigate();
+ const { address } = useWeb3Connection();
+ const { currentAward } = useSelector((state) => state.distributor);
- useEffect(() => {
- if (address) {
- navigate(ROUTE_PROOF)
- }
- }, [address])
+ useEffect(() => {
+ if (address) {
+ navigate(ROUTE_PROOF);
+ }
+ }, [address]);
- return (
-
-
-
-
-
-
-
- 🔥
-
-
-
-
-
-
-
- Claiming will require an Ethereum wallet and performing basic tasks with terminal on your computer.
-
-
-
- -
- Connect an Ethereum wallet
-
- -
- Generate proof of Github account ownership
-
- -
- Delegate or self-delegate DAO voting power
-
- -
- Receive the tokens
-
-
-
-
- Two Ethereum transactions of 0.001 ETH & 0.002 ETH gas fees will be involved on steps 3 & 4
-
-
-
-
-
-
- If you are an advanced Ethereum user, you can claim directly from the smart contract. Learn how to do it
-
-
-
-
-
-
-
- )
-})
+ return (
+
+
+
+
+
+
+
+ 🔥
+
+
+
+
+
+
+ Claiming will require an Ethereum wallet and performing basic
+ tasks with terminal on your computer.
+
+
+
+ -
+ Connect an Ethereum wallet
+
+ -
+ Generate proof of Github account ownership
+
+ -
+ Delegate or self-delegate DAO voting power
+
+ - Receive the tokens
+
+
+
+ Two Ethereum transactions of 0.001 ETH & 0.002 ETH gas fees
+ will be involved on steps 3 & 4
+
+
+
+
+
+
+ If you are an advanced Ethereum user, you can claim directly
+ from the smart contract.{" "}
+
+ Learn how to do it
+
+
+
+
+
+
+
+
+ );
+});
-export default FirstStepPage;
\ No newline at end of file
+export default FirstStepPage;
diff --git a/web/src/pages/step1-page/step1-page.module.css b/web/src/pages/step1-page/step1-page.module.css
index 100c138..14f292b 100644
--- a/web/src/pages/step1-page/step1-page.module.css
+++ b/web/src/pages/step1-page/step1-page.module.css
@@ -1,167 +1,169 @@
.background {
- padding-top: 54px;
+ padding-top: 54px;
- background: radial-gradient(50% 45.85% at 50% 54.15%, #C51103 0%, #DC9E61 100%), #C4C4C4;
- background-image: url('../../images/Rectangle 76.21553159.webp');
- background-repeat: no-repeat;
- background-size: 100% 100%;
+ background: radial-gradient(
+ 50% 45.85% at 50% 54.15%,
+ #c51103 0%,
+ #dc9e61 100%
+ ),
+ #c4c4c4;
+ background-image: url("../../images/Rectangle 76.21553159.webp");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
}
.progress {
- margin-bottom: 30px;
+ margin-bottom: 30px;
}
.title {
- align-items: flex-end;
- display: flex;
- margin-bottom: 82px;
+ align-items: flex-end;
+ display: flex;
+ margin-bottom: 82px;
}
.icon {
- width: 60px;
- height: 80px;
+ width: 60px;
+ height: 80px;
- background-image: url('https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/160/apple/285/fire_1f525.png');
- background-position: center;
- background-repeat: no-repeat;
+ background-image: url("https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/160/apple/285/fire_1f525.png");
+ background-position: center;
+ background-repeat: no-repeat;
}
.definition {
- width: 234px;
+ width: 234px;
}
.dashboard {
- margin-bottom: 161px;
+ margin-bottom: 161px;
}
.dashboard__flex-container {
- display: flex;
- align-items: center;
- margin-bottom: 53px;
+ display: flex;
+ align-items: center;
+ margin-bottom: 53px;
}
.dashboard__logo {
- width: 80px;
- height: 80px;
- margin-right: 19px;
+ width: 80px;
+ height: 80px;
+ margin-right: 19px;
- background-color: rgb(239, 127, 36);
- background-image: url("../../images/Ф.svg");
- background-repeat: no-repeat;
- background-position: center;
+ background-color: rgb(239, 127, 36);
+ background-image: url("../../images/Ф.svg");
+ background-repeat: no-repeat;
+ background-position: center;
- border-radius: 50%;
+ border-radius: 50%;
}
.dashboard__text {
- margin-bottom: 10px;
- max-width: 785px;
+ margin-bottom: 10px;
+ max-width: 785px;
}
.icon-fire {
- font-size: 80px;
- line-height: 88px;
- margin-left: 10px;
+ font-size: 80px;
+ line-height: 88px;
+ margin-left: 10px;
}
.dashboard__list {
- margin: 0 0 30px;
+ margin: 0 0 30px;
}
.dashboard__item {
- margin-bottom: 16px;
+ margin-bottom: 16px;
- font-family: "Hauora_Regular", sans-serif;
- font-size: 18px;
- line-height: 32px;
- color: rgb(0, 0, 0);
+ font-family: "Hauora_Regular", sans-serif;
+ font-size: 18px;
+ line-height: 32px;
+ color: rgb(0, 0, 0);
}
.dashboard__caption {
- margin-bottom: 50px;
+ margin-bottom: 50px;
}
.dashboard__button {
- margin-bottom: 32px;
+ margin-bottom: 32px;
}
.dashboard__paragraph {
+ margin: 0;
- margin: 0;
-
- font-family: "Hauora_Bold", sans-serif;
- font-size: 10px;
- line-height: 16px;
- color: rgba(0, 0, 0, 0.5);
+ font-family: "Hauora_Bold", sans-serif;
+ font-size: 10px;
+ line-height: 16px;
+ color: rgba(0, 0, 0, 0.5);
- text-transform: uppercase;
- letter-spacing: 1px;
+ text-transform: uppercase;
+ letter-spacing: 1px;
}
.dashboard__link {
- color: rgb(0, 0, 0);
+ color: rgb(0, 0, 0);
}
.dashboard__link:hover {
- color: rgba(0, 0, 0, 0.5);
- cursor: pointer;
+ color: rgba(0, 0, 0, 0.5);
+ cursor: pointer;
}
@media screen and (max-width: 1366px) {
- .icon-fire {
- font-size: 60px;
- line-height: 70px;
- }
+ .icon-fire {
+ font-size: 60px;
+ line-height: 70px;
+ }
}
@media screen and (max-width: 600px) {
- .icon-fire {
- font-size: 42px;
- line-height: 50px;
- }
+ .icon-fire {
+ font-size: 42px;
+ line-height: 50px;
+ }
}
@media screen and (max-width: 1275px) {
- .main {
- width: 100%;
-
- }
+ .main {
+ width: 100%;
+ }
- .dashboard {
- max-width: 100%;
- }
+ .dashboard {
+ max-width: 100%;
+ }
}
@media screen and (max-width: 951px) {
- .dashboard__item {
- width:100%;
- }
+ .dashboard__item {
+ width: 100%;
+ }
}
@media screen and (max-width: 900px) {
- .main {
- padding-right: 15px;
- padding-left: 15px;
- }
+ .main {
+ padding-right: 15px;
+ padding-left: 15px;
+ }
}
@media screen and (max-width: 500px) {
-
- .dashboard__text {
- margin-bottom: 30px;
- }
- .main {
- padding-right: 0;
- padding-left: 0;
- }
-
- .wallet,
- .title,
- .progress {
- margin-left: 15px;
- }
-
- .dashboard__button {
- margin-bottom: 56px;
- }
+ .dashboard__text {
+ margin-bottom: 30px;
+ }
+ .main {
+ padding-right: 0;
+ padding-left: 0;
+ }
+
+ .wallet,
+ .title,
+ .progress {
+ margin-left: 15px;
+ }
+
+ .dashboard__button {
+ margin-bottom: 56px;
+ }
}
diff --git a/web/src/reportWebVitals.js b/web/src/reportWebVitals.js
index 5253d3a..9ecd33f 100644
--- a/web/src/reportWebVitals.js
+++ b/web/src/reportWebVitals.js
@@ -1,6 +1,6 @@
-const reportWebVitals = onPerfEntry => {
+const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
diff --git a/web/src/setupTests.js b/web/src/setupTests.js
index 8f2609b..1dd407a 100644
--- a/web/src/setupTests.js
+++ b/web/src/setupTests.js
@@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom';
+import "@testing-library/jest-dom";
diff --git a/web/src/store/actions/common.js b/web/src/store/actions/common.js
index 0fb5257..cbc14ab 100644
--- a/web/src/store/actions/common.js
+++ b/web/src/store/actions/common.js
@@ -1,17 +1,23 @@
-import { ERROR_CLEANUP, GOV_CLEANUP, GRAPH_CLEANUP, ROUTE_CLEANUP, USER_CLEANUP } from './types'
+import {
+ ERROR_CLEANUP,
+ GOV_CLEANUP,
+ GRAPH_CLEANUP,
+ ROUTE_CLEANUP,
+ USER_CLEANUP,
+} from "./types";
-export const govCleanup = () => ({ type: GOV_CLEANUP })
-export const userCleanup = () => ({ type: USER_CLEANUP })
-export const graphCleanup = () => ({ type: GRAPH_CLEANUP })
-export const errorCleanup = () => ({ type: ERROR_CLEANUP })
-export const routeCleanup = () => ({ type: ROUTE_CLEANUP })
+export const govCleanup = () => ({ type: GOV_CLEANUP });
+export const userCleanup = () => ({ type: USER_CLEANUP });
+export const graphCleanup = () => ({ type: GRAPH_CLEANUP });
+export const errorCleanup = () => ({ type: ERROR_CLEANUP });
+export const routeCleanup = () => ({ type: ROUTE_CLEANUP });
export const reduxCleanup = () => {
- return async dispatch => {
- dispatch(govCleanup())
- dispatch(userCleanup())
- dispatch(graphCleanup())
- dispatch(errorCleanup())
- dispatch(routeCleanup())
- }
-}
\ No newline at end of file
+ return async (dispatch) => {
+ dispatch(govCleanup());
+ dispatch(userCleanup());
+ dispatch(graphCleanup());
+ dispatch(errorCleanup());
+ dispatch(routeCleanup());
+ };
+};
diff --git a/web/src/store/actions/distributor.js b/web/src/store/actions/distributor.js
index 161d5b4..a3d4e4d 100644
--- a/web/src/store/actions/distributor.js
+++ b/web/src/store/actions/distributor.js
@@ -1,6 +1,10 @@
import { governanceContracts } from "../../constants";
import { infuraUrlFactory } from "../../utils";
-import { FETCH_CURRENT_AWARD, FETCH_MERKLE_ROOT, FETCH_NEXT_HALVE_PERIOD, } from "./types";
+import {
+ FETCH_CURRENT_AWARD,
+ FETCH_MERKLE_ROOT,
+ FETCH_NEXT_HALVE_PERIOD,
+} from "./types";
import Web3 from "web3";
import abis from "../../contracts";
@@ -17,7 +21,7 @@ export const fetchMerkleRoot = (network) => {
console.log(governanceContracts[network].devRewardDistributor);
const contract = new web3.eth.Contract(
abis.DevRewardDistributor.abi,
- governanceContracts[network].devRewardDistributor
+ governanceContracts[network].devRewardDistributor,
);
return async (dispatch) => {
@@ -40,13 +44,13 @@ export const fetchCurrentAward = (network) => {
const web3 = new Web3(infuraUrlFactory(network));
const contract = new web3.eth.Contract(
abis.DevRewardDistributor.abi,
- governanceContracts[network].devRewardDistributor
+ governanceContracts[network].devRewardDistributor,
);
return async (dispatch) => {
try {
const award = await contract.methods.currentReward().call();
- const formattedAward = web3.utils.fromWei(award, 'ether');
+ const formattedAward = web3.utils.fromWei(award, "ether");
dispatch(setCurrentAward(formattedAward));
} catch (error) {
console.log(error);
@@ -63,7 +67,7 @@ export const fetchNextHalvePeriod = (network) => {
const web3 = new Web3(infuraUrlFactory(network));
const contract = new web3.eth.Contract(
abis.DevRewardDistributor.abi,
- governanceContracts[network].devRewardDistributor
+ governanceContracts[network].devRewardDistributor,
);
return async (dispatch) => {
diff --git a/web/src/store/actions/governance.js b/web/src/store/actions/governance.js
index 097ef4a..e2112e2 100644
--- a/web/src/store/actions/governance.js
+++ b/web/src/store/actions/governance.js
@@ -1,146 +1,179 @@
import { Contract } from "@ethersproject/contracts";
import abis from "../../contracts";
-import { FAIL, governanceContracts, MINED, MINING, PENDING, REJECTED } from "../../constants";
+import {
+ FAIL,
+ governanceContracts,
+ MINED,
+ MINING,
+ PENDING,
+ REJECTED,
+} from "../../constants";
-import { CLAIM_STATUS, DELEGATE_STATUS, SET_CLAIM_STATUS, SET_DELEGATEE, SET_ERROR, STORE_PROOF } from "./types"
+import {
+ CLAIM_STATUS,
+ DELEGATE_STATUS,
+ SET_CLAIM_STATUS,
+ SET_DELEGATEE,
+ SET_ERROR,
+ STORE_PROOF,
+} from "./types";
import supportedChains from "../../constants/chains";
export const delegateStatus = (status) => ({
- type: DELEGATE_STATUS,
- payload: status
-})
+ type: DELEGATE_STATUS,
+ payload: status,
+});
export const claimStatus = (status) => ({
- type: CLAIM_STATUS,
- payload: status
-})
+ type: CLAIM_STATUS,
+ payload: status,
+});
export const setDelegatee = (address) => ({
- type: SET_DELEGATEE,
- payload: address
-})
+ type: SET_DELEGATEE,
+ payload: address,
+});
export const setError = (message) => {
- let msg
- try {
- const isEthJs = /ethjs-query/.test(message)
- const parsedMessage = isEthJs
- ? JSON.parse(
- message
- .replace("[ethjs-query] while formatting outputs from RPC '", '')
- .slice(0, -1)
- )
- : message
- console.log(parsedMessage)
+ let msg;
+ try {
+ const isEthJs = /ethjs-query/.test(message);
+ const parsedMessage = isEthJs
+ ? JSON.parse(
+ message
+ .replace("[ethjs-query] while formatting outputs from RPC '", "")
+ .slice(0, -1),
+ )
+ : message;
+ console.log(parsedMessage);
- const newMessage = isEthJs
- ? `${parsedMessage.value.data.message}. Error code: ${parsedMessage.value.code}`
- : message
+ const newMessage = isEthJs
+ ? `${parsedMessage.value.data.message}. Error code: ${parsedMessage.value.code}`
+ : message;
- msg = newMessage
- } catch (error) {
- msg = message
- }
- return {
- type: SET_ERROR,
- payload: msg
- }
-}
+ msg = newMessage;
+ } catch (error) {
+ msg = message;
+ }
+ return {
+ type: SET_ERROR,
+ payload: msg,
+ };
+};
-const WRONG_CHAIN_MESSAGE = `Looks like the contract does not support the current network. Please switch to ${supportedChains[0].name}`
+const WRONG_CHAIN_MESSAGE = `Looks like the contract does not support the current network. Please switch to ${supportedChains[0].name}`;
export const claim = (
- userId,
- merkleProof,
- tmpEthAddr,
- senderSignatureHex,
- w3provider,
- network
+ userId,
+ merkleProof,
+ tmpEthAddr,
+ senderSignatureHex,
+ w3provider,
+ network,
) => {
- return async dispatch => {
- let signer = w3provider.getSigner();
+ return async (dispatch) => {
+ let signer = w3provider.getSigner();
+ try {
+ let contract = new Contract(
+ governanceContracts[network].devRewardDistributor,
+ abis.DevRewardDistributor.abi,
+ w3provider,
+ );
+ let signed = await contract.connect(signer);
+ try {
+ console.log("claiming with", {
+ userId,
+ merkleProof,
+ tmpEthAddr,
+ senderSignatureHex,
+ });
+ const tx = await signed.claimTokens(
+ userId,
+ merkleProof,
+ tmpEthAddr,
+ senderSignatureHex,
+ );
+ dispatch(claimStatus(MINING));
try {
- let contract = new Contract(governanceContracts[network].devRewardDistributor, abis.DevRewardDistributor.abi, w3provider);
- let signed = await contract.connect(signer);
- try {
- console.log("claiming with", { userId, merkleProof, tmpEthAddr, senderSignatureHex })
- const tx = await signed.claimTokens(
- userId,
- merkleProof,
- tmpEthAddr,
- senderSignatureHex
- );
- dispatch(claimStatus(MINING))
- try {
- await tx.wait()
- dispatch(claimStatus(MINED))
- } catch (error) {
- dispatch(claimStatus(FAIL))
- dispatch(setError(error.message))
- }
- } catch (error) {
- dispatch(claimStatus(REJECTED))
- dispatch(setError(error?.data?.message || error.message))
- }
+ await tx.wait();
+ dispatch(claimStatus(MINED));
} catch (error) {
- dispatch(setError(WRONG_CHAIN_MESSAGE))
+ dispatch(claimStatus(FAIL));
+ dispatch(setError(error.message));
}
+ } catch (error) {
+ dispatch(claimStatus(REJECTED));
+ dispatch(setError(error?.data?.message || error.message));
+ }
+ } catch (error) {
+ dispatch(setError(WRONG_CHAIN_MESSAGE));
}
-}
+ };
+};
export const setHasClaimed = (hasClaimed) => ({
- type: SET_CLAIM_STATUS,
- payload: {
- checked: true,
- claimed: hasClaimed
- }
-})
+ type: SET_CLAIM_STATUS,
+ payload: {
+ checked: true,
+ claimed: hasClaimed,
+ },
+});
export const checkHasClaimed = (userId, w3provider, network) => {
- return async dispatch => {
- let signer = w3provider.getSigner();
- try {
- let contract = new Contract(governanceContracts[network].devRewardDistributor, abis.DevRewardDistributor.abi, w3provider);
- let signed = await contract.connect(signer);
- try {
- const hasClaimed = await signed.isClaimed(userId);
- console.log(`isClaimed for ${userId} is ${hasClaimed}. Contract is ${governanceContracts[network].devRewardDistributor}`);
- dispatch(setHasClaimed(hasClaimed))
- } catch (error) {
- dispatch(setError('Cannot confirm that tokens are not claimed yet.'))
- console.error(error);
- }
- } catch (error) {
- dispatch(setError(WRONG_CHAIN_MESSAGE))
- }
+ return async (dispatch) => {
+ let signer = w3provider.getSigner();
+ try {
+ let contract = new Contract(
+ governanceContracts[network].devRewardDistributor,
+ abis.DevRewardDistributor.abi,
+ w3provider,
+ );
+ let signed = await contract.connect(signer);
+ try {
+ const hasClaimed = await signed.isClaimed(userId);
+ console.log(
+ `isClaimed for ${userId} is ${hasClaimed}. Contract is ${governanceContracts[network].devRewardDistributor}`,
+ );
+ dispatch(setHasClaimed(hasClaimed));
+ } catch (error) {
+ dispatch(setError("Cannot confirm that tokens are not claimed yet."));
+ console.error(error);
+ }
+ } catch (error) {
+ dispatch(setError(WRONG_CHAIN_MESSAGE));
}
-}
+ };
+};
export const storeProof = (proof) => ({
- type: STORE_PROOF,
- payload: proof
-})
+ type: STORE_PROOF,
+ payload: proof,
+});
export const delegate = (w3provider, delegatee, network) => {
- return async dispatch => {
- dispatch(delegateStatus(PENDING))
- let signer = w3provider.getSigner();
- let contract = new Contract(governanceContracts[network].token, abis.Comp.abi, w3provider);
- let signed = await contract.connect(signer);
- try {
- const tx = await signed.delegate(delegatee);
- dispatch(delegateStatus(MINING))
- try {
- await tx.wait()
- dispatch(delegateStatus(MINED))
- dispatch(setDelegatee(delegatee))
- } catch (error) {
- dispatch(delegateStatus(FAIL))
- dispatch(setError(error.message))
- }
- } catch (error) {
- dispatch(delegateStatus(REJECTED))
- dispatch(setError(error.message))
- }
+ return async (dispatch) => {
+ dispatch(delegateStatus(PENDING));
+ let signer = w3provider.getSigner();
+ let contract = new Contract(
+ governanceContracts[network].token,
+ abis.Comp.abi,
+ w3provider,
+ );
+ let signed = await contract.connect(signer);
+ try {
+ const tx = await signed.delegate(delegatee);
+ dispatch(delegateStatus(MINING));
+ try {
+ await tx.wait();
+ dispatch(delegateStatus(MINED));
+ dispatch(setDelegatee(delegatee));
+ } catch (error) {
+ dispatch(delegateStatus(FAIL));
+ dispatch(setError(error.message));
+ }
+ } catch (error) {
+ dispatch(delegateStatus(REJECTED));
+ dispatch(setError(error.message));
}
-}
\ No newline at end of file
+ };
+};
diff --git a/web/src/store/actions/routes.js b/web/src/store/actions/routes.js
index e6e8c53..a91eaf3 100644
--- a/web/src/store/actions/routes.js
+++ b/web/src/store/actions/routes.js
@@ -1,6 +1,6 @@
-import { SET_CURRENT_ROUTE } from "./types"
+import { SET_CURRENT_ROUTE } from "./types";
export const setCurrentRoute = (route) => ({
- type: SET_CURRENT_ROUTE,
- payload: route
-})
\ No newline at end of file
+ type: SET_CURRENT_ROUTE,
+ payload: route,
+});
diff --git a/web/src/store/actions/types.js b/web/src/store/actions/types.js
index c07df33..c53443d 100644
--- a/web/src/store/actions/types.js
+++ b/web/src/store/actions/types.js
@@ -1,32 +1,31 @@
//////----------- GOVERNANCE -----------//////
-export const PROPOSAL_CREATED = 'gov/PROPOSAL_CREATED'
-export const DELEGATE_STATUS = 'gov/DELEGATE_STATUS'
-export const SET_DELEGATEE = 'gov/SET_DELEGATEE'
-export const CLAIM_STATUS = 'gov/CLAIM_STATUS'
-export const SET_CLAIM_STATUS = 'gov/SET_CLAIM_STATUS'
+export const PROPOSAL_CREATED = "gov/PROPOSAL_CREATED";
+export const DELEGATE_STATUS = "gov/DELEGATE_STATUS";
+export const SET_DELEGATEE = "gov/SET_DELEGATEE";
+export const CLAIM_STATUS = "gov/CLAIM_STATUS";
+export const SET_CLAIM_STATUS = "gov/SET_CLAIM_STATUS";
//////----------- ERRORS -----------//////
-export const SET_ERROR = 'errors/SET_ERROR'
+export const SET_ERROR = "errors/SET_ERROR";
//////----------- GOV STORAGE -----------//////
-export const STORE_PROOF = 'govstore/STORE_PROOF'
-export const STORE_KEY = 'govstore/STORE_KEY'
+export const STORE_PROOF = "govstore/STORE_PROOF";
+export const STORE_KEY = "govstore/STORE_KEY";
//////----------- USER -----------//////
-export const SET_USERNAME = 'user/SET_USERNAME'
+export const SET_USERNAME = "user/SET_USERNAME";
/////------------ UTILS -----------//////
-export const GOV_CLEANUP = 'utils/GOV_CLEANUP'
-export const GRAPH_CLEANUP = 'utils/GRAPH_CLEANUP'
-export const USER_CLEANUP = 'utils/USER_CLEANUP'
-export const WALLET_CLEANUP = 'uitls/WALLET_CLEANUP'
-export const ERROR_CLEANUP = 'uitls/ERROR_CLEANUP'
-export const ROUTE_CLEANUP = 'uitls/ROUTE_CLEANUP'
+export const GOV_CLEANUP = "utils/GOV_CLEANUP";
+export const GRAPH_CLEANUP = "utils/GRAPH_CLEANUP";
+export const USER_CLEANUP = "utils/USER_CLEANUP";
+export const ERROR_CLEANUP = "uitls/ERROR_CLEANUP";
+export const ROUTE_CLEANUP = "uitls/ROUTE_CLEANUP";
/////------------ ROUTES -----------//////
-export const SET_CURRENT_ROUTE = 'routes/SET_CURRENT_ROUTE'
+export const SET_CURRENT_ROUTE = "routes/SET_CURRENT_ROUTE";
/////------------ DISTRIBUTOR -----------//////
-export const FETCH_MERKLE_ROOT = 'distributor/FETCH_MERKLE_ROOT'
-export const FETCH_CURRENT_AWARD = 'distributor/FETCH_CURRENT_AWARD'
-export const FETCH_NEXT_HALVE_PERIOD = 'distributor/FETCH_NEXT_HALVE_PERIOD'
\ No newline at end of file
+export const FETCH_MERKLE_ROOT = "distributor/FETCH_MERKLE_ROOT";
+export const FETCH_CURRENT_AWARD = "distributor/FETCH_CURRENT_AWARD";
+export const FETCH_NEXT_HALVE_PERIOD = "distributor/FETCH_NEXT_HALVE_PERIOD";
diff --git a/web/src/store/actions/user.js b/web/src/store/actions/user.js
index 320524b..4c5172e 100644
--- a/web/src/store/actions/user.js
+++ b/web/src/store/actions/user.js
@@ -1,11 +1,11 @@
-import { SET_USERNAME, STORE_KEY } from './types'
+import { SET_USERNAME, STORE_KEY } from "./types";
export const setUsername = (username) => ({
- type: SET_USERNAME,
- payload: username
-})
+ type: SET_USERNAME,
+ payload: username,
+});
export const storeKey = (key) => ({
- type: STORE_KEY,
- payload: key
-})
\ No newline at end of file
+ type: STORE_KEY,
+ payload: key,
+});
diff --git a/web/src/store/reducers/distributor.js b/web/src/store/reducers/distributor.js
index 6d5a118..4c04487 100644
--- a/web/src/store/reducers/distributor.js
+++ b/web/src/store/reducers/distributor.js
@@ -1,32 +1,36 @@
-import { FETCH_CURRENT_AWARD, FETCH_MERKLE_ROOT, FETCH_NEXT_HALVE_PERIOD } from "../actions/types"
+import {
+ FETCH_CURRENT_AWARD,
+ FETCH_MERKLE_ROOT,
+ FETCH_NEXT_HALVE_PERIOD,
+} from "../actions/types";
const initialState = {
- merkleRoot: null,
- currentAward: null,
- nextHalvePeriod: null
-}
+ merkleRoot: null,
+ currentAward: null,
+ nextHalvePeriod: null,
+};
export const distributorReducer = (state = initialState, action) => {
- switch (action.type) {
- case FETCH_MERKLE_ROOT:
- return {
- ...state,
- merkleRoot: action.payload
- }
+ switch (action.type) {
+ case FETCH_MERKLE_ROOT:
+ return {
+ ...state,
+ merkleRoot: action.payload,
+ };
- case FETCH_CURRENT_AWARD:
- return {
- ...state,
- currentAward: action.payload
- }
+ case FETCH_CURRENT_AWARD:
+ return {
+ ...state,
+ currentAward: action.payload,
+ };
- case FETCH_NEXT_HALVE_PERIOD:
- return {
- ...state,
- nextHalvePeriod: action.payload
- }
-
- default:
- return state
- }
-}
\ No newline at end of file
+ case FETCH_NEXT_HALVE_PERIOD:
+ return {
+ ...state,
+ nextHalvePeriod: action.payload,
+ };
+
+ default:
+ return state;
+ }
+};
diff --git a/web/src/store/reducers/error.js b/web/src/store/reducers/error.js
index 71448b3..f7317b1 100644
--- a/web/src/store/reducers/error.js
+++ b/web/src/store/reducers/error.js
@@ -1,23 +1,23 @@
import { ERROR_CLEANUP, SET_ERROR } from "../actions/types";
const initialState = {
- error: null
-}
+ error: null,
+};
-export const errorReducer = (state=initialState, action) => {
- switch (action.type) {
- case ERROR_CLEANUP: {
- return initialState
- }
+export const errorReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case ERROR_CLEANUP: {
+ return initialState;
+ }
- case SET_ERROR: {
- return {
- ...state,
- error: action.payload
- }
- }
-
- default:
- return state
+ case SET_ERROR: {
+ return {
+ ...state,
+ error: action.payload,
+ };
}
-}
\ No newline at end of file
+
+ default:
+ return state;
+ }
+};
diff --git a/web/src/store/reducers/governance.js b/web/src/store/reducers/governance.js
index 8e6bca7..ed7e662 100644
--- a/web/src/store/reducers/governance.js
+++ b/web/src/store/reducers/governance.js
@@ -1,94 +1,94 @@
import {
- CLAIM_STATUS,
- DELEGATE_STATUS,
- GOV_CLEANUP,
- PROPOSAL_CREATED,
- SET_CLAIM_STATUS,
- SET_DELEGATEE,
- STORE_KEY,
- STORE_PROOF
-} from "../actions/types"
+ CLAIM_STATUS,
+ DELEGATE_STATUS,
+ GOV_CLEANUP,
+ PROPOSAL_CREATED,
+ SET_CLAIM_STATUS,
+ SET_DELEGATEE,
+ STORE_KEY,
+ STORE_PROOF,
+} from "../actions/types";
const initialState = {
- degelationStatus: null,
- delegatee: null,
- error: null,
- proposalCount: null,
- claimStatus: null,
- proofStatus: null,
- proof: '',
- alegibility: {
- isAlegible: false,
- checked: false
- },
- githubOwnership: {
- isOwner: false,
- checked: false
- },
- hasClaimed: {
- checked: false,
- hasClaimed: null
- },
- values: {
- proof: null,
- key: null
- }
-}
+ degelationStatus: null,
+ delegatee: null,
+ error: null,
+ proposalCount: null,
+ claimStatus: null,
+ proofStatus: null,
+ proof: "",
+ alegibility: {
+ isAlegible: false,
+ checked: false,
+ },
+ githubOwnership: {
+ isOwner: false,
+ checked: false,
+ },
+ hasClaimed: {
+ checked: false,
+ hasClaimed: null,
+ },
+ values: {
+ proof: null,
+ key: null,
+ },
+};
export function governanceReducer(state = initialState, action) {
- switch (action.type) {
- case GOV_CLEANUP: {
- return initialState
- }
+ switch (action.type) {
+ case GOV_CLEANUP: {
+ return initialState;
+ }
- case PROPOSAL_CREATED:
- return {
- ...state,
- proposals: [...state.proposals, action.payload]
- }
- case DELEGATE_STATUS: {
- return {
- ...state,
- delegationStatus: action.payload
- }
- }
- case SET_DELEGATEE: {
- return {
- ...state,
- delegatee: action.payload
- }
- }
- case CLAIM_STATUS: {
- return {
- ...state,
- claimStatus: action.payload
- }
- }
- case SET_CLAIM_STATUS: {
- return {
- ...state,
- hasClaimed: action.payload
- }
- }
- case STORE_PROOF: {
- return {
- ...state,
- values: {
- ...state.values,
- proof: action.payload
- }
- }
- }
- case STORE_KEY: {
- return {
- ...state,
- values: {
- ...state.values,
- key: action.payload
- }
- }
- }
- default:
- return state
+ case PROPOSAL_CREATED:
+ return {
+ ...state,
+ proposals: [...state.proposals, action.payload],
+ };
+ case DELEGATE_STATUS: {
+ return {
+ ...state,
+ delegationStatus: action.payload,
+ };
+ }
+ case SET_DELEGATEE: {
+ return {
+ ...state,
+ delegatee: action.payload,
+ };
+ }
+ case CLAIM_STATUS: {
+ return {
+ ...state,
+ claimStatus: action.payload,
+ };
}
-}
\ No newline at end of file
+ case SET_CLAIM_STATUS: {
+ return {
+ ...state,
+ hasClaimed: action.payload,
+ };
+ }
+ case STORE_PROOF: {
+ return {
+ ...state,
+ values: {
+ ...state.values,
+ proof: action.payload,
+ },
+ };
+ }
+ case STORE_KEY: {
+ return {
+ ...state,
+ values: {
+ ...state.values,
+ key: action.payload,
+ },
+ };
+ }
+ default:
+ return state;
+ }
+}
diff --git a/web/src/store/reducers/root.js b/web/src/store/reducers/root.js
index 04a6413..eb3411b 100644
--- a/web/src/store/reducers/root.js
+++ b/web/src/store/reducers/root.js
@@ -1,14 +1,14 @@
-import { combineReducers } from "redux"
-import { governanceReducer } from "./governance"
-import { userReducer } from "./user"
-import { errorReducer } from "./error"
-import { routesReducer } from "./routes"
-import { distributorReducer } from './distributor'
+import { combineReducers } from "redux";
+import { governanceReducer } from "./governance";
+import { userReducer } from "./user";
+import { errorReducer } from "./error";
+import { routesReducer } from "./routes";
+import { distributorReducer } from "./distributor";
export default combineReducers({
- governance: governanceReducer,
- user: userReducer,
- error: errorReducer,
- routes: routesReducer,
- distributor: distributorReducer
-})
\ No newline at end of file
+ governance: governanceReducer,
+ user: userReducer,
+ error: errorReducer,
+ routes: routesReducer,
+ distributor: distributorReducer,
+});
diff --git a/web/src/store/reducers/routes.js b/web/src/store/reducers/routes.js
index 7aeb75b..4a48ee8 100644
--- a/web/src/store/reducers/routes.js
+++ b/web/src/store/reducers/routes.js
@@ -1,22 +1,22 @@
-import { ROUTE_CLEANUP, SET_CURRENT_ROUTE } from '../actions/types'
+import { ROUTE_CLEANUP, SET_CURRENT_ROUTE } from "../actions/types";
const initialState = {
- currentRoute: null
-}
+ currentRoute: null,
+};
-export const routesReducer = (state=initialState, action) => {
- switch (action.type) {
- case ROUTE_CLEANUP: {
- return initialState
- }
-
- case SET_CURRENT_ROUTE:
- return {
- ...state,
- currentRoute: action.payload
- }
-
- default:
- return state
+export const routesReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case ROUTE_CLEANUP: {
+ return initialState;
}
-}
\ No newline at end of file
+
+ case SET_CURRENT_ROUTE:
+ return {
+ ...state,
+ currentRoute: action.payload,
+ };
+
+ default:
+ return state;
+ }
+};
diff --git a/web/src/store/reducers/user.js b/web/src/store/reducers/user.js
index bf94927..dc386ed 100644
--- a/web/src/store/reducers/user.js
+++ b/web/src/store/reducers/user.js
@@ -1,31 +1,31 @@
-import { SET_USERNAME, USER_CLEANUP } from "../actions/types"
+import { SET_USERNAME, USER_CLEANUP } from "../actions/types";
export const initialState = {
- name: null,
- nickname: null,
- picture: null,
- sub: null,
- email: null,
- email_verfified: null,
- updated_at: null,
- username: null,
- key: null
-}
+ name: null,
+ nickname: null,
+ picture: null,
+ sub: null,
+ email: null,
+ email_verfified: null,
+ updated_at: null,
+ username: null,
+ key: null,
+};
-export const userReducer = (state=initialState, action) => {
- switch (action.type) {
- case USER_CLEANUP: {
- return initialState
- }
+export const userReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case USER_CLEANUP: {
+ return initialState;
+ }
- case SET_USERNAME: {
- return {
- ...state,
- username: action.payload
- }
- }
-
- default:
- return state
+ case SET_USERNAME: {
+ return {
+ ...state,
+ username: action.payload,
+ };
}
-}
\ No newline at end of file
+
+ default:
+ return state;
+ }
+};
diff --git a/web/src/utils/asn1.js b/web/src/utils/asn1.js
index eb0017e..a2c6c8d 100644
--- a/web/src/utils/asn1.js
+++ b/web/src/utils/asn1.js
@@ -1,109 +1,127 @@
-import { ethers } from 'ethers';
-import { define } from 'asn1.js';
-import { BN } from 'bn.js';
-import { Buffer } from 'buffer';
-import * as ethutil from 'ethereumjs-util';
-
-const EcdsaSigAsnParse = define('EcdsaSig', function() {
- // parsing sig according to https://tools.ietf.org/html/rfc3279#section-2.2.3
- this.seq().obj(
- this.key('r').int(),
- this.key('s').int(),
- );
+import { ethers } from "ethers";
+import { define } from "asn1.js";
+import { BN } from "bn.js";
+import { Buffer } from "buffer";
+import * as ethutil from "ethereumjs-util";
+
+const EcdsaSigAsnParse = define("EcdsaSig", function () {
+ // parsing sig according to https://tools.ietf.org/html/rfc3279#section-2.2.3
+ this.seq().obj(this.key("r").int(), this.key("s").int());
});
// 16b2a0fb0e44a02560123359ea248da287367d45340ab13d0a81045fda38283d
export function validateASN1Signature(hashHex, asn1Signature, expectedEthAddr) {
- // let hash = "50b2c43fd39106bafbba0da34fc430e1f91e3c96ea2acee2bc34119f92b37750";
- // let asn1Signature = "304402204c45f724b4bc4b7994f634f94807701e399731f422f2556d205ffa10df1ab1b302206685617710ad55a5ac4f9b605e5d21461feba47ddf76eea8c581657eebc20734";
-
- // % echo 304402204c45f724b4bc4b7994f634f94807701e399731f422f2556d205ffa10df1ab1b302206685617710ad55a5ac4f9b605e5d21461feba47ddf76eea8c581657eebc20734 | xxd -r -p | openssl asn1parse -inform der
- // 0:d=0 hl=2 l= 68 cons: SEQUENCE
- // 2:d=1 hl=2 l= 32 prim: INTEGER :4C45F724B4BC4B7994F634F94807701E399731F422F2556D205FFA10DF1AB1B3
- // 36:d=1 hl=2 l= 32 prim: INTEGER :6685617710AD55A5AC4F9B605E5D21461FEBA47DDF76EEA8C581657EEBC20734
-
- var bufferHash;
- if (hashHex.startsWith('0x')) {
- bufferHash = Buffer.from(hashHex.slice(2), 'hex');
- } else {
- bufferHash = Buffer.from(hashHex, 'hex');
- }
- console.log("bufferHash", bufferHash);
-
- let bufferSig = Buffer.from(asn1Signature);
-
- let { r, s } = findEthereumSig(bufferSig);
-
- let { pubkey, v } = findRightKey(bufferHash, r, s, expectedEthAddr);
-
- let raw_signature = { r: '0x' + r.toString(16, 32), s: '0x' + s.toString(16, 32), v };
- let signature = ethers.utils.splitSignature(raw_signature);
-
- let recoveredAddress = ethers.utils.recoverAddress(hashHex, signature);
-
- console.log("signature", ethers.utils.joinSignature(signature));
-
- if (recoveredAddress.toLowerCase() !== expectedEthAddr.toLowerCase()) {
- throw new Error(`Expected ETH addr ${expectedEthAddr}, but recovered ${recoveredAddress}. Signature must be invalid.`)
- }
-
- return ethers.utils.joinSignature(signature);
+ // let hash = "50b2c43fd39106bafbba0da34fc430e1f91e3c96ea2acee2bc34119f92b37750";
+ // let asn1Signature = "304402204c45f724b4bc4b7994f634f94807701e399731f422f2556d205ffa10df1ab1b302206685617710ad55a5ac4f9b605e5d21461feba47ddf76eea8c581657eebc20734";
+
+ // % echo 304402204c45f724b4bc4b7994f634f94807701e399731f422f2556d205ffa10df1ab1b302206685617710ad55a5ac4f9b605e5d21461feba47ddf76eea8c581657eebc20734 | xxd -r -p | openssl asn1parse -inform der
+ // 0:d=0 hl=2 l= 68 cons: SEQUENCE
+ // 2:d=1 hl=2 l= 32 prim: INTEGER :4C45F724B4BC4B7994F634F94807701E399731F422F2556D205FFA10DF1AB1B3
+ // 36:d=1 hl=2 l= 32 prim: INTEGER :6685617710AD55A5AC4F9B605E5D21461FEBA47DDF76EEA8C581657EEBC20734
+
+ var bufferHash;
+ if (hashHex.startsWith("0x")) {
+ bufferHash = Buffer.from(hashHex.slice(2), "hex");
+ } else {
+ bufferHash = Buffer.from(hashHex, "hex");
+ }
+ console.log("bufferHash", bufferHash);
+
+ let bufferSig = Buffer.from(asn1Signature);
+
+ let { r, s } = findEthereumSig(bufferSig);
+
+ let { pubkey, v } = findRightKey(bufferHash, r, s, expectedEthAddr);
+
+ let raw_signature = {
+ r: "0x" + r.toString(16, 32),
+ s: "0x" + s.toString(16, 32),
+ v,
+ };
+ let signature = ethers.utils.splitSignature(raw_signature);
+
+ let recoveredAddress = ethers.utils.recoverAddress(hashHex, signature);
+
+ console.log("signature", ethers.utils.joinSignature(signature));
+
+ if (recoveredAddress.toLowerCase() !== expectedEthAddr.toLowerCase()) {
+ throw new Error(
+ `Expected ETH addr ${expectedEthAddr}, but recovered ${recoveredAddress}. Signature must be invalid.`,
+ );
}
-
- function recoverPubKeyFromSig(msg, r, s, v) {
- console.log("Recovering public key with msg " + msg.toString('hex') + " r: " + r.toString(16) + " s: " + s.toString(16));
- let rBuffer = r.toArrayLike(Buffer);
- let sBuffer = s.toArrayLike(Buffer);
-
- let pubKey = ethutil.ecrecover(msg, v, rBuffer, sBuffer);
- let addrBuf = ethutil.pubToAddress(pubKey);
- var RecoveredEthAddr = ethutil.bufferToHex(addrBuf);
- // let RecoveredEthAddr = ethers.utils.recoverAddress(msg, v, rBuffer, sBuffer);
- console.log( "Recovered ethereum address: " + RecoveredEthAddr);
- return RecoveredEthAddr;
+
+ return ethers.utils.joinSignature(signature);
+}
+
+function recoverPubKeyFromSig(msg, r, s, v) {
+ console.log(
+ "Recovering public key with msg " +
+ msg.toString("hex") +
+ " r: " +
+ r.toString(16) +
+ " s: " +
+ s.toString(16),
+ );
+ let rBuffer = r.toArrayLike(Buffer);
+ let sBuffer = s.toArrayLike(Buffer);
+
+ let pubKey = ethutil.ecrecover(msg, v, rBuffer, sBuffer);
+ let addrBuf = ethutil.pubToAddress(pubKey);
+ var RecoveredEthAddr = ethutil.bufferToHex(addrBuf);
+ // let RecoveredEthAddr = ethers.utils.recoverAddress(msg, v, rBuffer, sBuffer);
+ console.log("Recovered ethereum address: " + RecoveredEthAddr);
+ return RecoveredEthAddr;
+}
+
+function findRightKey(msg, r, s, expectedEthAddr) {
+ // This is the wrapper function to find the right v value
+ // There are two matching signatues on the elliptic curve
+ // we need to find the one that matches to our public key
+ // it can be v = 27 or v = 28
+ let v = 27;
+ let pubKey = recoverPubKeyFromSig(msg, r, s, v);
+ if (pubKey.toLowerCase() !== expectedEthAddr.toLowerCase()) {
+ // if the pub key for v = 27 does not match
+ // it has to be v = 28
+ v = 28;
+ pubKey = recoverPubKeyFromSig(msg, r, s, v);
}
-
- function findRightKey(msg, r, s, expectedEthAddr) {
- // This is the wrapper function to find the right v value
- // There are two matching signatues on the elliptic curve
- // we need to find the one that matches to our public key
- // it can be v = 27 or v = 28
- let v = 27;
- let pubKey = recoverPubKeyFromSig(msg, r, s, v);
- if (pubKey.toLowerCase() !== expectedEthAddr.toLowerCase()) {
- // if the pub key for v = 27 does not match
- // it has to be v = 28
- v = 28;
- pubKey = recoverPubKeyFromSig(msg, r, s, v)
- }
- console.log("Found the right ETH Address: " + pubKey + " v: " + v);
- return { pubKey, v };
+ console.log("Found the right ETH Address: " + pubKey + " v: " + v);
+ return { pubKey, v };
+}
+
+function findEthereumSig(signatureHex) {
+ let decoded = EcdsaSigAsnParse.decode(signatureHex, "der");
+ let r = decoded.r;
+ let s = decoded.s;
+ console.log("r: " + r.toString(10));
+ console.log("s: " + s.toString(10));
+
+ let tempsig = r.toString(16) + s.toString(16);
+
+ let secp256k1N = new BN(
+ "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
+ 16,
+ ); // max value on the curve
+ let secp256k1halfN = secp256k1N.div(new BN(2)); // half of the curve
+ // Because of EIP-2 not all elliptic curve signatures are accepted
+ // the value of s needs to be SMALLER than half of the curve
+ // i.e. we need to flip s if it's greater than half of the curve
+ if (s.gt(secp256k1halfN)) {
+ console.log(
+ "s is on the wrong side of the curve... flipping - tempsig: " +
+ tempsig +
+ " length: " +
+ tempsig.length,
+ );
+ // According to EIP2 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
+ // if s < half the curve we need to invert it
+ // s = curve.n - s
+ s = secp256k1N.sub(s);
+ console.log("new s: " + s.toString(10));
+ return { r, s };
}
-
- function findEthereumSig(signatureHex) {
- let decoded = EcdsaSigAsnParse.decode(signatureHex, 'der');
- let r = decoded.r;
- let s = decoded.s;
- console.log("r: " + r.toString(10));
- console.log("s: " + s.toString(10));
-
- let tempsig = r.toString(16) + s.toString(16);
-
- let secp256k1N = new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16); // max value on the curve
- let secp256k1halfN = secp256k1N.div(new BN(2)); // half of the curve
- // Because of EIP-2 not all elliptic curve signatures are accepted
- // the value of s needs to be SMALLER than half of the curve
- // i.e. we need to flip s if it's greater than half of the curve
- if (s.gt(secp256k1halfN)) {
- console.log("s is on the wrong side of the curve... flipping - tempsig: " + tempsig + " length: " + tempsig.length);
- // According to EIP2 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
- // if s < half the curve we need to invert it
- // s = curve.n - s
- s = secp256k1N.sub(s);
- console.log("new s: " + s.toString(10));
- return { r, s }
- }
- // if s is less than half of the curve, we're on the "good" side of the curve, we can just return
- return { r, s }
- }
\ No newline at end of file
+ // if s is less than half of the curve, we're on the "good" side of the curve, we can just return
+ return { r, s };
+}
diff --git a/web/src/utils/award.js b/web/src/utils/award.js
index 58b0ecc..dd4ea2b 100644
--- a/web/src/utils/award.js
+++ b/web/src/utils/award.js
@@ -1,15 +1,18 @@
-import { ethers } from 'ethers';
-import keccak256 from 'keccak256';
+import { ethers } from "ethers";
+import keccak256 from "keccak256";
/**
- *
- * @param {number} userId
- * @param {string} address
+ *
+ * @param {number} userId
+ * @param {string} address
* @returns {Buffer}
*/
export async function hashedLeaf(userId, address) {
- let leafData = await ethers.utils.defaultAbiCoder.encode(["uint32", "address"], [userId, address]);
+ let leafData = await ethers.utils.defaultAbiCoder.encode(
+ ["uint32", "address"],
+ [userId, address],
+ );
let leaf = keccak256(leafData);
return leaf;
-}
\ No newline at end of file
+}
diff --git a/web/src/utils/contractFuncs.js b/web/src/utils/contractFuncs.js
index fb3bedc..07bff0b 100644
--- a/web/src/utils/contractFuncs.js
+++ b/web/src/utils/contractFuncs.js
@@ -9,7 +9,7 @@ export async function delegates(w3provider, address, network) {
let contract = new Contract(
governanceContracts[network].token,
abis.Comp.abi,
- w3provider
+ w3provider,
);
let delegates;
try {
@@ -33,13 +33,13 @@ export async function propose(
signatures,
calldatas,
description,
- network
+ network,
) {
let signer = w3provider.getSigner();
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let proposal;
@@ -57,7 +57,7 @@ export async function propose(
values,
signatures,
calldatas,
- description
+ description,
);
} else {
console.log("propose calling propose with", {
@@ -73,7 +73,7 @@ export async function propose(
signatures,
calldatas,
description,
- network
+ network,
);
}
proposal = SUCCESS_MSG;
@@ -89,7 +89,7 @@ export async function getReceipt(w3provider, proposalId, voter, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let receipt;
try {
@@ -104,7 +104,7 @@ export async function getActions(w3provider, proposalId, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let actions;
try {
@@ -120,13 +120,13 @@ export async function castVote(
proposalId,
support,
votes,
- network
+ network,
) {
let signer = w3provider.getSigner();
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let castVote;
@@ -144,7 +144,7 @@ export async function queue(w3provider, proposalId, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let queue;
@@ -162,7 +162,7 @@ export async function execute(w3provider, proposalId, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let execute;
@@ -180,7 +180,7 @@ export async function cancel(w3provider, proposalId, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let cancel;
@@ -198,7 +198,7 @@ export async function refund(w3provider, proposalId, network) {
let contract = new Contract(
governanceContracts[network].alpha,
abis.GovernorAlpha.abi,
- w3provider
+ w3provider,
);
let signed = await contract.connect(signer);
let refund;
diff --git a/web/src/utils/helpers.js b/web/src/utils/helpers.js
index 8fae68c..a8228b1 100644
--- a/web/src/utils/helpers.js
+++ b/web/src/utils/helpers.js
@@ -1,18 +1,18 @@
export function catchError(error, isMessage = false) {
- const message = isMessage ? error : error.message
-
- // try to extract error message, otherwise return raw error
- let formatted_error;
-
- if (message.startsWith("invalid ENS name")) {
- formatted_error = "Missing or invalid parameter.";
- } else if(message.startsWith("JsonRpcEngine")) {
- formatted_error = "Cannot connect to the blockchain."
- } else if (message.startsWith("invalid BigNumber string")) {
- formatted_error = "Invalid number parameter."
- } else {
- formatted_error = message;
- }
-
- return formatted_error;
-}
\ No newline at end of file
+ const message = isMessage ? error : error.message;
+
+ // try to extract error message, otherwise return raw error
+ let formatted_error;
+
+ if (message.startsWith("invalid ENS name")) {
+ formatted_error = "Missing or invalid parameter.";
+ } else if (message.startsWith("JsonRpcEngine")) {
+ formatted_error = "Cannot connect to the blockchain.";
+ } else if (message.startsWith("invalid BigNumber string")) {
+ formatted_error = "Invalid number parameter.";
+ } else {
+ formatted_error = message;
+ }
+
+ return formatted_error;
+}
diff --git a/web/src/utils/index.js b/web/src/utils/index.js
index ff39f87..028d117 100644
--- a/web/src/utils/index.js
+++ b/web/src/utils/index.js
@@ -1,2 +1,2 @@
-export * from './utils'
-export * from './helpers'
\ No newline at end of file
+export * from "./utils";
+export * from "./helpers";
diff --git a/web/src/utils/metamask.js b/web/src/utils/metamask.js
index a95f9a7..f534ef1 100644
--- a/web/src/utils/metamask.js
+++ b/web/src/utils/metamask.js
@@ -1,30 +1,30 @@
-const tokenSymbol = 'FLT';
+const tokenSymbol = "FLT";
const tokenDecimals = 18;
-const tokenImage = 'https://sun9-47.userapi.com/impg/VXEDLdXIw1GrZT6nVIN7C87nDbJWC7aDZtI5cA/6ozS9JC4M9Q.jpg?size=512x512&quality=96&sign=8fa6a99090393d337a459d7413ba38b9&type=album';
+const tokenImage =
+ "https://sun9-47.userapi.com/impg/VXEDLdXIw1GrZT6nVIN7C87nDbJWC7aDZtI5cA/6ozS9JC4M9Q.jpg?size=512x512&quality=96&sign=8fa6a99090393d337a459d7413ba38b9&type=album";
export const addTokenToMetamask = async (tokenAddress) => {
- try {
- // wasAdded is a boolean. Like any RPC method, an error may be thrown.
- const wasAdded = await window.ethereum.request({
- method: 'wallet_watchAsset',
- params: {
- type: 'ERC20',
- options: {
- address: tokenAddress, // The address that the token is at.
- symbol: tokenSymbol, // A ticker symbol or shorthand, up to 5 chars.
- decimals: tokenDecimals, // The number of decimals in the token
- image: tokenImage, // A string url of the token logo
- },
- },
- });
-
- if (wasAdded) {
- console.log('FLT added to Metamask');
- } else {
- console.log('FLT rejected!');
- }
- } catch (error) {
- console.log(error);
- }
+ try {
+ // wasAdded is a boolean. Like any RPC method, an error may be thrown.
+ const wasAdded = await window.ethereum.request({
+ method: "wallet_watchAsset",
+ params: {
+ type: "ERC20",
+ options: {
+ address: tokenAddress, // The address that the token is at.
+ symbol: tokenSymbol, // A ticker symbol or shorthand, up to 5 chars.
+ decimals: tokenDecimals, // The number of decimals in the token
+ image: tokenImage, // A string url of the token logo
+ },
+ },
+ });
-}
\ No newline at end of file
+ if (wasAdded) {
+ console.log("FLT added to Metamask");
+ } else {
+ console.log("FLT rejected!");
+ }
+ } catch (error) {
+ console.log(error);
+ }
+};
diff --git a/web/src/vendors/fonts/fonts.css b/web/src/vendors/fonts/fonts.css
index 781c067..541f2de 100644
--- a/web/src/vendors/fonts/fonts.css
+++ b/web/src/vendors/fonts/fonts.css
@@ -1,44 +1,49 @@
@font-face {
- font-family: "Hauora_Bold";
- font-style: normal;
- font-weight: 700;
- font-display: swap;
- src: url("./Hauora-Bold.woff2") format("woff2"),
+ font-family: "Hauora_Bold";
+ font-style: normal;
+ font-weight: 700;
+ font-display: swap;
+ src:
+ url("./Hauora-Bold.woff2") format("woff2"),
url("./Hauora-Bold.woff") format("woff");
}
@font-face {
- font-family: "Hauora_Light";
- font-style: normal;
- font-weight: 300;
- font-display: swap;
- src: url("./Hauora-Light.woff2") format("woff2"),
+ font-family: "Hauora_Light";
+ font-style: normal;
+ font-weight: 300;
+ font-display: swap;
+ src:
+ url("./Hauora-Light.woff2") format("woff2"),
url("./Hauora-Light.woff") format("woff");
}
@font-face {
- font-family: "Hauora_Regular";
- font-style: normal;
- font-weight: 400;
- font-display: swap;
- src: url("./Hauora-Regular.woff2") format("woff2"),
+ font-family: "Hauora_Regular";
+ font-style: normal;
+ font-weight: 400;
+ font-display: swap;
+ src:
+ url("./Hauora-Regular.woff2") format("woff2"),
url("./Hauora-Regular.woff") format("woff");
}
@font-face {
- font-family: "Hauora_Medium";
- font-style: normal;
- font-weight: 500;
- font-display: swap;
- src: url("./Hauora-Medium.woff2") format("woff2"),
+ font-family: "Hauora_Medium";
+ font-style: normal;
+ font-weight: 500;
+ font-display: swap;
+ src:
+ url("./Hauora-Medium.woff2") format("woff2"),
url("./Hauora-Medium.woff") format("woff");
}
@font-face {
- font-family: "Roboto_Regular";
- font-style: normal;
- font-weight: 400;
- font-display: swap;
- src: url("./RobotoMono-Regular.woff2") format("woff2"),
+ font-family: "Roboto_Regular";
+ font-style: normal;
+ font-weight: 400;
+ font-display: swap;
+ src:
+ url("./RobotoMono-Regular.woff2") format("woff2"),
url("./RobotoMono-Regular.woff") format("woff");
-}
\ No newline at end of file
+}