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: user profile #589

Merged
merged 19 commits into from
Jan 15, 2025
Merged

feat: user profile #589

merged 19 commits into from
Jan 15, 2025

Conversation

0xAlunara
Copy link
Collaborator

@0xAlunara 0xAlunara commented Jan 7, 2025

This PR is not even close to being finished, but because I'm touching global settings and stores that are all over place in the apps, I want to keep it small and not keep the PR open too long.

  • The user profile button shows only in beta mode. That means it won't show up in production
  • The user profile button replaces the advanced toggle and theme switcher button
  • The user profile is available even when no wallet is connected, because there's global settings there that are important even without a wallet. It'll show the 0x0000 address if there's no wallet connected.
  • I've decided to create new theme switching and advanced mdoe toggle components instead of re-using the switch-theme and switch-advanced-mode toggles. They differ enough that I couldn't re-use them in the user profile. I'm not sure if we want to keep those components as generic 'features', rather than just part of the component that hosts them.
  • At the moment to keep things small and simple only the advanced toggle and theme switcher are implemented. No metrics, no disconnect button.
  • Both these two settings reside in a new store specific to the feature, useUserProfileStore().
  • In addition, the store also contains the configured locale and slippage settings (although not configurable from the UI yet)
  • The slippage setting has a hardcoded global value. This used to be called router but was used globally anyway in all four different apps, hence the rename. Any other 'property' is usually a slippage setting for a certain pool & chain id combination.
  • All four properties (advanced mode, theme, locale, slippage) have been removed from the app or global Zustand slices. Hence the reason this PR is so big: the entire app now needs to use the new store.
  • The store is persisted in local storage. This means that until we merge all 4 apps, the different apps don't share a global persisted state. However, this is already the case in production.
  • There's no tests yet given the feature isn't released yet and is bound to change as it gets developed over time.
  • Current header tests fail of course, can fix that before merging.

image
image

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
curve-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:35pm
curve-dapp-crvusd ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:35pm
curve-dapp-dao ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:35pm
curve-dapp-lend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:35pm
curve-dapp-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:35pm

0xtutti
0xtutti previously approved these changes Jan 8, 2025
Base automatically changed from feat/toggle-button to main January 8, 2025 15:44
@0xAlunara 0xAlunara dismissed 0xtutti’s stale review January 8, 2025 15:44

The base branch was changed.

@0xAlunara 0xAlunara enabled auto-merge January 15, 2025 16:51
@0xAlunara 0xAlunara merged commit ae0cf3b into main Jan 15, 2025
11 checks passed
@0xAlunara 0xAlunara deleted the feat/user-profile branch January 15, 2025 16:52
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.

4 participants