Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f9229d
commit b5bc10e
Showing
5 changed files
with
78 additions
and
37 deletions.
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
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,45 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { SocialLinks } from "./SocialLinks"; | ||
|
||
const metaData: Meta = { | ||
title: "SocialLinks", | ||
component: SocialLinks, | ||
}; | ||
|
||
export default metaData; | ||
|
||
export const All: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "All", | ||
}, | ||
}; | ||
|
||
export const Blog: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "Blog", | ||
}, | ||
}; | ||
|
||
export const Career: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "Career", | ||
}, | ||
}; | ||
|
||
export const SNS: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "SNS", | ||
}, | ||
}; | ||
|
||
export const Slide: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "Slide", | ||
}, | ||
}; | ||
|
||
export const Other: StoryObj<typeof SocialLinks> = { | ||
args: { | ||
type: "Other", | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,10 +1,26 @@ | ||
import { SocialLink } from "@/components/SocialLink"; | ||
import { SocialLinkData } from "@/utils/SocialLinkData"; | ||
import { SocialLinkData, type SocialTypes } from "@/utils/SocialLinkData"; | ||
|
||
export const SocialLinks = () => ( | ||
<> | ||
{SocialLinkData.filter((link) => link.isTop).map((link) => ( | ||
<SocialLink key={link.name} {...link} /> | ||
))} | ||
</> | ||
type ISocialLinksProps = { | ||
type: SocialTypes; | ||
topOnly: boolean; | ||
}; | ||
|
||
export const SocialLinks: React.FC<ISocialLinksProps> = ({ | ||
type, | ||
topOnly = false, | ||
}) => ( | ||
<div className="flex flex-wrap gap-1"> | ||
{SocialLinkData.filter((link) => { | ||
if (type === "All") return true; | ||
return link.type === type; | ||
}) | ||
.filter((link) => { | ||
if (topOnly) return link.isTop; | ||
return true; | ||
}) | ||
.map((link) => ( | ||
<SocialLink key={link.name} {...link} /> | ||
))} | ||
</div> | ||
); |
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