Repository navigation
Conversation
…integrated bridge an) Automated fix and test assertions. Signed-off-by: Ollie <olliemcgrath@icloud.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #13
/claim #13
Solution for [github/issues_13]: [capofficial/client] Welcome modal with integrated bridge and/or instructions
I'm taking on this bounty.
Technical Solution: Welcome Modal with Integrated Bridge and Instructions
The goal is to implement a welcome modal that appears for new users, providing an introduction to CAP, dashboard usage instructions, and an integrated bridge UI for Arbitrum funds. The modal should be dismissible and not reappear for the same user.
Root Cause Analysis
The current application lacks an onboarding mechanism for new users. This can lead to confusion regarding the platform's purpose, how to navigate the dashboard, and the process of funding an account, especially for users coming from Arbitrum. A welcome modal addresses this by providing a guided introduction.
Architecture Design
WelcomeModal.tsx) will house the modal's content and logic.showModal) within theApp.tsxor a parent component will control the visibility of the modal.localStoragewill be used to persist the user's decision to dismiss the modal, ensuring it doesn't reappear on subsequent visits. A key likecap_welcome_modal_dismissedwill store a boolean value.WelcomeModalwill be rendered conditionally inApp.tsxor a suitable parent component, based on thelocalStorageflag and initial load.Detailed Implementation Plan
WelcomeModal.tsx:App.tsx(or similar entry point):localStorageforcap_welcome_modal_dismissed.false, setshowModaltotrue.onCloseprop toWelcomeModalthat updatesshowModalandlocalStorage.localStorage:cap_welcome_modal_dismissedtotrueinlocalStorage.showModalis set tofalsefor the current session.Bridge Integration Choice
For the integrated bridge, embedding an iframe from a service like Orbiter Finance or Across Protocol is the most practical and secure approach without requiring extensive backend or smart contract development for the bounty. Orbiter Finance is a good choice for bridging between L2s, including Arbitrum. We'll pre-configure the iframe to suggest Arbitrum as the source.
Alternative (if iframe is not preferred or causes issues):
Provide a dedicated tab with clear, step-by-step instructions on how to bridge funds from Arbitrum to Arbitrum Nova (assuming CAP operates on Nova) using recommended third-party bridges, along with direct links. This is less "integrated" but equally effective and avoids potential iframe sandboxing issues.
Decision for this solution: I will implement an iframe for a direct bridge experience, as requested by "integrated bridge UI," and provide clear instructions alongside it. I'll use Orbiter Finance as an example, configured for Arbitrum to Arbitrum Nova.
File: src/components/WelcomeModal.tsx
File: src/App.tsx
File: src/index.css (or global CSS file)
Explanation of Changes:
src/components/WelcomeModal.tsx:useStateforactiveTabto manage the content displayed (Welcome, How to Use, Bridge Funds).dontShowAgainstate and checkbox are implemented to control persistence.<iframe>pointing to Orbiter Finance, pre-configured for Arbitrum to Arbitrum Nova and USDC. This provides a direct, integrated bridging experience.XMarkIconis imported from@heroicons/react/24/outlinefor the close button. Ensure@heroicons/reactis installed (npm install @heroicons/react).custom-scrollbarclass is added for better UX on scrollable content.src/App.tsx:useState(showWelcomeModal) is used to control the modal's visibility.useEffectruns once on component mount to checklocalStorageforcap_welcome_modal_dismissed. If it's nottrue, the modal is shown.handleCloseWelcomeModalis passed as a prop toWelcomeModal. It updatesshowWelcomeModaland, ifdontShowAgainis checked, setscap_welcome_modal_dismissedto'true'inlocalStorage.WelcomeModalcomponent is conditionally rendered based onshowWelcomeModal.src/index.css:custom-scrollbarclass to make the scrollbar in the modal content more visually appealing and consistent with a dark theme. This is optional but improves UX.Installation and Setup:
npm install @heroicons/react # or yarn add @heroicons/reactsrc/components/WelcomeModal.tsxand paste the content.src/App.tsxwith the provided changes.src/index.css).Testing Verification Steps:
Initial Load (First Time User):
localStoragefor the application in your browser's developer tools (Application tab -> Local Storage ->http://localhost:3000or your app's URL -> deletecap_welcome_modal_dismissed).Modal Content and Navigation:
target="_blank").Dismissal - Temporary:
Xicon.Dismissal - Permanent:
Xicon.localStoragethatcap_welcome_modal_dismissedis set to'true'.Responsiveness:
Accessibility (Basic):
This comprehensive solution provides a user-friendly onboarding experience, integrates a crucial bridging function, and ensures the modal respects user preferences for persistence.
Pull Request Summary
Title: Feature: Implement Welcome Modal with Integrated Bridge and Instructions
Description:
This PR introduces a new welcome modal designed to enhance the onboarding experience for new users of the CAP trading dashboard. The modal appears on a user's first visit and provides essential information and tools to get started.
Key Features:
localStorage.Changes Made:
src/components/WelcomeModal.tsxto house the modal component, including tab navigation, content, and bridge integration.src/App.tsxto conditionally render theWelcomeModalbased on alocalStorageflag (cap_welcome_modal_dismissed).src/index.cssfor improved UX within the modal's content area.@heroicons/reactfor the close button icon.Installation/Setup:
@heroicons/reactis installed (npm install @heroicons/react).Testing:
Please follow the verification steps outlined in the bounty solution to ensure full functionality:
This implementation directly addresses the bounty requirements by providing a comprehensive welcome experience with integrated bridging capabilities.
Payout & Settlement Details
0x66545035486C8B3b7966c45dc035560F4066aBb5