Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add owner check and conditional rendering for Fund component #261

Merged
merged 3 commits into from
Nov 23, 2024

Conversation

Villarley
Copy link
Contributor

@Villarley Villarley commented Nov 22, 2024

Pull Request

Changes description

  • Implemented owner check in the Fund component using getOwner from the contract.
  • Added conditional rendering for "Withdraw" and "Donate" buttons based on ownership and fund state.
  • Updated the getDetails function to include owner address retrieval.
  • Enhanced error handling for fetching fund details.
  • Improved user feedback with appropriate messages for different fund states.

Current output

Give evidence like screenshots of what your job looks like.

image

Time spent breakdown

Understanding Requirements and Planning(Repo structure): ~30 minutes
Implementing Owner Check and State Logic: ~1 hour
Conditional Rendering of Buttons: ~45 minutes
Refactoring getDetails Function: ~30 minutes

Comments

Super Happy to contribute to this amazing project, hope to keep contributing!!!

- Implemented owner check in the Fund component using `getOwner` from the contract.
- Added conditional rendering for "Withdraw" and "Donate" buttons based on ownership and fund state.
- Updated the `getDetails` function to include owner address retrieval.
- Enhanced error handling for fetching fund details.
- Improved user feedback with appropriate messages for different fund states.
@adrianvrj adrianvrj self-requested a review November 22, 2024 21:29
{Number(fund.state) === 2 && (
<>
{isOwner ? (
<p>You are the owner. Donations will go towards your funding goal.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this p

Copy link
Member

@adrianvrj adrianvrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, just a little detail

Removed the p
@Villarley Villarley requested a review from adrianvrj November 23, 2024 03:28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please reverse the changes to this file

Copy link
Member

@adrianvrj adrianvrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not upload conf files changes

@Villarley Villarley requested a review from adrianvrj November 23, 2024 20:40
Copy link
Member

@adrianvrj adrianvrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm great work homie

@adrianvrj adrianvrj merged commit 794b6ce into web3wagers:dev Nov 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Display withdraw btn only for owner
2 participants