Commit ef5e2bc8 by PLN (Algolia)

fix: dimension math, credits link, [id] overflow

parent 67e3e4a8
...@@ -32,12 +32,8 @@ function MyApp({ Component, pageProps }) { ...@@ -32,12 +32,8 @@ function MyApp({ Component, pageProps }) {
> >
Paul-Louis Paul-Louis
</Link>{" "} </Link>{" "}
grace aux contenus partagés par les proches de Philippe. grace aux contenus partagés par les proches de Philippe - {" "}
</Text> <Link href="/credits">Crédits</Link>
<Text fontSize="sm" >
<Link href="/credits" >
Crédits
</Link>
</Text> </Text>
</Container> </Container>
</ChakraProvider> </ChakraProvider>
......
...@@ -21,12 +21,12 @@ export async function getStaticProps() { ...@@ -21,12 +21,12 @@ export async function getStaticProps() {
{ {
title: "Vercel", title: "Vercel",
text: "Pour l'hébergement de ces pages", text: "Pour l'hébergement de ces pages",
link: "vercel.com", link: "https://vercel.com",
}, },
{ {
title: "Next.JS", title: "Next.JS",
text: "Utilisé pour construire le site", text: "Utilisé pour construire le site",
link: "nextjs.org", link: "https://nextjs.org",
}, },
]; ];
return { return {
...@@ -67,6 +67,7 @@ export default function Credits({ credits }) { ...@@ -67,6 +67,7 @@ export default function Credits({ credits }) {
borderWidth="1px" borderWidth="1px"
borderRadius={"10px"} borderRadius={"10px"}
> >
<Link href={credit.link ? credit.link : "#"}>
<Text <Text
color="gray.700" color="gray.700"
fontWeight="semibold" fontWeight="semibold"
...@@ -75,6 +76,7 @@ export default function Credits({ credits }) { ...@@ -75,6 +76,7 @@ export default function Credits({ credits }) {
> >
{credit.title} {credit.title}
</Text> </Text>
</Link>
<br /> <br />
<Text color="gray.500" fontWeight="semibold" fontSize="sm" m="1rem"> <Text color="gray.500" fontWeight="semibold" fontSize="sm" m="1rem">
{credit.text} {credit.text}
......
...@@ -42,9 +42,9 @@ export async function getStaticProps({ params }) { ...@@ -42,9 +42,9 @@ export async function getStaticProps({ params }) {
// Fix dimensions if really big picture // Fix dimensions if really big picture
console.log("Pic dims: ", photo.dimensions.width, photo.dimensions.height); console.log("Pic dims: ", photo.dimensions.width, photo.dimensions.height);
if (photo.dimensions.widths > 1000 || photo.dimensions.heigth > 1000) { if (photo.dimensions.width > 1000 || photo.dimensions.heigth > 1000) {
photo.dimensions.width /= 2; photo.dimensions.width /= 2;
photo.dimensions.height = 2; photo.dimensions.height /= 2;
console.log("Resized: ", photo.dimensions.width, photo.dimensions.height); console.log("Resized: ", photo.dimensions.width, photo.dimensions.height);
} }
if (photo.dimensions.width > 1000 || photo.dimensions.heigth > 1000) { if (photo.dimensions.width > 1000 || photo.dimensions.heigth > 1000) {
...@@ -74,7 +74,6 @@ export default function Photos({ photo, placeholder }) { ...@@ -74,7 +74,6 @@ export default function Photos({ photo, placeholder }) {
<Center> <Center>
<Link href={photo.path}> <Link href={photo.path}>
<Box boxSize={["xs", "sm", "md", "lg"]}>
<Image <Image
src={photo.path} src={photo.path}
width={photo.dimensions.width || 480} width={photo.dimensions.width || 480}
...@@ -86,7 +85,6 @@ export default function Photos({ photo, placeholder }) { ...@@ -86,7 +85,6 @@ export default function Photos({ photo, placeholder }) {
blurDataURL={placeholder} blurDataURL={placeholder}
loading="eager" loading="eager"
/> />
</Box>
</Link> </Link>
</Center> </Center>
<NavLinks prev={photo.prev} next={photo.next} /> <NavLinks prev={photo.prev} next={photo.next} />
......
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