Skip to content

Commit

Permalink
Update: Revving 適用
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi committed Sep 17, 2022
1 parent ad741be commit 4aa386b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion components/base/image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const Image = ({ src, ...props }) => {
const rootRelativePath = useRouter()?.pathname.replace(/[^\/]+$/, "");
return (
<NextImage
src={(src.startsWith("/") ? "" : rootRelativePath) + src}
src={
typeof src === "string"
? (src.startsWith("/") ? "" : rootRelativePath) + src
: src
}
{...props}
loader={process.env.isProduct ? null : customLoader}
/>
Expand Down
3 changes: 2 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"@/next-seo.config": ["next-seo.config"],
"@/hooks/*": ["hooks/*"],
"@/components/*": ["components/*"],
"@/pages/*": ["pages/*"]
"@/pages/*": ["pages/*"],
"@/public/*": ["public/*"]
}
}
}
10 changes: 7 additions & 3 deletions pages/events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import Link from "@/components/base/link";
import Image from "@/components/base/image";
// styles
import styles from "./events.module.scss";
// images
import hallImage from "@/public/events/hall.png";
import arenaImage from "@/public/events/arena.png";
import fieldImage from "@/public/events/field.png";

const Events = () => {
return (
Expand All @@ -18,7 +22,7 @@ const Events = () => {
<Link href="/map/jhs-f2">講堂</Link>
</h2>
<Image
src="/events/hall.png"
src={hallImage}
alt="メロンフラッペ、ディベート、ジャグリング、劇団こぎと"
layout="responsive"
height={510}
Expand All @@ -30,7 +34,7 @@ const Events = () => {
<Link href="/map/arena">アリーナ</Link>
</h2>
<Image
src="/events/arena.png"
src={arenaImage}
alt="豪華イベント勢揃い!"
layout="responsive"
height={510}
Expand All @@ -42,7 +46,7 @@ const Events = () => {
<Link href="/map/field">グラウンド</Link>
</h2>
<Image
src="/events/field.png"
src={fieldImage}
alt="野球、サッカー、地学部ロケット、アメフト"
layout="responsive"
height={510}
Expand Down
4 changes: 3 additions & 1 deletion pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import Countdown from "@/components/countdown";
import PromotionVideos from "@/components/promotion-videos";
// styles
import styles from "./index.module.scss";
// images
import souichiroImage from "@/public/souichiro.jpeg";

const Top = () => {
return (
<div className={styles.top}>
<div>
<Image
src="/souichiro.jpeg"
src={souichiroImage}
alt=""
layout="fill"
className={styles["top-image"]}
Expand Down

0 comments on commit 4aa386b

Please sign in to comment.