-
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.
feat: installs prismic and sets it offline its post structure
- Loading branch information
1 parent
1b7b13b
commit 201634e
Showing
27 changed files
with
8,756 additions
and
4,240 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
.slicemachine/assets/customtypes/my-custom-post/mocks.json
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,35 @@ | ||
{ | ||
"id": "3ce964e0-2ab1-4397-a511-6878526957dd", | ||
"uid": "explicabo-sunt-porro", | ||
"type": "my-custom-post", | ||
"data": { | ||
"title": [ | ||
{ | ||
"type": "heading1", | ||
"text": "Synergize synergistic web-readiness", | ||
"spans": [] | ||
} | ||
], | ||
"content": [ | ||
{ | ||
"type": "heading1", | ||
"text": "Matrix cutting-edge paradigms", | ||
"spans": [] | ||
}, | ||
{ | ||
"type": "paragraph", | ||
"text": "Amet excepteur mollit officia est id nostrud fugiat incididunt irure laboris ipsum.", | ||
"spans": [] | ||
} | ||
], | ||
"image": { | ||
"dimensions": { | ||
"width": 900, | ||
"height": 500 | ||
}, | ||
"alt": "Placeholder image", | ||
"copyright": null, | ||
"url": "https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?w=900&h=500&fit=crop" | ||
} | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"slices": { | ||
"components": {} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"_cts": { | ||
"my-custom-post": { | ||
"title": { | ||
"config": { | ||
"patternType": "HEADING", | ||
"blocks": 1 | ||
} | ||
}, | ||
"content": { | ||
"config": { | ||
"patternType": "STORY", | ||
"blocks": 1 | ||
} | ||
} | ||
} | ||
} | ||
} |
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,43 @@ | ||
{ | ||
"id": "my-custom-post", | ||
"label": "posts", | ||
"repeatable": true, | ||
"status": true, | ||
"json": { | ||
"Main": { | ||
"uid": { | ||
"type": "UID", | ||
"config": { | ||
"label": "Uid", | ||
"placeholder": "" | ||
} | ||
}, | ||
"title": { | ||
"type": "StructuredText", | ||
"config": { | ||
"label": "Title", | ||
"placeholder": "", | ||
"allowTargetBlank": true, | ||
"single": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl" | ||
} | ||
}, | ||
"content": { | ||
"type": "StructuredText", | ||
"config": { | ||
"label": "", | ||
"placeholder": "", | ||
"allowTargetBlank": true, | ||
"multi": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl" | ||
} | ||
}, | ||
"image": { | ||
"type": "Image", | ||
"config": { | ||
"label": "Featured Image", | ||
"constraint": {}, | ||
"thumbnails": [] | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"_latest": "0.3.7", | ||
"apiEndpoint": "https://post-server.prismic.io/api/v2", | ||
"libraries": [ | ||
"@/slices" | ||
] | ||
} |
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,22 +1,22 @@ | ||
import { SignInButton } from "../SignInButton"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export function Header() { | ||
return ( | ||
<header className={styles.headerContainer}> | ||
<div className={styles.headerContent}> | ||
<a href="/"> | ||
<img src="/images/logo.svg" alt="ig.news" /> | ||
</a> | ||
|
||
<nav> | ||
<a href="/" className={styles.active}> | ||
Home | ||
</a> | ||
<a href="/posts">Posts</a> | ||
</nav> | ||
<SignInButton /> | ||
</div> | ||
</header> | ||
); | ||
} | ||
import { SignInButton } from "../SignInButton"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export function Header() { | ||
return ( | ||
<header className={styles.headerContainer}> | ||
<div className={styles.headerContent}> | ||
<a href="/"> | ||
<img src="/images/logo.svg" alt="ig.news" /> | ||
</a> | ||
|
||
<nav> | ||
<a href="/" className={styles.active}> | ||
Home | ||
</a> | ||
<a href="/posts">Posts</a> | ||
</nav> | ||
<SignInButton /> | ||
</div> | ||
</header> | ||
); | ||
} |
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,57 +1,57 @@ | ||
.headerContainer { | ||
height: 5rem; | ||
border-bottom: 1px solid var(--gray-800); | ||
} | ||
|
||
.headerContent { | ||
max-width: 1120px; | ||
height: 5rem; | ||
margin: 0 auto; | ||
padding: 0 2rem; | ||
|
||
display: flex; | ||
align-items: center; | ||
|
||
nav { | ||
margin-left: 5rem; | ||
height: 5rem; | ||
|
||
a { | ||
display: inline-block; | ||
position: relative; | ||
padding: 0 0.5rem; | ||
height: 5rem; | ||
line-height: 5rem; | ||
color: var(--gray-300); | ||
|
||
& + a { | ||
margin-left: 2rem; | ||
} | ||
|
||
transition: color 0.2s; | ||
&:hover { | ||
color: var(--white); | ||
} | ||
|
||
&.active { | ||
color: var(--white); | ||
font-weight: bold; | ||
} | ||
|
||
&.active::after { | ||
content: ""; | ||
height: 3px; | ||
border-radius: 3px 3px 0 0; | ||
width: 100%; | ||
position: absolute; | ||
bottom: 1px; | ||
left: 0; | ||
background: var(--yellow-500); | ||
} | ||
} | ||
} | ||
|
||
button { | ||
margin-left: auto; | ||
} | ||
} | ||
.headerContainer { | ||
height: 5rem; | ||
border-bottom: 1px solid var(--gray-800); | ||
} | ||
|
||
.headerContent { | ||
max-width: 1120px; | ||
height: 5rem; | ||
margin: 0 auto; | ||
padding: 0 2rem; | ||
|
||
display: flex; | ||
align-items: center; | ||
|
||
nav { | ||
margin-left: 5rem; | ||
height: 5rem; | ||
|
||
a { | ||
display: inline-block; | ||
position: relative; | ||
padding: 0 0.5rem; | ||
height: 5rem; | ||
line-height: 5rem; | ||
color: var(--gray-300); | ||
|
||
& + a { | ||
margin-left: 2rem; | ||
} | ||
|
||
transition: color 0.2s; | ||
&:hover { | ||
color: var(--white); | ||
} | ||
|
||
&.active { | ||
color: var(--white); | ||
font-weight: bold; | ||
} | ||
|
||
&.active::after { | ||
content: ""; | ||
height: 3px; | ||
border-radius: 3px 3px 0 0; | ||
width: 100%; | ||
position: absolute; | ||
bottom: 1px; | ||
left: 0; | ||
background: var(--yellow-500); | ||
} | ||
} | ||
} | ||
|
||
button { | ||
margin-left: auto; | ||
} | ||
} |
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,31 +1,31 @@ | ||
import { FaGithub } from "react-icons/fa"; | ||
import { FiX } from "react-icons/fi"; | ||
import { SessionProvider, signIn, signOut, useSession } from "next-auth/react"; | ||
|
||
import styles from "./styles.module.scss"; | ||
|
||
export function SignInButton() { | ||
const { data: session } = useSession(); | ||
|
||
console.log("session: ", session); | ||
return session ? ( | ||
<button | ||
type="button" | ||
className={styles.signInButton} | ||
onClick={() => signOut()} | ||
> | ||
<FaGithub color="#04d361" /> | ||
{session.user.name} | ||
<FiX color="#737388" className={styles.closeIcon} /> | ||
</button> | ||
) : ( | ||
<button | ||
type="button" | ||
className={styles.signInButton} | ||
onClick={() => signIn("github")} | ||
> | ||
<FaGithub color="#eba417" /> | ||
Sign In with Github | ||
</button> | ||
); | ||
} | ||
import { FaGithub } from "react-icons/fa"; | ||
import { FiX } from "react-icons/fi"; | ||
import { SessionProvider, signIn, signOut, useSession } from "next-auth/react"; | ||
|
||
import styles from "./styles.module.scss"; | ||
|
||
export function SignInButton() { | ||
const { data: session } = useSession(); | ||
|
||
console.log("session: ", session); | ||
return session ? ( | ||
<button | ||
type="button" | ||
className={styles.signInButton} | ||
onClick={() => signOut()} | ||
> | ||
<FaGithub color="#04d361" /> | ||
{session.user.name} | ||
<FiX color="#737388" className={styles.closeIcon} /> | ||
</button> | ||
) : ( | ||
<button | ||
type="button" | ||
className={styles.signInButton} | ||
onClick={() => signIn("github")} | ||
> | ||
<FaGithub color="#eba417" /> | ||
Sign In with Github | ||
</button> | ||
); | ||
} |
Oops, something went wrong.