Skip to content

Commit fdca5ea

Browse files
committed
feat: 후원사 로고에 tooltip 추가
1 parent 8413af6 commit fdca5ea

File tree

1 file changed

+13
-4
lines changed
  • apps/pyconkr/src/components/layout/Sponsor

1 file changed

+13
-4
lines changed

apps/pyconkr/src/components/layout/Sponsor/index.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as Common from "@frontend/common";
2-
import { CircularProgress, Divider, Stack, Typography, styled } from "@mui/material";
2+
import { CircularProgress, Divider, Stack, Tooltip, Typography, TypographyProps, styled } from "@mui/material";
33
import { ErrorBoundary, Suspense } from "@suspensive/react";
44
import { Link } from "react-router-dom";
55

@@ -67,21 +67,30 @@ export const Sponsor: React.FC = ErrorBoundary.with(
6767
const flatSiteMap = Common.Utils.buildFlatSiteMap(siteMapNode);
6868
const flatSiteMapObj = flatSiteMap.reduce((a, i) => ({ ...a, [i.id]: i }), {} as Record<string, { route: string }>);
6969

70+
const textProps: TypographyProps = {
71+
textAlign: "center",
72+
fontWeight: "bold",
73+
};
74+
7075
return (
7176
<SponsorContainer>
7277
<SponsorSection aria-label="후원사 섹션">
73-
<Typography variant="h4" textAlign="center" children="후원사 목록" fontWeight="bold" area-level={4} />
78+
<Typography variant="h4" {...textProps} children="후원사 목록" area-level={4} />
7479
<Stack spacing={4} sx={{ my: 4 }} aria-label="후원사 목록 그리드">
7580
{sponsorData
7681
.filter((t) => t.sponsors.length)
7782
.map((sponsorTier, i, a) => (
7883
<Stack spacing={6} key={sponsorTier.id} aria-label={`후원사 티어: ${sponsorTier.name}`}>
79-
<Typography variant="h5" key={sponsorTier.id} textAlign="center" fontWeight="bold" children={sponsorTier.name} area-level={5} />
84+
<Typography variant="h5" key={sponsorTier.id} {...textProps} children={sponsorTier.name} area-level={5} />
8085
<SponsorStack>
8186
{sponsorTier.sponsors.map((sponsor) => {
87+
const sponsorName = sponsor.name.replace(/\\n/g, "\n");
88+
const sponsorNameContent = <Typography variant="body1" {...textProps} children={sponsorName} sx={{ whiteSpace: "pre-wrap" }} />;
8289
const sponsorImg = (
8390
<LogoImageContainer>
84-
<LogoImage src={sponsor.logo} alt={sponsor.name} loading="lazy" />
91+
<Tooltip title={sponsorNameContent} arrow placement="top">
92+
<LogoImage src={sponsor.logo} alt={sponsor.name} loading="lazy" />
93+
</Tooltip>
8594
</LogoImageContainer>
8695
);
8796
return sponsor.sitemap_id ? <Link to={flatSiteMapObj[sponsor.sitemap_id].route} children={sponsorImg} /> : sponsorImg;

0 commit comments

Comments
 (0)