Skip to content

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?

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

@SgtPooki SgtPooki closed this Aug 25, 2025
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