From 47834faf43b15c8a3f089ee61cc130dfc0e5eb84 Mon Sep 17 00:00:00 2001 From: yukigesho Date: Wed, 13 Nov 2024 19:30:39 -0800 Subject: [PATCH 1/4] fix: issue #346 --- src/components/global/FormBounty.tsx | 202 ++++++++++++++++----------- src/components/ui/CreateBounty.tsx | 14 +- 2 files changed, 120 insertions(+), 96 deletions(-) diff --git a/src/components/global/FormBounty.tsx b/src/components/global/FormBounty.tsx index cb0e536..0420b9c 100644 --- a/src/components/global/FormBounty.tsx +++ b/src/components/global/FormBounty.tsx @@ -1,10 +1,15 @@ -import { Box, CircularProgress, Switch } from '@mui/material'; +import { + Box, + CircularProgress, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + Switch, +} from '@mui/material'; import { useState } from 'react'; import { toast } from 'react-toastify'; -import GameButton from '@/components/global/GameButton'; -import { InfoIcon } from '@/components/global/Icons'; -import ButtonCTA from '@/components/ui/ButtonCTA'; import { useGetChain } from '@/hooks/useGetChain'; import { useAccount, useSwitchChain, useWriteContract } from 'wagmi'; import { useMutation } from '@tanstack/react-query'; @@ -14,8 +19,17 @@ import abi from '@/constant/abi/abi'; import { cn } from '@/utils'; import Loading from '@/components/global/Loading'; import { trpcClient } from '@/trpc/client'; +import GameButton from '@/components/global/GameButton'; +import ButtonCTA from '@/components/ui/ButtonCTA'; +import { InfoIcon } from '@/components/global/Icons'; -export default function FormBounty() { +export default function FormBounty({ + open, + onClose, +}: { + open: boolean; + onClose: () => void; +}) { const [name, setName] = useState(''); const [description, setDescription] = useState(''); const [amount, setAmount] = useState(''); @@ -98,85 +112,107 @@ export default function FormBounty() { return ( <> -
- title - setName(e.target.value)} - className='border bg-transparent border-[#D1ECFF] py-2 px-2 rounded-md mb-4' - /> - description - - - reward - setAmount(e.target.value)} - className='border bg-transparent border-[#D1ECFF] py-2 px-2 rounded-md mb-4' - /> -
- a 2.5% fee is deducted from - completed bounties -
- -
- {isSoloBounty ? 'Solo Bounty' : 'Open Bounty'} - setIsSoloBounty(!isSoloBounty)} - inputProps={{ 'aria-label': 'controlled' }} - /> -
-
- - - {isSoloBounty - ? 'you are the sole bounty contributor' - : 'users can add additional funds to your bounty'} - -
- - {createBountyMutations.isPending ? ( - - - - ) : ( - - )} -
+
+ {isSoloBounty ? 'Solo Bounty' : 'Open Bounty'} + setIsSoloBounty(!isSoloBounty)} + inputProps={{ 'aria-label': 'controlled' }} + /> +
+
+ + + {isSoloBounty + ? 'you are the sole bounty contributor' + : 'users can add additional funds to your bounty'} + +
+ + + + {createBountyMutations.isPending ? ( + + + + ) : ( + + )} + + ); } diff --git a/src/components/ui/CreateBounty.tsx b/src/components/ui/CreateBounty.tsx index ecacdb4..33d5a7e 100644 --- a/src/components/ui/CreateBounty.tsx +++ b/src/components/ui/CreateBounty.tsx @@ -4,7 +4,6 @@ import FormBounty from '@/components/global/FormBounty'; import GameButton from '@/components/global/GameButton'; import ButtonCTA from '@/components/ui/ButtonCTA'; import { toast } from 'react-toastify'; -import { CloseIcon } from '@/components/global/Icons'; export default function CreateBounty() { const [showForm, setShowForm] = useState(false); @@ -27,18 +26,7 @@ export default function CreateBounty() { create bounty )} - - {showForm && ( -
- - -
- )} + setShowForm(false)} /> ); } From 50c15a3718077942a419516690a26db783d9a3ad Mon Sep 17 00:00:00 2001 From: yukigesho Date: Wed, 13 Nov 2024 19:50:15 -0800 Subject: [PATCH 2/4] feat: improve header design on mobile --- src/components/layout/Header.tsx | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 107c14a..73de225 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -142,18 +142,23 @@ function ConnectWalletButton() { onClick={openAccountModal} className='border-[#D1ECFF] rounded-lg backdrop-blur-sm bg-white/30 p-1 hover:bg-white/20 flex items-center gap-1' > - {account.ensAvatar ? ( - User Avatar - ) : ( - - )} - {account.ensName || account.displayName} +
+ {account.ensAvatar ? ( + User Avatar + ) : ( + + )} +
+
+ + {account.ensName || account.displayName} +
From 03fd094be806c5a4579f7f9dd4c042ee4d4c15e3 Mon Sep 17 00:00:00 2001 From: yukigesho Date: Wed, 13 Nov 2024 20:00:03 -0800 Subject: [PATCH 3/4] feat: improve `FormBounty` form --- src/components/global/FormBounty.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/global/FormBounty.tsx b/src/components/global/FormBounty.tsx index 0420b9c..f113197 100644 --- a/src/components/global/FormBounty.tsx +++ b/src/components/global/FormBounty.tsx @@ -4,7 +4,6 @@ import { Dialog, DialogActions, DialogContent, - DialogTitle, Switch, } from '@mui/material'; import { useState } from 'react'; @@ -123,13 +122,12 @@ export default function FormBounty({ PaperProps={{ className: 'bg-poidhBlue/50', style: { - borderRadius: '10px', + borderRadius: '30px', color: 'white', border: '1px solid #D1ECFF', }, }} > - create bounty title From d403b06a8dc2686279b6f421c89d29ea3a36734d Mon Sep 17 00:00:00 2001 From: yukigesho Date: Wed, 13 Nov 2024 20:14:44 -0800 Subject: [PATCH 4/4] feat: update `README` --- README.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 123 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6137797..e0c94ff 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,133 @@ -## Refactor Notes: +## Contributing -Steps: +Thank you for your interest in contributing to POIDH! Before you start coding, please review this guide to ensure a smooth process from development to submitting a pull request. -- Make sure everything is typed in a clean way -- Fix linting and formatting errors -- Fix hydration errors -- Remove redundant code / Unused files -- Rename everything with Proofs -> Claims -- Make sure everything that can/should be rendered server side is (ie rpc requests, etc) +If you're new or unsure where to begin, check the [Discussions](https://github.com/poidh/poidh-app/discussions) tab for ideas and help. -Bugs Encountered: +### Quick Start Guide -Changes Made: +This guide will help you set up your local environment for running and contributing to the POIDH app, including setting up automatic formatting and linting. -# POIDH App +#### Overview -## Overview +- [Cloning the Repository](#cloning-the-repository) +- [Installing Node.js and pnpm](#installing-nodejs-and-pnpm) +- [Installing Dependencies](#installing-dependencies) +- [Running the Project](#running-the-project) +- [Submitting Pull Requests](#submitting-pull-requests) -POIDH App +--- -## Installation +### Cloning the Repository -To install the dependencies, run the following command: +1. Clone the repository to your local machine. Ensure you have Git installed. [Git installation guide](https://git-scm.com/docs). -```sh -npm install -``` + ```bash + git clone https://github.com/poidh/poidh-app.git + ``` + + Or, if you have the [GitHub CLI](https://cli.github.com) installed: + + ```bash + gh repo clone picsoritdidnthappen/poidh-app + ``` + +2. Navigate into the project directory. + + ```bash + cd poidh-app + ``` + + + +--- + +### Installing Node.js and pnpm + +POIDH uses **pnpm** as a package manager and requires **Node.js v18.12 or higher**. + +1. Check your versions to confirm compatibility: + + ```bash + node -v + pnpm -v + ``` + +2. If you need to install or update: + + - [Install Node.js](https://nodejs.org) + - [Install pnpm](https://pnpm.io/) + + + +--- + +### Installing Dependencies + +1. In the project root directory, install all required dependencies: + + ```bash + pnpm install + ``` + +2. This command will update and install all necessary packages. + + + +--- + +### Running the Project + +1. Start the POIDH app: + + ```bash + pnpm start + ``` + + Or, if you're running a development build: + + ```bash + pnpm dev + ``` + +2. The app should now be running locally! Check your terminal output for any additional information or errors. + + + +--- + +### Submitting Pull Requests + +To contribute code, follow these steps: + +1. **Style Guide**: Please review the POIDH style guide to maintain consistency in the codebase. + +2. **Code Check**: Before submitting, make sure your code is formatted and linted. GitHub Actions will automatically build, lint, and format your pull request, highlighting issues if they exist. + +3. **Commit Titles and Descriptions**: Keep titles and descriptions concise yet informative to help reviewers understand your changes. + +4. **Build Command**: Don’t forget to run the following to ensure your build is up to date: + + ```bash + pnpm build + ``` + +5. **Pull Request Review**: After submitting, if you see a ❌, review the error logs under the “Actions” tab to identify any issues. + + + +--- + +### Thank You! + +We appreciate your contribution to POIDH. Happy coding and thank you for helping to make POIDH even better!