Sentry repository uses shared components for 2 projects now:
We minimized the usage of UI libraries/frameworks, so most of the shared/non-shared components are written without any UI libraries/frameworks.
All components in web-staking which are also in shared ui folder are duplicated because web-staking is not integrated into the monorepo. Therefore, for further updates, you need to update both versions of the components to avoid merge conflicts or integrate web-staking into the monorepo.
Most of the components in web-staking which are not in the ui folder are deprecated and not used, either in whole or in part. They should be deleted.
- PrimaryButton:
- SecondaryButton:
- ConnectButton:
- ButtonBack:
- BorderWrapperComponent.tsx:
- Description: Wrapper that added border and border radius.
- Defined in: File
- CustomInput:
- StakingInput:
- PoolInput:
- LinkComponent:
- Description: Primary link.
- Defined in: File
- LinkLogoComponent:
- Description: Link with logo.
- Defined in: File
- ExternalLinkComponent:
- Description: Secondary link.
- Defined in: File
- LegalLink:
- Description: Tertiary link.
- Defined in: File
- ModalComponent:
- ModalTermsAndConditions:
- toastMarkUp:
- Description: Mark up for notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- successNotification:
- Description: Success Notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- errorNotification:
- Description: Error Notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- loadingNotification:
- Description: Loading Notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- updateNotification:
- Description: Function for updating notifications.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- PaginationComponent:
- CustomPopover:
- RadioCard:
- RadioGroupWrapper:
Next there will be a list of components, in which we will add a comment about whether it is using any ui library/framework or not. Here is a list of the shared components:
- ConnectButton.tsx:
- Description: Button that allows users connect their wallet.
- Defined in: File
- PrimaryButton.tsx:
- Description: Primary button.
- Defined in: File
- TextButton.tsx:
- Description: Secondary button.
- Defined in: File
- BaseCallout.tsx:
- Description: Wrapper for other components/elements.
- Defined in: File
- MainCheckbox.tsx:
- Description: Checkbox.
- Defined in: File
- Dropdown.tsx:
- Description: Dropdown.
- Defined in: File
- BaseInput.tsx:
- Description: Primary input for user information.
- Defined in: File
- ExternalLink.tsx:
- Description: Primary link.
- Defined in: File
- WarningNotification.tsx:
- Description: Primary warning notification.
- Defined in: File
- MainStepper.tsx:
- Description: Counter with increase/decrease buttons.
- Defined in: File
- Tooltips.tsx:
- Description: Tooltip.
- Defined in: File
- SideBarTooltip.tsx:
Non-shared components are those utilized on the Staking Website but have not yet been migrated from the web-staking repository to the monorepo UI folder:
- CTAButton.tsx:
- Description: Similar to primary button. Has another clip-path.
- Defined in: File
- IconButton.tsx:
- Description: Button that has only icon as child element.
- Defined in: File
- ButtonBack.tsx:
- Description: Button that redirects the user to the previous page.
- Defined in: File
- Radio.tsx:
- Description: Radio group/button. Uses ReactContext for correct value handling.
- Defined in: File
- StakingInput.tsx:
- Description: Primary input for operations with user wallet's balance (stake/unstake/redeem).
- Defined in: File
- BaseModal.tsx:
- Description: Modal.
- Defined in: File
- LoadingNotification.tsx:
- Description: Loading notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- UpdateNotification.tsx:
- Description: Allows update state of notification.
- UI Library: ReactToastify. The best/most popular solution for such kind of components.
- Defined in: File
- BasePagination.tsx:
- Description: Pagination.
- Defined in: File
- BasePaginationItem.tsx:
- Description: Pagination page.
- Defined in: File
- BaseSpinner.tsx:
- Description: Svg spinner.
- Defined in: File
- MainToggle.tsx:
- Description: Styled switcher between two states.
- Defined in: File
- Progress.tsx:
- Textareas.tsx:
- MainTitle.tsx:
- Description: Styled title.
- Defined in: File
- SearchableDropdown.tsx:
- Description: For correct application of custom dropdown styles with search the best solution is to apply styles via global css, as other ways do not give the desired result due to non simple custom styles
- Defined in: File
- ReactCookieConsent.tsx:
- Description: Cookies consent component.
- UI Library: ReactCookieConsent The best/most popular solution for such kind of components.
- Defined in: File
When removing duplicate components, you should be cautious about ensuring that the functionality remains intact. First, check the props and styles of the components to see if they are identical. Secondly, some components might have divergent functionality due to differences in specific tasks and goals, which means you need to carefully assess if they can truly be merged. The new consolidated component might become overly complex if it needs to handle many different use cases. Additionally, consider any side effects or dependencies each component might have, as these could impact the overall behavior of your application. Lastly, thoroughly test the unified component to ensure it meets all necessary requirements without introducing new bugs.