Unverified Commit 34161d9e by PLN

feat: NavLinks, adapt quality on home

parent 0c166881
...@@ -5,3 +5,5 @@ node_modules/ ...@@ -5,3 +5,5 @@ node_modules/
# TODO: Video Content # TODO: Video Content
*.MOV *.MOV
*.mp4 *.mp4
.vercel
import Image from "next/image";
import {
Box,
Divider,
Center,
Text,
Flex,
Spacer,
Button,
} from "@chakra-ui/react";
import Head from "next/head";
import Link from "next/link";
function NavLinks({ prev, next }) {
let prevText = next == 2 ? "Dernière" : "Précédente";
let nextText = next != 1 ? "Suivante" : "Retour au début";
return (
<Center p="6" justify="space-between">
<a href={"/photos/" + prev}>
<Button
as="a"
borderRadius="full"
colorScheme="gray"
fontSize="xl"
size="lg"
mx={2}
cursor="pointer"
>
<Text mr={2}></Text>
<Text>{prevText}</Text>
</Button>
</a>
<a href={"/photos/" + next}>
<Button
as="a"
borderRadius="full"
colorScheme="gray"
fontSize="xl"
size="lg"
mx={2}
cursor="pointer"
>
<Text>{nextText}</Text>
<Text ml={2}></Text>
</Button>
</a>
</Center>
);
}
export default NavLinks;
...@@ -65,7 +65,7 @@ export default function Home({ data }) { ...@@ -65,7 +65,7 @@ export default function Home({ data }) {
objectFit="cover" objectFit="cover"
placeholder="img/Diaporama/f5b1d804-3860-4073-b280-69e54985c66f.jpg" placeholder="img/Diaporama/f5b1d804-3860-4073-b280-69e54985c66f.jpg"
color="gray.700" color="gray.700"
quality={100} quality={50}
/> />
</a> </a>
</WrapItem> </WrapItem>
......
...@@ -12,6 +12,7 @@ import Image from "next/image"; ...@@ -12,6 +12,7 @@ import Image from "next/image";
import Head from "next/head"; import Head from "next/head";
import Link from "next/link"; import Link from "next/link";
import BackHome from "../../components/BackHome"; import BackHome from "../../components/BackHome";
import NavLinks from "../../components/NavLinks";
import { InfoIcon, AtSignIcon } from "@chakra-ui/icons"; import { InfoIcon, AtSignIcon } from "@chakra-ui/icons";
import { Img } from "@chakra-ui/react"; import { Img } from "@chakra-ui/react";
...@@ -60,7 +61,7 @@ export default function Photos({ pic }) { ...@@ -60,7 +61,7 @@ export default function Photos({ pic }) {
</Head> </Head>
<BackHome /> <BackHome />
<Divider my="1rem" /> <NavLinks prev={pic.prev} next={pic.next} />
<Center> <Center>
<a href={pic.path}> <a href={pic.path}>
...@@ -75,39 +76,7 @@ export default function Photos({ pic }) { ...@@ -75,39 +76,7 @@ export default function Photos({ pic }) {
/> />
</a> </a>
</Center> </Center>
<Divider my="1rem" /> <NavLinks prev={pic.prev} next={pic.next} />
<Center>
<Box p="6">
<a href={"/photos/" + pic.prev}>
<Button
as="a"
borderRadius="full"
colorScheme="gray"
fontSize="xl"
size="lg"
cursor="pointer"
m="15px"
>
Précédente
</Button>
</a>
<a href={"/photos/" + pic.next}>
<Button
as="a"
borderRadius="full"
colorScheme="gray"
fontSize="xl"
size="lg"
cursor="pointer"
m="15px"
>
<p m="1">{pic.next != 1 ? "Suivante " : "Retour au début "}</p>
<p></p>
</Button>
</a>
</Box>
</Center>
</Box> </Box>
); );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment