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

refactor: badge color and referrals validations #452

Merged
merged 9 commits into from
Jan 21, 2025
Merged

Conversation

cswni
Copy link
Contributor

@cswni cswni commented Jan 21, 2025

This pull request includes several changes to improve the user experience, enhance code readability, and fix some issues. The most important changes are related to updating the avatar component, improving the invitation system, and fixing some configuration and styling issues.

Avatar Component Updates:

  • Added default styles for the Avatar component, including background color and font weight.
  • Modified the alt attribute to be uppercase.

Invitation System Improvements:

  • Moved the Invitation interface to a separate types file for better code organization. [1] [2]
  • Added new error messages for invitation-related errors, such as inviting oneself or inviting an already invited user. [1] [2]
  • Enhanced the useReferrals hook with additional checks and updated local state management. [1] [2] [3] [4]
  • Updated the FinanceInviteFriends component to include additional validation and error handling for invitations. [1] [2] [3]

Configuration and Styling Fixes:

  • Corrected a typo in the GLOBAL_CONSTANTS configuration.
  • Updated the Sentry DSN configuration and added trace propagation targets.
  • Changed the color of the verified badge icon.
  • Added font size styling to the AccountPopover and ProfileHeader components. [1] [2]

Code Refactoring:

  • Improved the readability and maintainability of the supabase-actions utility functions by adding comments and restructuring the code. [1] [2] [3] [4] [5]

cswni and others added 9 commits January 20, 2025 18:48
- Updated `AvatarProfile` to use a local variable `imageSrc` for clearer and safer source URL handling.
- Ensured generated avatar fallback works correctly for invalid or missing URLs.
- `finance-invite-friends.tsx`:
  - Added validation for inviting users: prevent inviting self, malformed emails, or already invited users.
  - Integrated `checkIfEmailAlreadyInvited` from Supabase actions.
  - Disabled invite button when email is invalid or loading.
- `supabase-actions.ts`:
  - Created `checkIfEmailAlreadyInvited` to validate if an email has been previously invited.
- `errors.ts`:
  - Introduced new error messages for duplicate invitations and self-invitations.
- Updated the badge color in `BadgeVerified.tsx` from white (`#FFF`) to gold (`#cca421`) for better visibility and distinction.
- **src/sections/user/profile-header.tsx**: Added `fontSize: '3em'` to style for profile header avatar.
- **src/components/avatar/avatar.tsx**:
  - Integrated `COLORS.GRAY_DARK` as the default background color for avatars.
  - Modified `alt` to render as uppercase.
  - Merged additional styling properties for consistency.
- **src/layouts/_common/account-popover.tsx**: Added `fontSize: '1.25rem'` to avatar style for popover.
- **src/config-global.ts**: Correct typo from `SENTRY_DNS` to `SENTRY_DSN`.
- **src/index.tsx**: Update Sentry configuration to reflect the corrected `dsn` key and add `tracePropagationTargets`.
- **src/sections/user/profile-header.tsx**: Fix typo in share text, changing "in Watchit" to "on Watchit".

These changes ensure proper functionality and correct phrasing across the application.
- Updated `profile-header.tsx` to include additional hashtags, "Crypto" and "Blockchain," in the share URL for X (formerly Twitter).
- Helps improve post visibility and align with platform focus.
@cswni cswni added the Refactor label Jan 21, 2025
@cswni cswni requested review from geolffreym and Jadapema January 21, 2025 03:16
@cswni cswni self-assigned this Jan 21, 2025
@geolffreym geolffreym merged commit e5a7f70 into next Jan 21, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants