-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
53 changed files
with
2,038 additions
and
352 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 |
---|---|---|
|
@@ -94,4 +94,4 @@ react-native-app-e2e/artifacts | |
# Next.js | ||
.next | ||
**/.next | ||
verdaccio | ||
verdaccio |
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,12 @@ | ||
'use client' | ||
export const ClientComponent = () => { | ||
return ( | ||
<div | ||
style={{ | ||
backgroundColor: '#DFD', | ||
}} | ||
> | ||
Client content without a variable call | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use client' | ||
import { useUserIdentity, useVariableValue } from '@devcycle/next-sdk' | ||
|
||
export const ClientIdentity = () => { | ||
const variable = useVariableValue('test-featre', false) | ||
const userIdentity = useUserIdentity() | ||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
backgroundColor: '#DDF', | ||
}} | ||
> | ||
<b>Client Variable</b> | ||
<span>{JSON.stringify(variable)}</span> | ||
<b>Client User Identity</b> | ||
<span>{userIdentity?.user_id}</span> | ||
<br /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { getUserIdentity, getVariableValue } from '@devcycle/next-sdk/server' | ||
import * as React from 'react' | ||
|
||
export const ServerIdentity = async function () { | ||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
backgroundColor: '#FDD', | ||
}} | ||
> | ||
<b>Server Variable</b> | ||
<span> | ||
{' '} | ||
{JSON.stringify(await getVariableValue('test-featre', false))} | ||
</span> | ||
<b>Server Identity</b> | ||
<span>{getUserIdentity()?.user_id}</span> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use client' | ||
|
||
import Head from 'next/head' | ||
import styles from '../styles/Home.module.css' | ||
import { ClientIdentity } from './ClientIdentity' | ||
import { ReactNode } from 'react' | ||
|
||
const ClientSide = ({ children }: { children: ReactNode }) => { | ||
return ( | ||
<div className={styles.container}> | ||
<Head> | ||
<title>Create Next App</title> | ||
<meta | ||
name="description" | ||
content="Generated by create next app" | ||
/> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</Head> | ||
|
||
<main className={styles.main}> | ||
{children} | ||
<ClientIdentity /> | ||
<br /> | ||
</main> | ||
</div> | ||
) | ||
} | ||
|
||
export default ClientSide |
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 |
---|---|---|
@@ -1,152 +1,40 @@ | ||
'use client' | ||
|
||
import type { NextPage } from 'next' | ||
import Head from 'next/head' | ||
import Image from 'next/image' | ||
import styles from '../styles/Home.module.css' | ||
import { useVariable } from '@devcycle/react-client-sdk' | ||
|
||
const Home: NextPage = () => { | ||
const variableKey = 'feature-release' | ||
const variableKeyString = 'variable-key-string' | ||
const variableKeyNumber = 'variable-key-number' | ||
const variableKeyBoolean = 'variable-key-boolean' | ||
const variableKeyJsonString = 'variable-json-key-string' | ||
import { ReactNode, Suspense } from 'react' | ||
import * as React from 'react' | ||
import { ServerIdentity } from './ServerIdentity' | ||
import { ClientIdentity } from './ClientIdentity' | ||
import { ClientComponent } from './ClientComponent' | ||
|
||
const variable = useVariable(variableKey, true) | ||
const variableString = useVariable(variableKeyString, 'default') | ||
const variableNumber = useVariable(variableKeyNumber, 100) | ||
const variableBoolean = useVariable(variableKeyBoolean, true) | ||
const variableJsonString = useVariable(variableKeyJsonString, { | ||
jsonStringKeyDefault: 'json string default', | ||
}) | ||
const Page: NextPage = async ({ children }: { children: ReactNode }) => { | ||
return ( | ||
<div className={styles.container}> | ||
<Head> | ||
<title>Create Next App</title> | ||
<meta | ||
name="description" | ||
content="Generated by create next app" | ||
/> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</Head> | ||
|
||
<main className={styles.main}> | ||
<h1 className={styles.title}> | ||
Welcome to <a href="https://nextjs.org">Next.js!</a> | ||
</h1> | ||
|
||
<p className={styles.description}> | ||
Get started by editing{' '} | ||
<code className={styles.code}>app/pages.tsx</code> | ||
and | ||
<code className={styles.code}>app/layout.tsx</code> | ||
</p> | ||
|
||
<div className={styles.description}> | ||
<div> | ||
<div> | ||
<span>React next js</span> | ||
</div> | ||
<div> | ||
<span> | ||
variable feature-release ={' '} | ||
{JSON.stringify(variable?.value)}{' '} | ||
</span> | ||
</div> | ||
<div> | ||
<span> | ||
variable variable-key-string ={' '} | ||
{JSON.stringify(variableString?.value)}{' '} | ||
</span> | ||
</div> | ||
<div> | ||
<span> | ||
variable variable-key-number ={' '} | ||
{JSON.stringify(variableNumber?.value)}{' '} | ||
</span> | ||
</div> | ||
<div> | ||
<span> | ||
variable variable-key-boolean ={' '} | ||
{JSON.stringify(variableBoolean?.value)} | ||
</span> | ||
</div> | ||
<div> | ||
<span> | ||
variable variable-json-key-string ={' '} | ||
{JSON.stringify(variableJsonString?.value)}{' '} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className={styles.grid}> | ||
<a href="https://nextjs.org/docs" className={styles.card}> | ||
<h2>Documentation →</h2> | ||
<p> | ||
Find in-depth information about Next.js features and | ||
API. | ||
</p> | ||
</a> | ||
|
||
<a href="https://nextjs.org/learn" className={styles.card}> | ||
<h2>Learn →</h2> | ||
<p> | ||
Learn about Next.js in an interactive course with | ||
quizzes! | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://github.com/vercel/next.js/tree/master/examples" | ||
className={styles.card} | ||
> | ||
<h2>Examples →</h2> | ||
<p> | ||
Discover and deploy boilerplate example Next.js | ||
projects. | ||
</p> | ||
</a> | ||
|
||
<a | ||
href={ | ||
'https://vercel.com/new?utm_source=create-next-app&' + | ||
'utm_medium=default-template&utm_campaign=create-next-app' | ||
} | ||
className={styles.card} | ||
> | ||
<h2>Deploy →</h2> | ||
<p> | ||
Instantly deploy your Next.js site to a public URL | ||
with Vercel. | ||
</p> | ||
</a> | ||
</div> | ||
</main> | ||
|
||
<footer className={styles.footer}> | ||
<a | ||
href={ | ||
'https://vercel.com?utm_source=create-next-app&utm_medium=defa' + | ||
'ult-template&utm_campaign=create-next-app' | ||
} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Powered by{' '} | ||
<span className={styles.logo}> | ||
<Image | ||
src="/vercel.svg" | ||
alt="Vercel Logo" | ||
width={72} | ||
height={16} | ||
/> | ||
</span> | ||
</a> | ||
</footer> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
width: '400px', | ||
padding: '20px', | ||
}} | ||
> | ||
<div | ||
style={{ | ||
backgroundColor: '#FFD', | ||
}} | ||
> | ||
Server content without a variable call | ||
</div> | ||
<br /> | ||
<Suspense fallback={<div>Loading Server...</div>}> | ||
<ServerIdentity /> | ||
</Suspense> | ||
<br /> | ||
<ClientComponent /> | ||
<br /> | ||
<Suspense fallback={<div>Loading Client...</div>}> | ||
<ClientIdentity /> | ||
</Suspense> | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export default Home | ||
export default Page |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
b03ba39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
js-sdks-web-elements – ./
js-sdks-web-elements-git-main-devcyclehq.vercel.app
js-sdks-web-elements-devcyclehq.vercel.app
js-sdks-web-elements.vercel.app
b03ba39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
js-sdks-next-js-page-router – ./
js-sdks-next-js-page-router-devcyclehq.vercel.app
js-sdks-next-js-page-router-git-main-devcyclehq.vercel.app
dvc-nextjs.vercel.app
b03ba39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
js-sdks-with-provider – ./
dvc-with-provider.vercel.app
js-sdks-with-provider-devcyclehq.vercel.app
js-sdks-with-provider-git-main-devcyclehq.vercel.app