Skip to content

Commit

Permalink
feat: Add mixi2 link
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone committed Dec 17, 2024
1 parent 2cb837d commit 2dcf983
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 77 deletions.
2 changes: 1 addition & 1 deletion content
1 change: 1 addition & 0 deletions content-sample/icons/Mixi2Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@mui/material": "5.16.9",
"@mui/utils": "6.1.10",
"@sentry/browser": "8.42.0",
"bicstone": "1.5.0",
"bicstone": "1.6.1",
"date-fns": "4.1.0",
"date-fns-tz": "3.2.0",
"fuse.js": "7.0.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/icons/IconBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import styled from "@emotion/styled";

export const IconBase = styled("div")(({ theme }) => ({
display: "inline-block",
width: theme.spacing(4),
height: theme.spacing(4),
width: theme.spacing(3),
height: theme.spacing(3),
}));
9 changes: 9 additions & 0 deletions src/components/icons/Mixi2Icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import styled from "@emotion/styled";

import { IconBase } from "./IconBase";

import icon from "@/content/icons/Mixi2Icon.svg";

export const Mixi2Icon = styled(IconBase)(({ theme }) => ({
content: `url(${icon})`,
}));
98 changes: 33 additions & 65 deletions src/features/Bio/BioCardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { InstagramIcon } from "@/components/icons/InstagramIcon";
import { LaprasIcon } from "@/components/icons/LaprasIcon";
import { LinkedInIcon } from "@/components/icons/LinkedInIcon";
import { MisskeyIcon } from "@/components/icons/MisskeyIcon";
import { Mixi2Icon } from "@/components/icons/Mixi2Icon";
import { MstdnIcon } from "@/components/icons/MstdnIcon";
import { NoteIcon } from "@/components/icons/NoteIcon";
import { NpmIcon } from "@/components/icons/NpmIcon";
Expand All @@ -37,15 +38,13 @@ export const BioCardList = (): React.JSX.Element => {
"facebook",
"linkedin",
"youtrust",
"mixi2",
"zenn",
"note",
"speakerdeck",
] as const satisfies LinkKeys[];

const moreLinkKeys = [
"note",
"qiita",
"github",
"npm",
"qiita",
"findy",
"forkwell",
"lapras",
Expand All @@ -66,6 +65,7 @@ export const BioCardList = (): React.JSX.Element => {
lapras: <LaprasIcon aria-hidden="true" />,
linkedin: <LinkedInIcon aria-hidden="true" />,
misskey: <MisskeyIcon aria-hidden="true" />,
mixi2: <Mixi2Icon aria-hidden="true" />,
mstdn: <MstdnIcon aria-hidden="true" />,
note: <NoteIcon aria-hidden="true" />,
npm: <NpmIcon area-hidden="true" />,
Expand All @@ -76,23 +76,25 @@ export const BioCardList = (): React.JSX.Element => {
x: <XIcon aria-hidden="true" />,
youtrust: <YoutrustIcon aria-hidden="true" />,
zenn: <ZennIcon aria-hidden="true" />,
} as const satisfies Record<
(typeof linkKeys)[number] | (typeof moreLinkKeys)[number],
React.JSX.Element
>;
} as const satisfies Record<(typeof linkKeys)[number], React.JSX.Element>;

return (
<div
css={(theme) => ({
display: "grid",
gap: theme.spacing(3),
gridTemplateColumns: "repeat(4, 1fr)",
gridTemplateColumns: "repeat(5, 1fr)",
maxHeight: expend ? "none" : theme.spacing(76),
overflow: "hidden",
paddingBottom: theme.spacing(10),
position: "relative",
width: "100%",
[theme.breakpoints.down("md")]: {
gridTemplateColumns: "repeat(3, 1fr)",
maxHeight: expend ? "none" : theme.spacing(106),
},
[theme.breakpoints.down("sm")]: {
gridTemplateColumns: "repeat(2, 1fr)",
maxHeight: expend ? "none" : theme.spacing(88),
},
})}
>
Expand All @@ -111,60 +113,26 @@ export const BioCardList = (): React.JSX.Element => {
/>
);
})}
<div
css={(theme) => ({
display: "grid",
gap: theme.spacing(3),
gridColumn: "1 / -1",
gridTemplateColumns: "repeat(4, 1fr)",
maxHeight: expend ? "none" : theme.spacing(10),
overflow: "hidden",
paddingBottom: theme.spacing(10),
position: "relative",
width: "100%",
[theme.breakpoints.down("md")]: {
gridTemplateColumns: "repeat(3, 1fr)",
},
[theme.breakpoints.down("sm")]: {
gridTemplateColumns: "repeat(2, 1fr)",
},
})}
>
{moreLinkKeys.map((linkKey) => {
const link = bicstone.links[linkKey];
return (
<BioSocialLinkCard
key={link.siteName}
avatar={avatarMap[linkKey]}
title={link.siteName}
subTitle={`@${link.screenName}`}
actionTitle={link.siteName}
url={link.url}
variant="elevation"
/>
);
})}
{!expend && (
<div
css={(theme) => ({
alignItems: "end",
background:
"linear-gradient(0, #fff, #fff 20%, hsla(0, 0%, 100%, 0));",
bottom: 0,
display: "flex",
height: theme.spacing(10),
justifyContent: "center",
left: 0,
position: "absolute",
width: "100%",
})}
>
<Button variant="outlined" onClick={handleExpendButtonClick}>
もっと見る
</Button>
</div>
)}
</div>
{!expend && (
<div
css={(theme) => ({
alignItems: "end",
background:
"linear-gradient(0, #fff, #fff 20%, hsla(0, 0%, 100%, 0));",
bottom: 0,
display: "flex",
height: theme.spacing(11),
justifyContent: "center",
left: 0,
position: "absolute",
width: "100%",
})}
>
<Button variant="outlined" onClick={handleExpendButtonClick}>
もっと見る
</Button>
</div>
)}
</div>
);
};
31 changes: 28 additions & 3 deletions src/features/Bio/BioSocialLinkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,36 @@ export const BioSocialLinkCard = ({
title="外部リンクのため、別ウインドウで開きます"
>
{avatar}
<div>
<Typography variant="body1" component="h2" fontWeight="bold">
<div
css={{
overflow: "hidden",
width: "100%",
}}
>
<Typography
variant="body2"
component="h2"
fontWeight="bold"
css={(theme) => ({
[theme.breakpoints.down("sm")]: {
fontSize: theme.typography.caption.fontSize,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
},
})}
>
{title}
</Typography>
<Typography variant="caption" color="text.secondary">
<Typography
variant="caption"
color="text.secondary"
css={(theme) => ({
[theme.breakpoints.down("sm")]: {
display: "none",
},
})}
>
{subTitle}
</Typography>
</div>
Expand Down

0 comments on commit 2dcf983

Please sign in to comment.