-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from miku0129/develop
Add Gallery page
- Loading branch information
Showing
14 changed files
with
664 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import { Route, Routes } from "react-router-dom"; | ||
import { AnchorProvider } from "react-anchor-navigation"; | ||
|
||
import BasicLayout from "./route/basic-layout/basic-layout"; | ||
import Home from "./route/home/home.route"; | ||
|
||
function App() { | ||
return ( | ||
<AnchorProvider> | ||
<div>{/* TypeScriptの型解決のためのdiv */}</div> | ||
<Routes> | ||
<Route path="/" element={<BasicLayout />}> | ||
<Route index element={<Home />} /> | ||
</Route> | ||
</Routes> | ||
</AnchorProvider> | ||
); | ||
} | ||
|
||
export default App; | ||
import { Route, Routes } from "react-router-dom"; | ||
|
||
import BasicLayout from "./route/basic-layout/basic-layout"; | ||
import Home from "./route/home/home.route"; | ||
import Gallery from "./component/gallery/gallery.component"; | ||
|
||
function App() { | ||
return ( | ||
<Routes> | ||
<Route path="/" element={<BasicLayout />}> | ||
<Route index element={<Home />} /> | ||
<Route path="gallery" element={<Gallery />} /> | ||
</Route> | ||
</Routes> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.gallery{ | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
background-color: darkgoldenrod; | ||
width: 100vw; | ||
} | ||
|
||
.gallery-container{ | ||
margin-top: 120px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useState, useEffect } from "react"; | ||
import ImageGallery from "react-image-gallery"; | ||
import { getPhotosForMainVisual } from "../../utils/data.utils"; | ||
|
||
const MainVisual = () => { | ||
const [photos, setPhotos] = useState([]); | ||
|
||
useEffect(() => { | ||
const pulltrigger = async () => { | ||
const res = await getPhotosForMainVisual(); | ||
setPhotos(res); | ||
}; | ||
pulltrigger(); | ||
}, []); | ||
|
||
return ( | ||
<div className="image-gallery-container"> | ||
<ImageGallery | ||
items={photos} | ||
showNav={true} | ||
autoPlay={false} | ||
showFullscreenButton={false} | ||
useBrowserFullscreen={false} | ||
showPlayButton={false} | ||
showBullets={true} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MainVisual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { useLayoutEffect, useState } from "react"; | ||
|
||
export const useWindowSize = (): number[] => { | ||
const [size, setSize] = useState([0, 0]); | ||
useLayoutEffect(() => { | ||
const updateSize = (): void => { | ||
setSize([window.innerWidth, window.innerHeight]); | ||
}; | ||
|
||
window.addEventListener("resize", updateSize); | ||
updateSize(); | ||
|
||
return () => window.removeEventListener("resize", updateSize); | ||
}, []); | ||
return size; | ||
}; |