From 2daf1c1be6dde74dcf0e1a39e349c06c53ed6eb9 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 5 Jan 2024 11:52:56 +0000 Subject: [PATCH 1/7] update README, Makefile and .env.local.example --- Makefile | 1 - README.md | 2 +- frontend/.env.local.example | 13 +++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e76afa2..64d2045 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,5 @@ generate-env-files: @cp backend/.env.example backend/.env @cp frontend/.env.local.example frontend/.env.local @echo "Environment files copied..." - @echo "Update backend/.env and frontend/.env.local" setup: install generate-env-files db \ No newline at end of file diff --git a/README.md b/README.md index 87aa7a5..0da3fdf 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ cd get-started make setup ``` -4. Add environment variables to `./backend/.env` +4. Add environment variables to `./backend/.env` and `./frontend/.env.local` 5. Execute development commands: diff --git a/frontend/.env.local.example b/frontend/.env.local.example index acc918d..53c151a 100644 --- a/frontend/.env.local.example +++ b/frontend/.env.local.example @@ -1 +1,14 @@ +# The APPLICATION_ID, XP_TOKEN_ID, and REWARD_TOKEN_ID are accessible by +# selecting "View Application Keys" on the Manage Application page in the OPENFORMAT App. + +# This ID links your application with the OPENFORMAT platform. +NEXT_PUBLIC_APPLICATION_ID= + +# Identifier for the Reward Token used in your application. +NEXT_PUBLIC_REWARD_TOKEN_ID= + +# Wallet address of application owner. When a user spends a Reward Token, it will be sent to this address. +# This will generally be the same address you created the Application with in the OPENFORMAT App. +NEXT_PUBLIC_APPLICATION_OWNER_ADDRESS= + NEXT_PUBLIC_API_HOSTNAME=http://localhost:8080/api/v1 \ No newline at end of file From e2710b4b94c2fd39f78ef079bc91d0829687c9e5 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 5 Jan 2024 11:53:04 +0000 Subject: [PATCH 2/7] update styles --- frontend/styles/globals.css | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/styles/globals.css b/frontend/styles/globals.css index a5ca82b..fb34bc9 100644 --- a/frontend/styles/globals.css +++ b/frontend/styles/globals.css @@ -135,6 +135,7 @@ table { --border-radius: 3px; /* Rounded corners */ --border-width: 1px; /* Thin borders */ --border-radius-circle: 100%; + --error-color: #ef4444; } /* Global styles */ @@ -190,6 +191,8 @@ header div { } .header__logo { + height: 20px; + width: 20px; margin-right: 10px; border-radius: 9999px; } @@ -212,8 +215,8 @@ nav a { } .header__logo { - height: 40px; - width: 40px; + height: 20px; + width: 20px; } .header__company { @@ -495,6 +498,10 @@ footer { padding: 1rem; } +.welcome__item-error { + color: var(--error-color); +} + .welcome__description p { margin-bottom: 1rem; } From edd0cb2172ef9c5e35392cfa630b55f1cecc40cf Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 5 Jan 2024 11:53:18 +0000 Subject: [PATCH 3/7] update default mission --- backend/src/constants/missions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/constants/missions.ts b/backend/src/constants/missions.ts index 26fadf9..437e7ae 100644 --- a/backend/src/constants/missions.ts +++ b/backend/src/constants/missions.ts @@ -1,8 +1,8 @@ export default [ { - id: "test_mission", + id: "Reward User", description: - "Complete two test actions to complete the Test Mission", + "Press Reward User on the App page twice to complete this Quest.", tokens: [ { address: process.env.XP_TOKEN_ID, From abadfa44414e62a62f6096f3819ddb470a6c5e01 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 5 Jan 2024 11:54:52 +0000 Subject: [PATCH 4/7] update Header, Footer and Quest css --- frontend/components/Footer.tsx | 6 ++++-- frontend/components/Header.tsx | 7 ++++--- frontend/components/Quests.tsx | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/components/Footer.tsx b/frontend/components/Footer.tsx index f02aa49..8b567e4 100644 --- a/frontend/components/Footer.tsx +++ b/frontend/components/Footer.tsx @@ -2,12 +2,14 @@ export default function Footer() { return ( ); } diff --git a/frontend/components/Header.tsx b/frontend/components/Header.tsx index dbaf48a..90ea145 100644 --- a/frontend/components/Header.tsx +++ b/frontend/components/Header.tsx @@ -41,9 +41,10 @@ export default function Header() { }; useEffect(() => { - const tokenExists = localStorage.getItem("tokens"); + const tokens = localStorage.getItem("tokens"); + const parsedTokens = JSON.parse(tokens); - if (address && !tokenExists) { + if ((address && !tokens) || address !== parsedTokens?.address) { handleAuth(); } }, [address]); @@ -63,7 +64,7 @@ export default function Header() {