initial commit
This commit is contained in:
parent
2ab75ed7eb
commit
31c579ccdd
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import GlobalHead from '@dailyjs/shared/components/GlobalHead';
|
||||||
import GlobalStyle from '@dailyjs/shared/components/GlobalStyle';
|
import GlobalStyle from '@dailyjs/shared/components/GlobalStyle';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
@ -8,12 +9,8 @@ function App({ Component, pageProps }) {
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Daily - Basic Call Example</title>
|
<title>Daily - Basic Call Example</title>
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
</Head>
|
</Head>
|
||||||
|
<GlobalHead />
|
||||||
<GlobalStyle />
|
<GlobalStyle />
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"presets": ["next/babel"],
|
||||||
|
"plugins": ["inline-react-svg"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Domain excluding 'https://' and 'daily.co' e.g. 'somedomain'
|
||||||
|
DAILY_DOMAIN=
|
||||||
|
|
||||||
|
# Obtained from https://dashboard.daily.co/developers
|
||||||
|
DAILY_API_KEY=
|
||||||
|
|
||||||
|
# Daily REST API endpoint
|
||||||
|
DAILY_REST_DOMAIN=https://api.daily.co/v1
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
const withPlugins = require('next-compose-plugins');
|
||||||
|
const withTM = require('next-transpile-modules')(['@dailyjs/shared']);
|
||||||
|
|
||||||
|
module.exports = withPlugins([withTM]);
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "@dailyjs/live-fitness",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@dailyjs/shared": "*",
|
||||||
|
"next": "^10.2.0",
|
||||||
|
"pluralize": "^8.0.0",
|
||||||
|
"react": "^17.0.2",
|
||||||
|
"react-dom": "^17.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-module-resolver": "^4.1.0",
|
||||||
|
"next-compose-plugins": "^2.2.1",
|
||||||
|
"next-transpile-modules": "^6.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
import React from 'react';
|
||||||
|
import GlobalHead from '@dailyjs/shared/components/GlobalHead';
|
||||||
|
import GlobalStyle from '@dailyjs/shared/components/GlobalStyle';
|
||||||
|
import Head from 'next/head';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
function App({ Component, pageProps }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<title>Daily - Live Fitness Demo</title>
|
||||||
|
</Head>
|
||||||
|
<GlobalHead />
|
||||||
|
<GlobalStyle />
|
||||||
|
<Component {...pageProps} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
App.defaultProps = {
|
||||||
|
Component: null,
|
||||||
|
pageProps: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
App.propTypes = {
|
||||||
|
Component: PropTypes.elementType,
|
||||||
|
pageProps: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
export default function Index({ domain, isConfigured }) {
|
||||||
|
return <div>Hello</div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
Index.propTypes = {
|
||||||
|
isConfigured: PropTypes.bool.isRequired,
|
||||||
|
domain: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function getStaticProps() {
|
||||||
|
// Check that both domain and key env vars are set
|
||||||
|
const isConfigured =
|
||||||
|
!!process.env.DAILY_DOMAIN && !!process.env.DAILY_API_KEY;
|
||||||
|
|
||||||
|
// Pass through domain as prop
|
||||||
|
return {
|
||||||
|
props: { domain: process.env.DAILY_DOMAIN || null, isConfigured },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import React from 'react';
|
||||||
|
import Head from 'next/head';
|
||||||
|
|
||||||
|
export const GlobalHead = () => (
|
||||||
|
<Head>
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default GlobalHead;
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
export { GlobalHead as default } from './GlobalHead';
|
||||||
|
export { GlobalHead } from './GlobalHead';
|
||||||
Loading…
Reference in New Issue