-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade graphql-starter to Next.js v14
Issue #601
- Loading branch information
Showing
27 changed files
with
266 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
# See https://next-drupal.org/docs/environment-variables | ||
NEXT_PUBLIC_DRUPAL_BASE_URL=https://dev.next-drupal.org | ||
NEXT_IMAGE_DOMAIN=dev.next-drupal.org | ||
|
||
# Required | ||
NEXT_PUBLIC_DRUPAL_BASE_URL=https://site.example.com | ||
NEXT_IMAGE_DOMAIN=site.example.com | ||
|
||
# Authentication | ||
DRUPAL_CLIENT_ID= | ||
DRUPAL_CLIENT_SECRET= | ||
DRUPAL_CLIENT_ID=Retrieve this from /admin/config/services/consumer | ||
DRUPAL_CLIENT_SECRET=Retrieve this from /admin/config/services/consumer | ||
|
||
# Required for Preview Mode | ||
DRUPAL_PREVIEW_SECRET=Retrieve this from /admin/config/services/next | ||
|
||
# Required for On-demand Revalidation | ||
DRUPAL_REVALIDATE_SECRET=secret | ||
DRUPAL_REVALIDATE_SECRET=Retrieve this from /admin/config/services/next |
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,4 +1,4 @@ | ||
{ | ||
"extends": "next", | ||
"extends": "next/core-web-vitals", | ||
"root": true | ||
} |
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 @@ | ||
v20 |
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 @@ | ||
# Ignore everything. | ||
/* | ||
|
||
# Format most files in the root directory. | ||
!/*.js | ||
!/*.ts | ||
!/*.md | ||
!/*.json | ||
# But ignore some. | ||
/package.json | ||
/package-lock.json | ||
/CHANGELOG.md | ||
|
||
# Don't ignore these nested directories. | ||
!/app | ||
!/components | ||
!/lib | ||
!/pages |
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,4 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "es5" | ||
} |
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,30 @@ | ||
import { useEffect, useState } from "react" | ||
import { useRouter } from "next/router" | ||
|
||
export function PreviewAlert() { | ||
const router = useRouter() | ||
const isPreview = router.isPreview | ||
const [showPreviewAlert, setShowPreviewAlert] = useState<boolean>(false) | ||
|
||
useEffect(() => { | ||
setShowPreviewAlert(isPreview && window.top === window.self) | ||
}, [isPreview]) | ||
|
||
if (!showPreviewAlert) { | ||
return null | ||
} | ||
|
||
return ( | ||
<div className="sticky top-0 left-0 z-50 w-full px-2 py-1 text-center text-white bg-black"> | ||
<p className="mb-0"> | ||
This page is a preview.{" "} | ||
<button | ||
className="inline-block ml-3 rounded border px-1.5 hover:bg-white hover:text-black active:bg-gray-200 active:text-gray-500" | ||
onClick={() => router.push("/api/exit-preview")} | ||
> | ||
Exit preview mode | ||
</button> | ||
</p> | ||
</div> | ||
) | ||
} |
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
8 changes: 4 additions & 4 deletions
8
...l-starter/components/node--basic-page.tsx → ...l-starter/components/drupal/BasicPage.tsx
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 was deleted.
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 was deleted.
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
Oops, something went wrong.