Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Jul 7, 2024
1 parent 1c86463 commit 254dd71
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/containers/LeagueStage/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ const MatchPair = styled.div`
}
`;

const MatchPairCenter = styled.div`
const MatchPairCenter = styled.span`
display: flex;
justify-content: center;
width: 20px;
`;

const ScheduleTeamWrapper = styled.div`
const ScheduleTeamWrapper = styled.span`
/* width: 300px; */
/* padding: 1px 3px; */
`;
Expand All @@ -70,7 +70,9 @@ interface Props {
function Schedule({ schedule }: Props) {
useLayoutEffect(() => {
if (schedule.some(md => md.length > 0)) {
const elements = document.querySelectorAll('.team-div');
const elements = document.getElementsByClassName(
ScheduleTeamWrapper.styledComponentId,
);
const offsetWidths = [...elements].map(
el => (el as HTMLElement).offsetWidth ?? 0,
);
Expand All @@ -89,13 +91,13 @@ function Schedule({ schedule }: Props) {
<MatchdayHeader>MATCHDAY {i + 1}</MatchdayHeader>
{md.map(m => (
<MatchPair>
<ScheduleTeamWrapper className="team-div">
<ScheduleTeamWrapper>
<ContentWithFlag $country={m[0].country}>
{m[0].name}
</ContentWithFlag>
</ScheduleTeamWrapper>
<MatchPairCenter>-</MatchPairCenter>
<ScheduleTeamWrapper className="team-div">
<ScheduleTeamWrapper>
<ContentWithFlag $country={m[1].country}>
{m[1].name}
</ContentWithFlag>
Expand Down

0 comments on commit 254dd71

Please sign in to comment.