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, { Component, createContext } from "react"; | |
type themeState = { | |
isDarkMode: boolean; | |
toggleTheme: any; | |
}; | |
export const ThemeContext = createContext<themeState>({ | |
isDarkMode: false, | |
toggleTheme: null, |
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, { Component, createContext } from 'react' | |
type teamState = { | |
team:string | |
} | |
export const TeamContext = createContext<{team:string,changeTeam:any}>({team:"rcb",changeTeam:null}) | |
class TeamProvider extends Component<{},teamState> { | |
constructor(props:{}){ | |
super(props); | |
this.changeTeam = this.changeTeam.bind(this) |
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, { Component, createContext } from 'react' | |
type teamState = { | |
team:string | |
} | |
export const TeamContext = createContext<{team:string,changeTeam:any}>({team:"rcb",changeTeam:null}) | |
class TeamProvider extends Component<{},teamState> { | |
constructor(props:{}){ | |
super(props); | |
this.changeTeam = this.changeTeam.bind(this) |
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 firebase from 'firebase/app' | |
import "firebase/database" | |
const config = { | |
apiKey: process.env.REACT_APP_APIKEY, | |
authDomain: process.env.REACT_APP_AUTHDOMAIN, | |
databaseURL: process.env.REACT_APP_DB, | |
projectId: process.env.REACT_APP_PID, | |
storageBucket: process.env.REACT_APP_SB, | |
messagingSenderId: process.env.REACT_APP_SID, | |
appId: process.env.REACT_APP_APPID, |
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 TextField from "@material-ui/core/TextField"; | |
import {todosRef} from "./firebase"; | |
function TodoForm() { | |
const [value, setValue] = useState(""); | |
const createTodo = (e: React.FormEvent<EventTarget>) => { | |
e.preventDefault(); | |
const item = { | |
task: value, | |
done: false, |
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, useEffect} from "react"; | |
import Todo from "./Todo"; | |
import Divider from "@material-ui/core/Divider"; | |
import {todosRef} from "./firebase"; | |
function TodoList() { | |
const [todos,setTodos] = useState<any>([]); | |
useEffect(() => { | |
todosRef.on('value', (snapshot) => { | |
let items = snapshot.val(); | |
let newState = []; |
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 Switch from "@material-ui/core/Switch"; | |
import IconButton from "@material-ui/core/IconButton"; | |
import DeleteIcon from "@material-ui/icons/Delete"; | |
import "./Todo.scss"; | |
import {todosRef} from "./firebase"; | |
function Todo(props: any) { | |
const { todo } = props; | |
const updateTodo = () => { | |
todosRef.child(todo.id).set({...todo,done:!todo.done}) |
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, useEffect} from 'react'; | |
import './App.scss'; | |
import Signin from './sign-in/Signin'; | |
import Signup from './sign-up/Signup'; | |
import Userinfo from './user-info/Userinfo'; | |
import {auth} from "./firebase" | |
function App() { | |
const [currentUser,setCurrentUser] = useState(); |
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, useEffect} from 'react'; | |
import './App.scss'; | |
import Signin from './sign-in/Signin'; | |
import Signup from './sign-up/Signup'; | |
import Userinfo from './user-info/Userinfo'; | |
import {auth, createUserProfileDocument} from "./firebase" | |
function App() { | |
const [currentUser,setCurrentUser] = useState(); |
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 firebase from 'firebase/app'; | |
import "firebase/firestore"; | |
import 'firebase/auth'; | |
const config = { | |
apiKey: process.env.REACT_APP_APIKEY, | |
authDomain: process.env.REACT_APP_AUTHDOMAIN, | |
databaseURL: process.env.REACT_APP_DB, | |
projectId: process.env.REACT_APP_PID, | |
storageBucket: process.env.REACT_APP_SB, |
OlderNewer