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

Charles #73

Closed
wants to merge 9 commits into from
Closed

Charles #73

wants to merge 9 commits into from

Conversation

CharlesLedwaba
Copy link
Collaborator

@CharlesLedwaba CharlesLedwaba commented Jun 25, 2024

PR Type

enhancement


Description

  • Integrated MetaMask to fetch and display the user's address and balance on the profile page.
  • Updated the profile balance element in the HTML to support dynamic content.

Changes walkthrough 📝

Relevant files
Enhancement
profile.js
Add MetaMask integration to profile page                                 

assets/js/profile.js

  • Imported metaConnection from metamask.js.
  • Added getAddress function to fetch and display MetaMask address and
    balance.
  • Called getAddress to display the balance on page load.
  • +20/-0   
    profile.html
    Update profile balance element for dynamic content             

    pages/user/profile.html

  • Modified profile-balance element to support dynamic balance display.
  • +3/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Summary by Sourcery

    This pull request introduces a new feature to fetch and display the user's MetaMask address and balance on the profile page. It also updates the HTML structure to support dynamic balance updates.

    • New Features:
      • Added functionality to fetch and display the user's MetaMask address and balance in the profile page.
    • Enhancements:
      • Updated the profile balance display element in the HTML to accommodate dynamic balance updates.

    Copy link
    Contributor

    sourcery-ai bot commented Jun 26, 2024

    Reviewer's Guide by Sourcery

    This pull request integrates MetaMask functionality into the user profile page. It includes changes to fetch and display the user's MetaMask address and balance in the profile section. The JavaScript file 'profile.js' was updated to include a new function for fetching the balance, and the HTML structure in 'profile.html' was modified to properly display the balance.

    File-Level Changes

    Files Changes
    assets/js/profile.js
    pages/user/profile.html
    Integrated MetaMask functionality to display the user's balance on the profile page.

    Tips
    • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
    • You can change your review settings at any time by accessing your dashboard:
      • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
      • Change the review language;
    • You can always contact us if you have any questions or feedback.

    Copy link
    Contributor

    codiumai-pr-agent-pro bot commented Jun 26, 2024

    PR Reviewer Guide 🔍

    (Review updated until commit 0ba60e2)

    ⏱️ Estimated effort to review [1-5] 3
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Possible Bug:
    The getAddress function in profile.js uses ethereum.request without checking if ethereum is defined, which could lead to runtime errors if the Ethereum object is not available in the global scope. Consider adding a check to ensure ethereum is available before making requests.
    Hardcoded Values:
    The division by 10**18 in updateBalanceElement assumes that all balances will be in Wei, which might not be the case if the contract or token standard changes. Consider making this more flexible or clearly documenting this assumption.

    sourcery-ai[bot]

    This comment was marked as duplicate.

    Copy link

    github-actions bot commented Jun 26, 2024

    Visit the preview URL for this PR (updated for commit 7140f5c):

    https://brainiacwiz--pr73-charles-dpctvr5w.web.app

    (expires Wed, 03 Jul 2024 01:29:32 GMT)

    🔥 via Firebase Hosting GitHub Action 🌎

    Sign: aff57accd7fb79ba1d7bf7e70bd8fcad77b0db3f

    This comment was marked as resolved.

    @mmpotulo28 mmpotulo28 requested review from a team June 26, 2024 00:17
    @mmpotulo28 mmpotulo28 linked an issue Jun 26, 2024 that may be closed by this pull request
    Copy link
    Member

    @mmpotulo28 mmpotulo28 left a comment

    Choose a reason for hiding this comment

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

    image

    user balance not showing, it show only on the terminal

    also apply the AI suggested changes,
    image

    Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
    Copy link

    cloudflare-workers-and-pages bot commented Jun 26, 2024

    Deploying brainiacwiz with  Cloudflare Pages  Cloudflare Pages

    Latest commit: 7140f5c
    Status: ✅  Deploy successful!
    Preview URL: https://387d3315.brainiacwiz.pages.dev
    Branch Preview URL: https://charles.brainiacwiz.pages.dev

    View logs

    mmpotulo28 and others added 2 commits June 26, 2024 02:43
    Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
    @mmpotulo28

    This comment was marked as outdated.

    This comment was marked as outdated.

    @mmpotulo28
    Copy link
    Member

    /review

    Copy link
    Contributor

    Persistent review updated to latest commit 0ba60e2

    mmpotulo28
    mmpotulo28 previously approved these changes Jun 26, 2024
    auto-merge was automatically disabled June 26, 2024 01:32

    Pull request was closed

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    PROFILE PAGE NOT SHOWING BALANCE
    3 participants