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 { makeStyles } from '@material-ui/core'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import Button from '@material-ui/core/Button'; | |
| import { useForm, Controller } from 'react-hook-form'; | |
| const useStyles = makeStyles(theme => ({ | |
| root: { | |
| display: 'flex', | |
| flexDirection: 'column', |
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 sports = [ | |
| "basketball", | |
| true && "football", | |
| false && "baseball" | |
| ].filter(Boolean); |
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 sports = [ | |
| "basketball", | |
| ...(true ? ["football"] : []), | |
| ...(false ? ["baseball"] : []) | |
| ]; |
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 express = require('express'); | |
| const app = express(); | |
| // Create HTTP get route | |
| app.get('/', (req, res) => { | |
| res.send('Hello World!'); | |
| }); | |
| // Start the server |
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, { useState } from 'react'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import Autocomplete from '@material-ui/lab/Autocomplete'; | |
| import { nbaTeams } from './nbaTeams'; | |
| const NbaAutocomplete = () => { | |
| const [selectedTeam, setSelectedTeam] = useState(null); | |
| console.log(selectedTeam); |
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
| export const nbaTeams = [ | |
| { id: 1, name: 'Atlanta Hawks' }, | |
| { id: 2, name: 'Boston Celtics' }, | |
| { id: 3, name: 'Brooklyn Nets' }, | |
| { id: 4, name: 'Charlotte Hornets' }, | |
| { id: 5, name: 'Chicago Bulls' }, | |
| { id: 6, name: 'Cleveland Cavaliers' }, | |
| { id: 7, name: 'Dallas Mavericks' }, | |
| { id: 8, name: 'Denver Nuggets' }, | |
| { id: 9, name: 'Detroit Pistons' }, |
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 FullCalendar from '@fullcalendar/react'; | |
| import dayGridPlugin from '@fullcalendar/daygrid'; | |
| import timeGridPlugin from '@fullcalendar/timegrid'; | |
| import interactionPlugin from '@fullcalendar/interaction'; | |
| const events = [ | |
| { | |
| id: 1, | |
| title: 'event 1', | |
| start: '2021-06-14T10:00:00', |
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 mail = require('@sendgrid/mail'); | |
| mail.setApiKey(process.env.SENDGRID_API_KEY); | |
| export default async (req, res) => { | |
| const body = JSON.parse(req.body); | |
| const message = ` | |
| Name: ${body.name}\r\n | |
| Email: ${body.email}\r\n |
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 { useState } from 'react'; | |
| import Head from 'next/head'; | |
| import styles from '../styles/Home.module.css'; | |
| export default function Home() { | |
| const [name, setName] = useState(''); | |
| const [email, setEmail] = useState(''); | |
| const [message, setMessage] = useState(''); | |
| const handleSubmit = e => { |