|
1 | 1 | 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"; |
3 | 3 | import { ErrorBoundary, Suspense } from "@suspensive/react"; |
4 | 4 | import { Link } from "react-router-dom"; |
5 | 5 |
|
@@ -67,21 +67,30 @@ export const Sponsor: React.FC = ErrorBoundary.with( |
67 | 67 | const flatSiteMap = Common.Utils.buildFlatSiteMap(siteMapNode); |
68 | 68 | const flatSiteMapObj = flatSiteMap.reduce((a, i) => ({ ...a, [i.id]: i }), {} as Record<string, { route: string }>); |
69 | 69 |
|
| 70 | + const textProps: TypographyProps = { |
| 71 | + textAlign: "center", |
| 72 | + fontWeight: "bold", |
| 73 | + }; |
| 74 | + |
70 | 75 | return ( |
71 | 76 | <SponsorContainer> |
72 | 77 | <SponsorSection aria-label="후원사 섹션"> |
73 | | - <Typography variant="h4" textAlign="center" children="후원사 목록" fontWeight="bold" area-level={4} /> |
| 78 | + <Typography variant="h4" {...textProps} children="후원사 목록" area-level={4} /> |
74 | 79 | <Stack spacing={4} sx={{ my: 4 }} aria-label="후원사 목록 그리드"> |
75 | 80 | {sponsorData |
76 | 81 | .filter((t) => t.sponsors.length) |
77 | 82 | .map((sponsorTier, i, a) => ( |
78 | 83 | <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} /> |
80 | 85 | <SponsorStack> |
81 | 86 | {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" }} />; |
82 | 89 | const sponsorImg = ( |
83 | 90 | <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> |
85 | 94 | </LogoImageContainer> |
86 | 95 | ); |
87 | 96 | return sponsor.sitemap_id ? <Link to={flatSiteMapObj[sponsor.sitemap_id].route} children={sponsorImg} /> : sponsorImg; |
|
0 commit comments