Skip to content

Commit

Permalink
2周年イラストをトップ絵に (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Aug 15, 2023
1 parent ce7331d commit 850884c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/dormitoryTopIllustContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { graphql, useStaticQuery } from "gatsby"
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"
import React, { useEffect, useState } from "react"
import React, { useState } from "react"
import "../components/layout.scss"

export default () => {
Expand Down Expand Up @@ -28,12 +28,12 @@ export default () => {
const [topIllust, setTopIllust] = useState<IGatsbyImageData>(
topIllusts[topIllusts.length - 1]
)
useEffect(() => {
// トップイラストを後ろ2枚からランダムに選択
// FIXME: なぜかリロードしても変わらない
const randomIndex = topIllusts.length - 1 - Math.floor(Math.random() * 2)
setTopIllust(topIllusts[randomIndex])
}, [])
// useEffect(() => {
// // トップイラストを後ろ2枚からランダムに選択
// // FIXME: なぜかリロードしても変わらない
// const randomIndex = topIllusts.length - 1 - Math.floor(Math.random() * 2)
// setTopIllust(topIllusts[randomIndex])
// }, [])

return (
<>
Expand Down

0 comments on commit 850884c

Please sign in to comment.