-
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.
- Loading branch information
1 parent
c727732
commit 2a5e0e9
Showing
7 changed files
with
1,025 additions
and
946 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Binary file not shown.
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,33 +1,36 @@ | ||
import { | ||
createImageUrlBuilder, | ||
createCurrentUserHook, | ||
createClient, | ||
createImageUrlBuilder, | ||
createCurrentUserHook, | ||
createClient, | ||
} from "next-sanity"; | ||
|
||
export const config = { | ||
/** | ||
* Find your project ID and dataset in `sanity.json` in your studio project. | ||
* There are considered "public", but you can use enviroment variables | ||
* if you want differ between local dev and production. | ||
* | ||
* https://nextjs.org/docs/basic-features/enviroment-variables | ||
**/ | ||
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET || "production", | ||
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID, | ||
apiVersion: "2021-03-25", | ||
/** | ||
* Set useCdn to `false` if your application require the freshest possible | ||
* data always (potentially slightly slower and a bit more expensive). | ||
* Authenticated request (like preview) will always bypass the CDN | ||
**/ | ||
useCdn: process.env.NODE_ENV === "production", | ||
/** | ||
* Find your project ID and dataset in `sanity.json` in your studio project. | ||
* These are considered “public”, but you can use environment variables | ||
* if you want differ between local dev and production. | ||
* | ||
* https://nextjs.org/docs/basic-features/environment-variables | ||
**/ | ||
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET || "production", | ||
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID, | ||
apiVersion: "2021-10-21", // Learn more: https://www.sanity.io/docs/api-versioning | ||
/** | ||
* Set useCdn to `false` if your application require the freshest possible | ||
* data always (potentially slightly slower and a bit more expensive). | ||
* Authenticated request (like preview) will always bypass the CDN | ||
**/ | ||
useCdn: process.env.NODE_ENV === "production", | ||
}; | ||
|
||
// Set up the client for fetching data in the getProps page functions | ||
export const sanityClient = createClient(config); | ||
|
||
// Helper function for using the current logged in your account | ||
/** | ||
* Set up a helper function for generating Image URLs with only the asset reference data in your documents. | ||
* Read more: https://www.sanity.io/docs/image-url | ||
**/ | ||
export const urlFor = (source) => createImageUrlBuilder(config).image(source); | ||
|
||
// helper function for using the current logged in user account | ||
export const useCurrentUser = createCurrentUserHook(config); | ||
// Helper function for using the current logged in user account | ||
export const useCurrentUser = createCurrentUserHook(config) |
Oops, something went wrong.