-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat] 주제설정 변경사항 구현, GradientAnimatedText ui 패키지로 이관 및 개선, Label 컴포넌트 옵션 추가 #127
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
14130e6
feat(packages/ui, apps/web): GradientAnimatedText를 ui 패키지로 이관 및 컴포넌트 개선
minseong0324 16026f6
fix(apps/web): 뱃지 제거
minseong0324 0c63d98
fix(packages/ui): disabled 색상 수정
minseong0324 ec575cc
fix(packages/ui): discription 옵션 추가
minseong0324 5ba6b30
fix(apps/web): label 옆 설명 추가
minseong0324 f153315
chore(packages/ui): motion props 상수화
minseong0324 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
apps/web/src/app/create/_components/GradientAnimatedTitle/GradientAnimatedTitle.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
packages/ui/src/components/GradientAnimatedText/GradientAnimatedText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { motion, HTMLMotionProps } from 'motion/react'; | ||
import * as styles from './GradientAnimatedText.css'; | ||
import { ReactNode, forwardRef } from 'react'; | ||
import { Slot } from '@radix-ui/react-slot'; | ||
|
||
export type GradientAnimatedTextProps = { | ||
children: ReactNode; | ||
asChild?: boolean; | ||
} & HTMLMotionProps<'h1'>; | ||
|
||
/** | ||
* 그라디언트 애니메이션이 적용된 텍스트 컴포넌트입니다. | ||
* | ||
* @example | ||
* // 기본 사용 (h1) | ||
* <GradientAnimatedText>제목</GradientAnimatedText> | ||
* | ||
* // 다른 태그로 사용 | ||
* <GradientAnimatedText asChild> | ||
* <Text.P>제목</Text.P> | ||
* </GradientAnimatedText> | ||
* | ||
*/ | ||
export const GradientAnimatedText = forwardRef< | ||
HTMLHeadingElement, | ||
GradientAnimatedTextProps | ||
>(({ children, asChild, className = '', ...props }, ref) => { | ||
if (asChild) { | ||
return ( | ||
<Slot ref={ref}> | ||
<motion.div | ||
className={`${styles.gradientTitleStyle} ${className}`} | ||
initial={{ | ||
y: '35vh', | ||
scale: 2, | ||
x: '-50%', | ||
left: '50%', | ||
position: 'absolute', | ||
}} | ||
animate={{ | ||
y: 0, | ||
scale: 1, | ||
x: 0, | ||
left: 'auto', | ||
position: 'relative', | ||
}} | ||
transition={{ | ||
type: 'spring', | ||
duration: 0.6, | ||
bounce: 0.22, | ||
}} | ||
{...props} | ||
> | ||
{children} | ||
</motion.div> | ||
</Slot> | ||
); | ||
} | ||
|
||
return ( | ||
<motion.h1 | ||
ref={ref} | ||
className={`${styles.gradientTitleStyle} ${className}`} | ||
initial={{ | ||
y: '35vh', | ||
scale: 2, | ||
x: '-50%', | ||
left: '50%', | ||
position: 'absolute', | ||
}} | ||
animate={{ | ||
y: 0, | ||
scale: 1, | ||
x: 0, | ||
left: 'auto', | ||
position: 'relative', | ||
}} | ||
transition={{ | ||
type: 'spring', | ||
duration: 0.6, | ||
bounce: 0.22, | ||
}} | ||
{...props} | ||
> | ||
{children} | ||
</motion.h1> | ||
); | ||
}); | ||
|
||
GradientAnimatedText.displayName = 'GradientAnimatedText'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { GradientAnimatedText } from './GradientAnimatedText'; | ||
export type { GradientAnimatedTextProps } from './GradientAnimatedText'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
애니메이션 코드 중복을 제거해주세요.
motion 설정이
Slot
과h1
렌더링 경로에서 중복되어 있습니다.다음과 같이 리팩토링하는 것을 추천드립니다:
📝 Committable suggestion