This repository has been archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
index.js
70 lines (63 loc) · 1.6 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import React, { useState } from 'react';
import Header from '@custom/shared/components/Header';
import getDemoProps from '@custom/shared/lib/demoProps';
import Call from '../components/Call';
import Home from '../components/Home';
export default function Index({ isConfigured = false }) {
const [room, setRoom] = useState(null);
const [expiry, setExpiry] = useState(null);
const [callFrame, setCallFrame] = useState(null);
return (
<div className="index-container">
<Header
demoTitle={'Daily Prebuilt demo'}
repoLink={
'https://github.com/daily-demos/examples/tree/main/prebuilt/basic-embed'
}
/>
<main>
{room ? (
<Call
room={room}
expiry={expiry}
setRoom={setRoom}
setCallFrame={setCallFrame}
callFrame={callFrame}
/>
) : (
<Home
setRoom={setRoom}
setExpiry={setExpiry}
isConfigured={isConfigured}
/>
)}
</main>
<style jsx>{`
.index-container {
display: flex;
flex-direction: column;
min-height: 100vh;
overflow: auto;
max-width: 1200px;
margin: auto;
}
main {
padding: 2rem;
flex: 1;
}
:global(.field) {
margin-top: var(--spacing-sm);
}
:global(.card) {
margin: 8px;
}
`}</style>
</div>
);
}
export async function getStaticProps() {
const defaultProps = getDemoProps();
return {
props: defaultProps,
};
}