Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
Philippe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Philippe
Commits
ce5718b2
Commit
ce5718b2
authored
Jun 16, 2021
by
PLN
Committed by
PLN (Algolia)
Jun 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: NavLinks, adapt quality on home
parent
ef5c3390
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
37 deletions
+57
-37
NavLinks.js
components/NavLinks.js
+51
-0
[id].js
pages/photos/[id].js
+6
-37
No files found.
components/NavLinks.js
0 → 100644
View file @
ce5718b2
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
;
pages/photos/[id].js
View file @
ce5718b2
...
...
@@ -13,6 +13,7 @@ import Image from "next/image";
import
Head
from
"next/head"
;
import
BackHome
from
"../../components/BackHome"
;
// import { getPlaiceholder } from "plaiceholder";
import
NavLinks
from
"../../components/NavLinks"
;
export
async
function
getStaticPaths
()
{
const
photos
=
await
getAllPhotos
();
...
...
@@ -69,10 +70,10 @@ export default function Photos({ photo, placeholder }) {
<
/Head
>
<
BackHome
/>
<
Divider
my
=
"1rem"
/>
<
NavLinks
prev
=
{
pic
.
prev
}
next
=
{
pic
.
next
}
/
>
<
Center
>
<
a
href
=
{
photo
.
path
}
>
<
Link
href
=
{
photo
.
path
}
>
<
Image
src
=
{
photo
.
path
}
width
=
{
photo
.
dimensions
.
width
||
480
}
...
...
@@ -84,43 +85,11 @@ export default function Photos({ photo, placeholder }) {
blurDataURL
=
{
placeholder
}
loading
=
"eager"
/>
<
/a
>
<
/Center
>
<
Divider
my
=
"1rem"
/>
<
Center
>
<
Box
p
=
"6"
>
<
Link
href
=
{
"/photos/"
+
photo
.
prev
}
>
<
Button
as
=
"a"
borderRadius
=
"full"
colorScheme
=
"gray"
fontSize
=
{[
"sm"
,
"md"
,
"lg"
,
"lg"
]}
size
=
{[
"sm"
,
"md"
,
"lg"
,
"lg"
]}
cursor
=
"pointer"
m
=
"15px"
>
⟸
Pr
é
c
é
dente
<
/Button
>
<
/Link
>
<
Link
href
=
{
"/photos/"
+
photo
.
prev
}
>
<
Button
as
=
"a"
borderRadius
=
"full"
colorScheme
=
"gray"
fontSize
=
{[
"sm"
,
"md"
,
"lg"
,
"lg"
]}
size
=
{[
"sm"
,
"md"
,
"lg"
,
"lg"
]}
cursor
=
"pointer"
m
=
"15px"
>
<
p
m
=
"1"
>
{
photo
.
next
!=
1
?
"Suivante "
:
"Retour au début "
}
<
/p
>
<
p
>
⟹
<
/p
>
<
/Button
>
<
/Link
>
<
/Box
>
<
/Center
>
<
Divider
my
=
"1rem"
/>
<
NavLinks
prev
=
{
pic
.
prev
}
next
=
{
pic
.
next
}
/
>
<
/Box
>
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment