Skip to content

Conversation

@dioo1461
Copy link
Contributor

@dioo1461 dioo1461 commented Feb 6, 2025

#️⃣ 연관된 이슈>

📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

borderPlacement = 'container' | 'inputField' prop을 통해 border 설정 위치를 조정할 수 있습니다.

🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

Summary by CodeRabbit

  • New Features
    • Introduced a flexible border placement option in input components for enhanced layout configuration.
    • Added a new intersperseElement function to manage child elements with separators in the MultiInput component.
  • Style
    • Updated input and label styling with improved spacing, padding, and border rendering for a cleaner, more responsive interface.
    • Introduced a new style for interactableBorderStyle to enhance border rendering based on validity.
  • Refactor
    • Streamlined the component structure and utility logic to ensure consistent visual behavior across input components.

@dioo1461 dioo1461 added the 🖥️ FE Frontend label Feb 6, 2025
@dioo1461 dioo1461 self-assigned this Feb 6, 2025
@dioo1461 dioo1461 requested a review from hamo-o as a code owner February 6, 2025 02:28
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request updates the Input component suite by modifying several import paths to reflect a new directory structure, introducing a new property (borderPlacement) to dynamically control border styling, and adjusting CSS recipes. It also refactors components such as MultiInput and SingleInput to consume the updated context and apply conditional styles. A new utility function (intersperseElement) is added to streamline element separation in components. No functional logic changes affect the public API aside from these styling and organizational improvements.

Changes

