Skip to content

feat: migrate box component to typescript #2370

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tesol2y090
Copy link

Migrate Box Component to TypeScript

Changes

  • Converted Box component from JavaScript to TypeScript
  • Added proper type definitions and interfaces
  • Improved type safety and developer experience
  • Apply box component

Related Issues

@tesol2y090 tesol2y090 requested a review from a team as a code owner April 14, 2025 18:02
@tesol2y090 tesol2y090 changed the title Feat/migrate box component feat: migrate box component to typescript Apr 14, 2025
Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this!! just a few minor changes requested

<section
className={className}
style={{ background: '#fbfbfb', ...style }}
{...props}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding ...props here is probably the right thing to do that we weren't previously doing, but: are we receiving extra props that will change the display unexpectedly?

@@ -1,6 +1,6 @@
import React from 'react'
import { withTranslation, Trans } from 'react-i18next'
import Box from '../box/Box.js'
import Box from '../box/Box'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should include the file extension on the import

Comment on lines +4 to +8
interface BoxProps {
className?: string;
style?: React.CSSProperties;
children: ReactNode;
[key: string]: any; // For any additional props
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if available,

Suggested change
interface BoxProps {
className?: string;
style?: React.CSSProperties;
children: ReactNode;
[key: string]: any; // For any additional props
interface BoxProps extends ComponentProps<'section'> {
className?: string;
style?: React.CSSProperties;
children: ReactNode;

or use explicit types

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.

2 participants