initial commit

This commit is contained in:
J Taylor 2021-06-21 10:57:42 +01:00
parent 2ab75ed7eb
commit 31c579ccdd
9 changed files with 108 additions and 5 deletions

View File

@ -1,4 +1,5 @@
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';
@ -8,12 +9,8 @@ function App({ Component, pageProps }) {
<>
<Head>
<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>
<GlobalHead />
<GlobalStyle />
<Component {...pageProps} />
</>

View File

@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": ["inline-react-svg"]
}

View File

@ -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

View File

@ -0,0 +1,4 @@
const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')(['@dailyjs/shared']);
module.exports = withPlugins([withTM]);

View File

@ -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"
}
}

View File

@ -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;

View File

@ -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 },
};
}

View File

@ -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;

View File

@ -0,0 +1,2 @@
export { GlobalHead as default } from './GlobalHead';
export { GlobalHead } from './GlobalHead';