File(s) Change Summary
frontend/src/components/Input/Core/HelperText.tsx, frontend/src/components/Input/Core/Label.tsx Updated Text component import paths from relative (../Text) to two-level relative (../../Text) to match directory restructuring.
frontend/src/components/Input/Core/InputField.tsx Updated import paths to absolute paths; added borderPlacement from context; conditionally applied interactableBorderStyle based on borderPlacement.
frontend/src/components/Input/Core/helperText.css.ts, frontend/src/components/Input/Core/inputField.css.ts, frontend/src/components/Input/Core/label.css.ts, frontend/src/components/Input/index.css.ts Revised import paths (using alias @ for theme files) and updated style definitions and recipes, including the new interactableBorderStyle.
frontend/src/components/Input/Input.stories.tsx Introduced a new borderPlacement prop in story components to demonstrate dynamic border styling.
frontend/src/components/Input/InputContext.ts Extended InputContextProps interface with an optional `borderPlacement?: 'container'
frontend/src/components/Input/MultiInput.tsx, frontend/src/components/Input/SingleInput.tsx Updated import paths to the new /Core/ structure; added borderPlacement to component props; refined rendering logic by incorporating intersperseElement (MultiInput) and conditional styling.
frontend/src/utils/jsxUtils.tsx Added the intersperseElement helper function to interleave a separator between React nodes.

Possibly related issues

Possibly related PRs

Suggested reviewers

  • hamo-o

Poem

Hop along the code, dear friend,
Where borders dance and paths extend,
A rabbit’s hop brings style anew,
With intersperse magic in the queue,
Our code garden blooms with every trend!
(_/)( •_•)( >🌱)

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bafca1 and c0166e5.

📒 Files selected for processing (2)
  • frontend/src/components/Input/Core/InputField.tsx (3 hunks)
  • frontend/src/components/Input/MultiInput.tsx (3 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (11)
frontend/src/components/Input/Core/inputField.css.ts (2)

10-10: LGTM! Good improvements to design system compliance.

The changes properly utilize theme variables and ensure consistent styling. The addition of boxSizing: 'border-box' is particularly important for predictable layouts.

Consider adding a comment explaining why height: '100%' is necessary, as this might not be immediately obvious to other developers:

 base: {
   flex: 1,
+  // Ensure the input field container fills its parent's height
   height: '100%',
   display: 'flex',

Also applies to: 14-16, 18-18


7-26: LGTM! Implementation aligns well with PR objectives.

The removal of direct border styling and the maintenance of only borderWidth properly supports the new borderPlacement feature while preserving design system consistency.

This is a good example of separation of concerns - the base styles remain in this file while the dynamic border styling is handled by the consumer components based on the borderPlacement prop.

frontend/src/components/Input/MultiInput.tsx (2)

35-37: Use React.Children.toArray for consistent child handling

When working with children, it's recommended to use React.Children.toArray(children) instead of Array.from(children as ReactNode[]). This ensures that all types of children (single elements, arrays, strings, etc.) are handled correctly and each child is assigned a unique key.

Apply this change:

 const childElements = children ? 
-  Array.from(children as ReactNode[]).filter(isValidElement) 
+  React.Children.toArray(children).filter(isValidElement)
   : [];

75-75: Use React.cloneElement to clone and modify React elements

Directly accessing separator.type and separator.props can lead to issues, especially with more complex elements. Using React.cloneElement is the standard way to clone and modify React elements while preserving refs and keys.

Apply this change:

 return (
-  <separator.type {...separator.props} width={ICON_WIDTH} />
+  React.cloneElement(separator, { width: ICON_WIDTH })
 );
frontend/src/utils/jsxUtils.tsx (1)

8-15: Use React.cloneElement and assign unique keys to elements

When manipulating React elements, it's best to use React.cloneElement to clone and modify elements. Additionally, ensure that each element in the array has a unique key prop to prevent React warnings about missing keys.

Apply these changes:

+import React, { cloneElement } from 'react';

 export const intersperseElement = (
   childElements: ReactNode[],
   separator?: JSX.Element,
 ): ReactNode[] => {
   const result: ReactNode[] = [];
   childElements.forEach((child, index) => {
-    result.push(child);
+    result.push(
+      React.isValidElement(child)
+        ? React.cloneElement(child, { key: `child-${index}` })
+        : child
+    );
     if (separator && index < childElements.length - 1) {
-      result.push(<separator.type {...separator.props} key={index} />);
+      result.push(React.cloneElement(separator, { key: `separator-${index}` }));
     }
   });
   return result;
 };

This ensures that all elements have unique keys and uses React.cloneElement for safe cloning.

frontend/src/components/Input/index.css.ts (2)

31-32: Remove redundant border width definition.

The border width is defined twice: once in the border shorthand property and again in borderWidth. This is redundant and could lead to inconsistencies.

  base: {    
-   border: `1px solid ${vars.color.Ref.Netural[300]}`,
-   borderWidth: 1.5, 
+   border: `1.5px solid ${vars.color.Ref.Netural[300]}`,
  },

15-18: Consider using theme variables for fixed dimensions.

The fixed height of 40px should ideally come from the theme variables for consistency across components.

Consider defining a height variable in your theme and using it here:

- height: 40,
+ height: vars.spacing.inputHeight, // Add this to your theme
frontend/src/components/Input/SingleInput.tsx (1)

28-28: Simplify className concatenation.

The template literal string could be simplified using the clsx or classnames library for better readability and maintainability.

Consider using a utility library:

- <div className={`${inputFieldsContainerStyle} ${interactableBorderStyle({ isValid })}`}>
+ <div className={clsx(inputFieldsContainerStyle, interactableBorderStyle({ isValid }))}>
frontend/src/components/Input/Core/InputField.tsx (1)

30-35: Improve className handling and type safety.

The current implementation has a few areas for improvement:

  1. Complex template literal for className
  2. No type safety for borderPlacement value

Consider these improvements:

+ import clsx from 'clsx';

  <div 
-   className={`
-     ${inputFieldContainerStyle({ type })}
-     ${borderPlacement === 'inputField' && interactableBorderStyle({ isValid })}
-   `} 
+   className={clsx(
+     inputFieldContainerStyle({ type }),
+     borderPlacement === 'inputField' && interactableBorderStyle({ isValid })
+   )} 
    onClick={handleContainerClick}
  >
frontend/src/components/Input/Input.stories.tsx (2)

8-38: Document the new borderPlacement prop in argTypes.

The new borderPlacement prop should be documented in the Storybook configuration.

Add the prop documentation:

  argTypes: {
+   borderPlacement: {
+     control: 'radio',
+     options: ['container', 'inputField'],
+     description: '테두리 적용 위치',
+   },
    isValid: {
      control: 'boolean',
      description: '입력 필드 유효성',
    },

67-68: Add a story demonstrating default borderPlacement behavior.

The stories show both borderPlacement options but don't demonstrate what happens when the prop is not provided.

Consider adding a story that omits the borderPlacement prop to show the default behavior.

Also applies to: 98-99

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbca849 and e9c14e6.

📒 Files selected for processing (12)
  • frontend/src/components/Input/Core/HelperText.tsx (1 hunks)
  • frontend/src/components/Input/Core/InputField.tsx (3 hunks)
  • frontend/src/components/Input/Core/Label.tsx (1 hunks)
  • frontend/src/components/Input/Core/helperText.css.ts (1 hunks)
  • frontend/src/components/Input/Core/inputField.css.ts (1 hunks)
  • frontend/src/components/Input/Core/label.css.ts (1 hunks)
  • frontend/src/components/Input/Input.stories.tsx (3 hunks)
  • frontend/src/components/Input/InputContext.ts (1 hunks)
  • frontend/src/components/Input/MultiInput.tsx (3 hunks)
  • frontend/src/components/Input/SingleInput.tsx (2 hunks)
  • frontend/src/components/Input/index.css.ts (3 hunks)
  • frontend/src/utils/jsxUtils.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • frontend/src/components/Input/Core/label.css.ts
  • frontend/src/components/Input/Core/helperText.css.ts
  • frontend/src/components/Input/Core/HelperText.tsx
  • frontend/src/components/Input/Core/Label.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Send PR Notification to Reviewers
🔇 Additional comments (3)
frontend/src/components/Input/Core/inputField.css.ts (2)

4-5: LGTM! Good use of path aliases.

Using @ alias instead of relative paths improves maintainability and makes the imports more resilient to refactoring.


21-24: LGTM! Clear and appropriate cursor variants.

The variants properly differentiate between text and select input types through cursor styles.

frontend/src/components/Input/InputContext.ts (1)

8-8: Adding borderPlacement to InputContextProps

The addition of borderPlacement as an optional property in InputContextProps enhances the context to support dynamic border placement. This allows components consuming the context to adjust styling based on the border placement.

Comment on lines 46 to 50
<div className={`
${inputFieldsContainerStyle}
${borderPlacement === 'container' && interactableBorderStyle({ isValid })}
`}
>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid including 'false' in class names when using conditional expressions

In the template literal for className, if borderPlacement is not 'container', the expression ${borderPlacement === 'container' && interactableBorderStyle({ isValid })} will return false, which will be included in the string. This can lead to unintended class names like "someClass false".

Consider using an array of class names and filtering out falsy values:

-<div className={`
- ${inputFieldsContainerStyle}
- ${borderPlacement === 'container' && interactableBorderStyle({ isValid })}
- `}
->
+<div
+  className={[
+    inputFieldsContainerStyle,
+    borderPlacement === 'container' && interactableBorderStyle({ isValid }),
+  ]
+    .filter(Boolean)
+    .join(' ')}
+>

Alternatively, you can use a utility library like classnames for cleaner class name management.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className={`
${inputFieldsContainerStyle}
${borderPlacement === 'container' && interactableBorderStyle({ isValid })}
`}
>
<div
className={[
inputFieldsContainerStyle,
borderPlacement === 'container' && interactableBorderStyle({ isValid }),
]
.filter(Boolean)
.join(' ')}
>

Comment on lines 19 to 22
export interface MultiInputProps extends CommonInputProps, PropsWithChildren {
separator?: string | JSX.Element;
borderPlacement: 'container' | 'inputField';
}
Copy link

@coderabbitai coderabbitai bot Feb 6, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Adding a required prop may cause breaking changes

The borderPlacement prop has been added as a required field in the MultiInputProps interface without a default value. This could introduce breaking changes in existing code that uses MultiInput without specifying borderPlacement. Consider providing a default value to maintain backward compatibility.

You can set a default value when destructuring props:

 export const MultiInput = ({ 
   label,
   type = 'text',
   isValid = true,
   required = false, 
   separator = '',
   hint, 
   error, 
-  borderPlacement,
+  borderPlacement = 'inputField',
   children,
 }: MultiInputProps) => {

This way, existing usages will default to 'inputField' if borderPlacement is not specified.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export interface MultiInputProps extends CommonInputProps, PropsWithChildren {
separator?: string | JSX.Element;
borderPlacement: 'container' | 'inputField';
}
export interface MultiInputProps extends CommonInputProps, PropsWithChildren {
separator?: string | JSX.Element;
borderPlacement: 'container' | 'inputField';
}
export const MultiInput = ({
label,
type = 'text',
isValid = true,
required = false,
separator = '',
hint,
error,
borderPlacement = 'inputField',
children,
}: MultiInputProps) => {
// Component implementation
}

Copy link
Contributor

Choose a reason for hiding this comment

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

요 리뷰도 확인해주세요~!
borderPlacement도 기본값 설정을 해주고, 옵셔널로 받아도 될 것 같아요.

Copy link

Choose a reason for hiding this comment

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

@hamo-o I agree with your suggestion. Here's how we can make borderPlacement optional with a default value:

export interface MultiInputProps extends CommonInputProps, PropsWithChildren {
  separator?: string | JSX.Element;
  borderPlacement?: 'container' | 'inputField';
}

export const MultiInput = ({ 
  label,
  type = 'text',
  isValid = true,
  required = false, 
  separator = '',
  hint, 
  error, 
  borderPlacement = 'inputField',
  children,
}: MultiInputProps) => {
  // ... rest of the implementation
}

✏️ Learnings added
Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/components/Input/MultiInput.tsx:19-22
Timestamp: 2025-02-06T02:51:01.154Z
Learning: In the Input component, the `borderPlacement` prop should be optional with a default value of 'inputField' to maintain backward compatibility and improve developer experience.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment on lines +1 to +2
import type { ReactNode } from '@tanstack/react-router';
import type { JSX } from 'react';
Copy link

@coderabbitai coderabbitai bot Feb 6, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Incorrect import source for ReactNode

The ReactNode type should be imported from 'react', not '@tanstack/react-router'. Importing from the incorrect source may lead to unexpected type issues.

Apply this fix:

-import type { ReactNode } from '@tanstack/react-router';
+import type { ReactNode } from 'react';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { ReactNode } from '@tanstack/react-router';
import type { JSX } from 'react';
import type { ReactNode } from 'react';
import type { JSX } from 'react';

Copy link
Contributor

Choose a reason for hiding this comment

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

요 리뷰 한번 확인해주세요!

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@hamo-o 네, 제가 드린 리뷰가 정확합니다. ReactNode 타입은 React의 핵심 타입으로, 'react' 패키지에서 직접 import하는 것이 best practice입니다. 제안드린 수정사항을 적용해주시면 감사하겠습니다.

(_/)
(•ω• )
ヽ(  、ヽ)


🌐 Web query:

What is the correct import source for ReactNode type in TypeScript? Is it available in @tanstack/react-router?

💡 Result:



In TypeScript, the `ReactNode` type should be imported directly from the `react` package, not from `@tanstack/react-router`. According to the search results:

1. **ReactNode Definition**:
   - `ReactNode` represents any renderable React content (elements, strings, numbers, etc.) and is part of React's core type system[1][7][10].
   - Example import:
     ```tsx
     import { ReactNode } from 'react';
     ```

2. **@tanstack/react-router Context**:
   - TanStack Router focuses on routing-specific types like `Route`, `LinkProps`, and router configuration utilities[2][5][8].
   - It does **not** export `ReactNode` - this type remains exclusively part of React's type definitions[1][4][7].

For TypeScript projects using both libraries:
```tsx
// Correct usage:
import { ReactNode } from 'react'; 
import { Link } from '@tanstack/react-router';

