Fixed links and image src, added margin

This commit is contained in:
Kimberlee Johnson 2021-09-13 16:26:11 -07:00
parent 2903a72c8b
commit 5af991c0cb
5 changed files with 98 additions and 87 deletions

View File

@ -1,6 +1,6 @@
# Daily Prebuilt: Next.js demo # Daily Prebuilt: Next.js demo
[Clicking create room button starts a call](/public/basic-embed.gif) ![Clicking create room button starts a call](./basic-embed.gif)
## How the demo works ## How the demo works

View File

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
export const Header = () => { export const Header = () => (
return (
<header className="header"> <header className="header">
<div className="row"> <div className="row">
<img src="daily-logo.svg" alt="Daily" className="logo" /> <img src="daily-logo.svg" alt="Daily" className="logo" />
@ -12,12 +11,9 @@ export const Header = () => {
<a href="https://docs.daily.co/docs/">API docs</a> <a href="https://docs.daily.co/docs/">API docs</a>
</div> </div>
<span className="divider"></span> <span className="divider"></span>
<img <a href="https://github.com/daily-demos/examples/tree/main/prebuilt-ui/basic-embed">
src="github-logo.png" <img src="github-logo.png" alt="Ocotocat" className="logo octocat" />
alt="Ocotocat" </a>
className="logo octocat"
href="https://github.com/daily-demos/examples/tree/main/prebuilt-ui/basic-embed"
/>
</div> </div>
<style jsx>{` <style jsx>{`
.header { .header {
@ -28,6 +24,7 @@ export const Header = () => {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
position: fixed; position: fixed;
top: 0;
} }
.row { .row {
@ -80,6 +77,5 @@ export const Header = () => {
`}</style> `}</style>
</header> </header>
); );
};
export default Header; export default Header;

View File

@ -17,8 +17,10 @@ import {
import Field from '@dailyjs/shared/components/Field'; import Field from '@dailyjs/shared/components/Field';
import { TextInput } from '@dailyjs/shared/components/Input'; import { TextInput } from '@dailyjs/shared/components/Input';
import { Well } from '@dailyjs/shared/components/Well'; import { Well } from '@dailyjs/shared/components/Well';
import getDemoProps from '@dailyjs/shared/lib/demoProps';
import { Header } from '../components/Header';
export const PrebuiltCall = () => { export default function PrebuiltCall() {
const [demoState, setDemoState] = useState('home'); const [demoState, setDemoState] = useState('home');
const [isError, setIsError] = useState(false); const [isError, setIsError] = useState(false);
const [roomURL, setRoomURL] = useState(''); const [roomURL, setRoomURL] = useState('');
@ -139,18 +141,18 @@ export const PrebuiltCall = () => {
return ( return (
<Card> <Card>
<CardHeader> <CardHeader>
Start demo with a new unique room or paste in your own room URL. Start demo with a new unique room, or paste in your own room URL.
</CardHeader> </CardHeader>
<CardBody> <CardBody>
{isError && ( {isError && (
<Well variant="error"> <Well variant="error">
Failed to obtain token <p>{error}</p> Error creating the room. Please try again.
</Well> </Well>
)} )}
<Button onClick={() => createRoom()} disabled={roomValidity}> <Button onClick={() => createRoom()} disabled={roomValidity}>
Create room and start Create room and start
</Button> </Button>
<Field label="Or enter room to join"> <Field label="Or enter room to join" className="roomField">
<TextInput <TextInput
ref={roomURLRef} ref={roomURLRef}
type="text" type="text"
@ -204,6 +206,7 @@ export const PrebuiltCall = () => {
return ( return (
<div className="container"> <div className="container">
<Header />
{content} {content}
<style jsx>{` <style jsx>{`
.container { .container {
@ -227,6 +230,14 @@ export const PrebuiltCall = () => {
color: var(--blue-dark); color: var(--blue-dark);
} }
:global(.field) {
margin-top: var(--spacing-sm);
}
:global(.card) {
margin: 8px;
}
@media only screen and (max-width: 750px) { @media only screen and (max-width: 750px) {
.container { .container {
flex-direction: column; flex-direction: column;
@ -235,6 +246,12 @@ export const PrebuiltCall = () => {
`}</style> `}</style>
</div> </div>
); );
}; }
export default PrebuiltCall; export async function getStaticProps() {
const defaultProps = getDemoProps();
return {
props: defaultProps,
};
}

View File

@ -4,8 +4,6 @@ import Header from '../components/Header';
export default function Home() { export default function Home() {
return ( return (
<> <>
<Header />
<PrebuiltCall /> <PrebuiltCall />
<style jsx>{` <style jsx>{`
display: flex; display: flex;