This file contains hidden or 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
import styled from 'styled-components'; | |
import { Typography } from 'antd'; | |
export const StyledParagraph = styled(Typography.Paragraph)` | |
&& { | |
display: flex; | |
margin-bottom: 0; | |
font-size: 1.25rem; | |
} | |
`; |
This file contains hidden or 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
import { Form, Input } from 'antd'; | |
... | |
const validatePhoneNumber = (rule, value, callback) => { | |
const phoneNumberPattern = /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/; | |
const isValid = phoneNumberPattern.test(value); | |
if (!isValid) { | |
return callback('Not a valid phone number'); | |
} | |
return callback(); |
This file contains hidden or 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
class JitsiView extends React.Component { | |
componentDidMount() { | |
this.initJitsi(); | |
} | |
componentWillUnmount() { | |
if (this.api) { | |
this.api.dispose(); | |
} | |
} |
This file contains hidden or 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
import styled from 'styled-components'; | |
export const JitsiViewWrapper = styled.div` | |
&, | |
#jitsi-mount, | |
iframe { | |
width: 100%; | |
height: 100%; | |
} | |
`; |
This file contains hidden or 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
import React from 'react'; | |
import ScriptLoader from 'react-render-props-script-loader'; | |
import JitsiView from './JitsiView'; | |
const JitsiContainer = props => { | |
// Prepare config e.g. user and room names | |
const userConfig = { ... } | |
const roomConfig = { ... } | |
This file contains hidden or 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
render() { | |
return ( | |
<JitsiViewWrapper> | |
<div id="jitsi-mount" /> | |
</JitsiViewWrapper> | |
); | |
} |
This file contains hidden or 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
import { connect } from '../../_db'; | |
import { withAuth } from '../../_utils/auth'; | |
import User from '../../_db/user'; | |
// First check if we need to connect to the database | |
// Only if there is no live connection will a new one be established | |
connect(); | |
export default withAuth(async (req, res) => { | |
if (req.method !== 'POST') { |
This file contains hidden or 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
// next.config.js | |
module.exports = { | |
// For variables required on just client side, or on both client and server sides | |
publicRuntimeConfig: { | |
proxyApiEndpoint: process.env.EKO_PROXY_API_ENDPOINT, | |
recaptchaToken: process.env.EKO_RECAPTCHA_SITE_KEY, | |
}, | |
// For variables required on the server side only | |
serverRuntimeConfig: { | |
oauthClientSecret: process.env.EKO_OAUTH_CLIENT_SECRET, |
This file contains hidden or 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
Data fetching method | Type of server rendering | |
---|---|---|
None | Static | |
getStaticProps | Static | |
getServerSideProps | SSR | |
getInitialProps | SSR |
This file contains hidden or 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
const dev = NODE_ENV !== 'production'; | |
const app = next({ dev }); | |
const handleNextRequest = app.getRequestHandler(); | |
app.prepare().then(() => { | |
const server = express(); | |
// Apply some middlewares | |
server.use(...); | |
server.use(...); |