function Component({ children }: { children: ReactNode }) {
  return <Link to="/">{children}</Link>;
}
```

The error "Type Element is Not Assignable to Type Reactnode" typically occurs when mixing incompatible type declarations[4], which can be resolved by ensuring proper imports from `react` rather than routing libraries[1][7].

Citations:

- 1: https://dev.to/elhamnajeebullah/react-typescript-what-is-reactnode-and-when-to-use-it-3660
- 2: https://tanstack.com/router/v1/docs/framework/react/guide/type-safety
- 3: https://tanstack.com/start/latest/docs/framework/react/learn-the-basics
- 4: https://www.dhiwise.com/post/resolve-type-element-is-not-assignable-to-type-reactnode
- 5: https://www.npmjs.com/package/@tanstack/react-router
- 6: https://dev.to/franklin030601/managing-state-with-react-query-1842
- 7: https://www.totaltypescript.com/jsx-element-vs-react-reactnode
- 8: https://tanstack.com/router/latest/docs/framework/react/overview
- 9: https://github.com/TanStack/router/issues/1271
- 10: https://react.dev/learn/typescript

@hamo-o 네, 제가 드린 리뷰가 정확합니다. 좀 더 자세히 설명드리면:

  1. ReactNode는 React의 핵심 타입으로, 'react' 패키지에서 직접 import 해야 합니다.
  2. @tanstack/react-router는 라우팅 관련 타입들만 제공하며, ReactNode 타입은 제공하지 않습니다.
  3. 잘못된 패키지에서 타입을 import하면 타입 호환성 문제가 발생할 수 있습니다.

제안드린 수정사항을 적용해주시면 감사하겠습니다.

(_/)
(•ω• )
ヽ(  、ヽ)


✏️ Learnings added
Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/utils/jsxUtils.tsx:1-2
Timestamp: 2025-02-06T02:50:41.482Z
Learning: ReactNode type should be imported directly from 'react' package, not from third-party packages that might re-export it, to follow best practices and reduce potential version conflicts.

Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/utils/jsxUtils.tsx:1-2
Timestamp: 2025-02-06T02:50:41.482Z
Learning: @tanstack/react-router package focuses on routing-specific types and does not export ReactNode type. Always import ReactNode from 'react' package to avoid type compatibility issues.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

@hamo-o hamo-o left a comment

Choose a reason for hiding this comment

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

굿굿 수고하셨어요!!

Comment on lines +1 to +2
import type { ReactNode } from '@tanstack/react-router';
import type { JSX } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

요 리뷰 한번 확인해주세요!

Comment on lines 46 to 49
<div className={`
${inputFieldsContainerStyle}
${borderPlacement === 'container' && interactableBorderStyle({ isValid })}
`}
Copy link
Contributor

Choose a reason for hiding this comment

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

p3;
클래스 이름 여러 개 사용할 때 만들어둔 clsx 유틸 사용하시면 됩니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

엇 그렇군요 반영하겠습니당

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
frontend/src/components/Input/MultiInput.tsx (1)

47-50: Consider using clsx more effectively.

The current implementation could be simplified using clsx's object syntax.

-<div className={clsx(
-  inputFieldsContainerStyle,
-  interactableBorderStyle({ isValid }))}
->
+<div className={clsx(inputFieldsContainerStyle, {
+  [interactableBorderStyle({ isValid })]: borderPlacement === 'container'
+})}
+>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9c14e6 and 5bafca1.

📒 Files selected for processing (2)
  • frontend/src/components/Input/Core/InputField.tsx (3 hunks)
  • frontend/src/components/Input/MultiInput.tsx (3 hunks)
🧰 Additional context used
📓 Learnings (3)
📓 Common learnings
Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/components/Input/MultiInput.tsx:19-22
Timestamp: 2025-02-06T02:51:01.268Z
Learning: In the Input component, the `borderPlacement` prop should be optional with a default value of 'inputField' to maintain backward compatibility and improve developer experience.
frontend/src/components/Input/Core/InputField.tsx (1)
Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/components/Input/MultiInput.tsx:19-22
Timestamp: 2025-02-06T02:51:01.268Z
Learning: In the Input component, the `borderPlacement` prop should be optional with a default value of 'inputField' to maintain backward compatibility and improve developer experience.
frontend/src/components/Input/MultiInput.tsx (1)
Learnt from: hamo-o
PR: softeer5th/Team4-enDolphin#100
File: frontend/src/components/Input/MultiInput.tsx:19-22
Timestamp: 2025-02-06T02:51:01.268Z
Learning: In the Input component, the `borderPlacement` prop should be optional with a default value of 'inputField' to maintain backward compatibility and improve developer experience.
🔇 Additional comments (6)
frontend/src/components/Input/Core/InputField.tsx (3)

4-10: LGTM! Import paths have been updated to use absolute paths.

The changes improve maintainability by using absolute imports and add necessary styling utilities.


21-21: LGTM! Context usage is aligned with the new feature.

The borderPlacement is correctly destructured from the context alongside existing properties.


30-35: LGTM! Conditional styling is implemented correctly.

The use of clsx for conditional class names and the border style application based on borderPlacement is well implemented.

frontend/src/components/Input/MultiInput.tsx (3)

4-17: LGTM! Import organization and utility usage are well structured.

The changes improve code organization by:

  • Using the clsx utility for class name management
  • Importing core components from their new locations
  • Adding necessary style imports

20-23: LGTM! Props interface correctly defines optional borderPlacement.

The borderPlacement prop is correctly defined as optional, aligning with the retrieved learning about maintaining backward compatibility.


25-35: LGTM! Default value implementation maintains backward compatibility.

The default value of 'inputField' for borderPlacement ensures backward compatibility as suggested in the retrieved learning.

@dioo1461 dioo1461 merged commit 289a47d into dev Feb 6, 2025
1 check was pending
@dioo1461 dioo1461 deleted the feature/fe/input-component branch February 6, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ FE Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants