Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
fix: Fix time table not showing up in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
re-taro committed Oct 28, 2022
1 parent 7055665 commit b29c267
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ exports[`(components) molecules/time-table-row > take snap shot 1`] = `
EXBALLON
</p>
</li>
<div />
</ul>
</div>
`;
14 changes: 13 additions & 1 deletion src/components/molecules/time-table-row/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ const TimeTableRow: FC<TimeTableRowProperties> = ({ events, intervals, stage })
return dayjs(event.start_time).format("HH:mm") === "09:00" ? arr.push(event) : arr.push("gap", event);
}
if (i === a.length - 1) {
return dayjs(event.end_time).format("HH:mm") === "16:00" ? arr.push(event) : arr.push("gap", event);
/* eslint-disable no-nested-ternary */
return dayjs(a[i - 1].end_time).format("HH:mm") === dayjs(a[i].start_time).format("HH:mm") &&
dayjs(event.end_time).format("HH:mm") === "16:00"
? arr.push(event)
: dayjs(a[i - 1].end_time).format("HH:mm") === dayjs(a[i].start_time).format("HH:mm")
? arr.push(event, "gap")
: dayjs(event.end_time).format("HH:mm") === "16:00"
? arr.push("gap", event)
: arr.push("gap", event, "gap");
/* eslint-enable no-nested-ternary */
}
if (i === a.length - 1) {
return dayjs(event.end_time).format("HH:mm") === "16:00" ? arr.push(event) : arr.push(event, "gap");
}
return dayjs(a[i - 1].end_time).format("HH:mm") === dayjs(a[i].start_time).format("HH:mm")
? arr.push(event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`(components) organisms/access-section > take snap shot 1`] = `
loading="lazy"
referrerpolicy="no-referrer-when-downgrade"
role="document"
src="https://www.google.com/maps/embed/v1/view?key=&center=34.85167124241317%2C136.58132309784355&zoom=15"
src="https://www.google.com/maps/embed/v1/view?key=AIzaSyCk9WMilIT2wiBMqcn1YZQKJz5Lzy9ipQg&center=34.85167124241317%2C136.58132309784355&zoom=15"
title="鈴鹿工業高等専門学校の地図"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ exports[`(components) organisms/time-table > take snap shot 1`] = `
EXBALLON
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down Expand Up @@ -349,6 +350,7 @@ exports[`(components) organisms/time-table > take snap shot 1`] = `
出張Radio
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down Expand Up @@ -452,6 +454,7 @@ exports[`(components) organisms/time-table > take snap shot 1`] = `
あどばん
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ exports[`(components) templates/time-table > take snap shot 1`] = `
EXBALLON
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down Expand Up @@ -397,6 +398,7 @@ exports[`(components) templates/time-table > take snap shot 1`] = `
出張Radio
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down Expand Up @@ -500,6 +502,7 @@ exports[`(components) templates/time-table > take snap shot 1`] = `
あどばん
</p>
</li>
<div />
</ul>
</section>
<section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ exports[`(components) templates/top > take snap shot 1`] = `
loading="lazy"
referrerpolicy="no-referrer-when-downgrade"
role="document"
src="https://www.google.com/maps/embed/v1/view?key=&center=34.85167124241317%2C136.58132309784355&zoom=15"
src="https://www.google.com/maps/embed/v1/view?key=AIzaSyCk9WMilIT2wiBMqcn1YZQKJz5Lzy9ipQg&center=34.85167124241317%2C136.58132309784355&zoom=15"
title="鈴鹿工業高等専門学校の地図"
/>
</div>
Expand Down

0 comments on commit b29c267

Please sign in to comment.