Skip to content
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

Icon 컴포넌트 #40

Merged
merged 3 commits into from
Feb 4, 2025
Merged

Icon 컴포넌트 #40

merged 3 commits into from
Feb 4, 2025

Conversation

DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Feb 3, 2025

Icon 컴포넌트를 구현하였습니다. 우선은 20개의 아이콘으로 시작하고자 합니다.

Shot 2025-02-02 at 21 01 27

Shot 2025-02-02 at 21 02 42

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple Icons 코드 저장소의 icons 폴더 안에 svg 파일을 그대로 복사해왔습니다.

https://github.com/simple-icons/simple-icons/blob/develop/icons/discord.svg

Comment on lines +19 to +23
import Discord from "../assets/Discord.svg?react";
import GitHub from "../assets/GitHub.svg?react";
import LinkedIn from "../assets/LinkedIn.svg?react";
import Medium from "../assets/Medium.svg?react";
import YouTube from "../assets/YouTube.svg?react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vite의 svgr 플러그인을 사용해서 svg 파일을 React 컴포넌트로 불러왔습니다.


function createBrandIcon(Icon: FunctionComponent<SVGProps<SVGSVGElement>>) {
return (args: ComponentProps<typeof Icon>) => (
<Icon {...args} fill="currentColor" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple 아이콘의 색을 CSS의 color 속성을 통해서 제어하려면 fill 속성을 currentColor로 설정해줘야 합니다.

@DaleSeo DaleSeo marked this pull request as ready for review February 3, 2025 02:11
@DaleSeo DaleSeo requested a review from a team as a code owner February 3, 2025 02:11
Copy link
Contributor

@nhistory nhistory left a comment

Choose a reason for hiding this comment

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

수고 많으셨습니다!

@DaleSeo DaleSeo merged commit fe0d235 into main Feb 4, 2025
7 checks passed
@DaleSeo DaleSeo deleted the 37 branch February 4, 2025 01:03
@DaleSeo DaleSeo linked an issue Feb 6, 2025 that may be closed by this pull request
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.

Icon Component
2 participants