right-panel.tsx


Overview

right-panel.tsx defines a React functional component named LoginRightPanel that renders the right-side panel of a login page or screen. Its primary purpose is to provide a visually appealing and informative section including a star icon, a localized title and description, user avatars, and a review rating with stars and text.

This component leverages Ant Design UI components (Typography, Rate, Space, Flex), a custom SvgIcon component for SVG rendering, and a localized translation hook (useTranslate). Styling is applied through CSS modules imported as styles.

The panel is designed to complement the login UI by providing branding elements, a motivational or descriptive message, and social proof through user ratings and avatars.


Component Details

LoginRightPanel

A React functional component representing the right panel in the login page.

Usage

import LoginRightPanel from './right-panel';

function LoginPage() {
  return (
    <div className="login-page">
      {/* other components */}
      <LoginRightPanel />
    </div>
  );
}

Props

Returns

Internal Behavior and Implementation Details


Integration and Interaction


File Structure Summary


Visual Diagram

componentDiagram
    LoginRightPanel --> SvgIcon : renders "login-star"
    LoginRightPanel --> Avatars : renders user avatars SVG
    LoginRightPanel --> Typography.Title : renders localized title
    LoginRightPanel --> Typography.Text : renders localized description and review
    LoginRightPanel --> Rate : renders 5-star rating (disabled)
    LoginRightPanel --> useTranslate : fetches localized strings
    LoginRightPanel --> styles : applies CSS module styles

Summary

right-panel.tsx provides a neatly organized, localized, and styled right panel for a login page, featuring branding icons, user avatars, and a star rating system. It integrates smoothly with localization hooks and Ant Design components, ensuring consistency in UI and UX. The component is self-contained and reusable within any login-related UI context.


Appendix: Key Code Snippets

const { t } = useTranslate('login');
// Usage:
t('title'), t('description'), t('review')
<SvgIcon name="login-star" width={80} />
<Flex align="center" gap={16}>
  <Avatars />
  <Flex vertical>
    <Space>
      <Rate disabled defaultValue={5} />
      <span className={classNames(styles.white, styles.loginRateNumber)}>5.0</span>
    </Space>
    <span className={classNames(styles.pink, styles.loginRateReviews)}>{t('review')}</span>
  </Flex>
</Flex>

If further integration or extension is needed, this component can be easily adapted by passing props, adjusting translations, or modifying styles in the corresponding CSS module.