-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
staging -> production #68
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0826148
video landing page
petyosi 2a20162
chore: more features
petyosi 3c35ef0
chore: more content
petyosi 9e24f94
chore: fix the url
petyosi 6107b43
chore: more sections in video
petyosi 6543a7b
chore: go syntax highlight
petyosi 1c7746c
chore: usable dropdown for video
petyosi f62391b
chore: style tutorials stage
petyosi 3ed7c94
chore: features layout/content
petyosi 533c8e4
fix: react native video link (#61)
santhoshvai bfc4627
chore: video homepage moved to docs repo
petyosi 0f50050
chore: fix anchor
petyosi 35420ea
Adding client js to consts
vanGalilea a94facd
Update constants.js
vanGalilea 888fad3
Merge branch 'staging' into vanGalilea-patch-2
vanGalilea 8450866
Merge pull request #63 from GetStream/vanGalilea-patch-2
vanGalilea 36760ca
Revert "feat: adding client js to consts"
khushal87 1757fb6
Merge pull request #64 from GetStream/revert-63-vanGalilea-patch-2
vanGalilea 5081618
api
tbarbugli e5780ea
Remove Platform and Overview from build output
DaemonLoki 757d303
Update Layout.js to prevent redirect loop on /video/docs/
7ed2324
Add TokenSnippet to shared content
DaemonLoki 1651832
Move shared snippet to correct place and update README
DaemonLoki 8f4c58f
Merge pull request #66 from GetStream/jaapbakker88-patch-1
ed3e7df
Disable ReactNative
jeroenleenarts e09e5d4
Disable Video ReactNative, not Chat.
jeroenleenarts b0ff8a2
Disable everything ReactNative.
jeroenleenarts 28808ec
Update tokenSnippet to real use real API
DaemonLoki 20aa4ab
Add option to either show join call or credentials only
jeroenleenarts f9d70ba
Adopt changes by Stefan
jeroenleenarts f040cf4
Refactor
DaemonLoki eb4f655
Add session storage to token snippet
DaemonLoki c9ee3d4
Prevent different credentials for multiple elements on a page
DaemonLoki 9fc7838
Make sure each .sampleApp uses a distinct storage key.
jeroenleenarts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ yarn-error.log | |
.DS_Store | ||
/.log/ | ||
.docusaurus | ||
*_version* |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused. |
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 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,142 @@ | ||
import React from 'react'; | ||
import './tokenSnippet.css'; | ||
|
||
const BASE_URL = 'https://stream-calls-dogfood.vercel.app/api/call/sample?'; | ||
|
||
const STORAGE_KEY = 'tokenSnippetDataFor'; | ||
|
||
async function callAPI(sampleApp) { | ||
const constructedUrl = constructUrl(sampleApp); | ||
const response = await fetch(constructedUrl); | ||
const resultObject = await response.json(); | ||
return resultObject; | ||
} | ||
|
||
function constructUrl(sampleApp) { | ||
return ( | ||
BASE_URL + | ||
new URLSearchParams({ | ||
app_type: sampleApp, | ||
}) | ||
); | ||
} | ||
|
||
export class TokenSnippet extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
loadingFinished: false, | ||
sampleApp: props.sampleApp, | ||
userId: 'Loading ...', | ||
userName: 'Creating user name ...', | ||
callId: 'Creating random call ID ...', | ||
callType: 'Loading call type ...', | ||
apiKey: 'Waiting for an API key ...', | ||
token: 'Token is generated ...', | ||
deepLink: 'Link is created ...', | ||
displayStyle: props.displayStyle ?? 'full', | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
const storedData = sessionStorage.getItem(STORAGE_KEY + this.state.sampleApp); | ||
if (storedData) { | ||
this.setState({ | ||
...this.state, | ||
loadingFinished: true, | ||
...JSON.parse(storedData), | ||
}); | ||
} else { | ||
callAPI(this.state.sampleApp).then((result) => { | ||
const savedData = sessionStorage.getItem(STORAGE_KEY + this.state.sampleApp); | ||
// We're checking again if another component might have written | ||
// the data in the meantime. This is not ideal, but it works for now. | ||
// (This happens for multiple elements on the same page) | ||
if (savedData) { | ||
this.setState({ | ||
...this.state, | ||
loadingFinished: true, | ||
...JSON.parse(savedData), | ||
}); | ||
} else { | ||
sessionStorage.setItem(STORAGE_KEY + this.state.sampleApp, JSON.stringify(result)); | ||
this.setState({ | ||
...this.state, | ||
loadingFinished: true, | ||
...result, | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
render() { | ||
const showTable = | ||
this.state.displayStyle === 'full' || | ||
this.state.displayStyle === 'credentials'; | ||
|
||
const showJoinLink = | ||
this.state.displayStyle === 'full' || this.state.displayStyle === 'join'; | ||
|
||
return ( | ||
<div className="snippetStyle"> | ||
{showTable && ( | ||
<div> | ||
<p>Here are credentials to try out the app with:</p> | ||
<table className="snippetTable"> | ||
<thead> | ||
<tr> | ||
<th>Property</th> | ||
<th>Value</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>API Key</td> | ||
<td>{this.state.apiKey}</td> | ||
</tr> | ||
<tr> | ||
<td>Token</td> | ||
<td className="tokenStyle"> | ||
<span> {this.state.token}</span> | ||
{this.state.loadingFinished && ( | ||
<button | ||
onClick={() => | ||
navigator.clipboard.writeText(this.state.token) | ||
} | ||
> | ||
Copy | ||
</button> | ||
)} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>User ID</td> | ||
<td>{this.state.userId}</td> | ||
</tr> | ||
<tr> | ||
<td>Call ID</td> | ||
<td>{this.state.callId}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
)} | ||
|
||
{showJoinLink && ( | ||
<span className="joinCallRow"> | ||
For testing you can join the call on our web-app:{' '} | ||
<a | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
href={this.state.deepLink} | ||
className="joinCallLink" | ||
> | ||
Join Call | ||
</a> | ||
</span> | ||
)} | ||
</div> | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we have different mappings for video and chat?
Because in video we don't have
angular
yet.