From e7e8de7fcdd30246027973d99f535f38d4212c60 Mon Sep 17 00:00:00 2001 From: Naoki_Ito <117070296+naoki-00-ito@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:33:44 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20React=20component=20=E3=82=B5=E3=83=96?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E6=99=82?= =?UTF-8?q?=E3=81=AEpath=E5=A4=89=E6=9B=B4=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/WorksSlide/index.tsx | 8 ++++---- src/pages/works.astro | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c9c5739..30b9d78 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "preinstall": "npx only-allow pnpm", "dev": "astro dev", + "dev:gh-pages": "TARGET=gh-pages astro dev", "start": "astro dev", "build": "astro check && astro build", "build:gh-pages": "astro check && TARGET=gh-pages astro build", diff --git a/src/components/WorksSlide/index.tsx b/src/components/WorksSlide/index.tsx index 393334a..089ae5f 100644 --- a/src/components/WorksSlide/index.tsx +++ b/src/components/WorksSlide/index.tsx @@ -3,15 +3,15 @@ import React, { useState, useRef } from 'react'; import TitleVertical from '../TitleVertical'; import scrollSlide from './scrollSlide'; import filters from '@/data/filters'; -import updatePath from '@/libs/updatePath'; type Props = { title: string; titleEn: string; items: Work[]; + path: string; }; -const WorksSlide = ({ title, titleEn, items }: Props) => { +const WorksSlide = ({ title, titleEn, items, path }: Props) => { const [selectedOption, setSelectedOption] = useState('ALL'); const [open, setOpen] = useState(false); const wrapper = useRef(null); @@ -55,13 +55,13 @@ const WorksSlide = ({ title, titleEn, items }: Props) => { } >
{item.title} diff --git a/src/pages/works.astro b/src/pages/works.astro index f662ab6..b010bbb 100644 --- a/src/pages/works.astro +++ b/src/pages/works.astro @@ -3,6 +3,7 @@ import Layout from '@/layouts/Layout.astro'; import WorksSlide from '@/components/WorksSlide'; import works from '@/data/works'; import Stalker from '@/components/Stalker'; +const path = import.meta.env.TARGET === 'gh-pages' ? '/st-portfolio' : ''; const title = '制作実績'; const titleEn = 'WORKS'; --- @@ -12,6 +13,7 @@ const titleEn = 'WORKS'; title={title} titleEn={titleEn} items={works} + path={path} client:only="react" />