This file contains 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 path = require('path'); | |
const express = require('express'); | |
const hbs = require('hbs'); | |
const app = express(); | |
const port = 8000; | |
const localHost = '127.0.0.1'; | |
const staticPath = path.join(__dirname, '../public'); | |
const viewsPath = path.join(__dirname, '../views'); |
This file contains 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
let container = document.createElement('div'); | |
document.body.appendChild(container); | |
let head = document.createElement("h2"); | |
container.appendChild(head); | |
let date; | |
function callDate() { | |
setInterval(() => { | |
date = new Date(); | |
let finalDate = date.toLocaleTimeString(); |
This file contains 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 Typography from '@material-ui/core/Typography'; | |
import Button from '@material-ui/core/Button'; | |
import Container from '@material-ui/core/Container'; | |
import SendIcon from '@material-ui/icons/Send'; | |
import { FormControlLabel, makeStyles } from '@material-ui/core'; | |
import TextField from '@material-ui/core/TextField'; | |
import Radio from '@material-ui/core/Radio'; | |
import RadioGroup from '@material-ui/core/RadioGroup'; | |
import FormControl from '@material-ui/core/FormControl'; |
This file contains 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 logo from './logo.svg'; | |
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<p> | |
Edit <code>src/App.js</code> and save to reload. | |
</p> |
This file contains 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 Navbar from './Navbar'; | |
import { BrowserRouter, Switch, Route } from 'react-router-dom'; | |
import Home from './Home'; | |
import About from './About'; | |
import Error from './Error'; | |
import Random from './Random'; | |
import Login from './Login'; | |
const App = () => { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta name="description" content="Web site created using create-react-app" /> | |
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> |
This file contains 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 {useEffect} from 'react'; | |
const useIncrement = (state) => { | |
useEffect(() => { | |
document.title = state === 0 ? "Chats" : `Chats(${state})`; | |
}, [state]); | |
} | |
export default useIncrement; |
This file contains 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 useIncrement from './useIncrement'; | |
const Increment = () => { | |
document.title = "Chats"; | |
const [state, setState] = useState(0); | |
useIncrement(state); |