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
| exports.uploadExpoImage = functions.https.onCall( | |
| async ({ data_url, path }, context) => { | |
| try { | |
| let base64EncodedImageString = `${data_url}`.replace( | |
| 'data:image/png;base64,', | |
| '' | |
| ) | |
| let mimeType = 'image/png' | |
| let imageBuffer = new Buffer(base64EncodedImageString, 'base64') | |
| let bucket = admin.storage().bucket() |
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, useEffect } from "react"; | |
| import { firestore } from "./firebase"; | |
| function App() { | |
| const [title, setTitle] = useState(null); | |
| const [lang, setLang] = useState("en"); | |
| useEffect(() => getTitle(), []); | |
| const getTitle = async () => { |
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 firebase from 'firebase/app' | |
| import 'firebase/firestore' | |
| const firebaseConfig = { | |
| // THE CONFIG OBJECT OF YOUR FIREBASE PROJECT | |
| // YOU CAN GET THIS AT THE FIREBASE DASHBOARD | |
| // https://firebase.google.com/docs/web/setup | |
| } | |
| firebase.initializeApp(firebaseConfig) |
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 './App.css' | |
| function App() { | |
| const [views, setViews] = useState(0) | |
| return ( | |
| <div> | |
| <h1>Live counter</h1> | |
| <h2>{views}</h2> |
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
| <Helmet> | |
| <meta name="description" content="Lorem ipsum" /> | |
| <meta | |
| name="robots" | |
| content="max-snippet:-1, max-image-preview:large, max-video-preview:-1" | |
| /> | |
| <link rel="canonical" href="https://yourapp.com" /> | |
| <meta property="og:locale" content="en_US" /> | |
| <meta property="og:type" content="website" /> | |
| <meta property="og:title" content="Your App | Config" /> |
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
| function Todos({}) { | |
| // Create the state | |
| const [_todos, setTodos] = useState(0); | |
| return ( | |
| <div className="todos"> | |
| <Helmet> | |
| {/* Display the state as string */} | |
| <title>MyApp | Todos {_todos.toString()}</title> |
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, useEffect } from "react"; | |
| import { BrowserRouter, Switch, Route, Link } from "react-router-dom"; | |
| // Import Helmet | |
| import Helmet from "react-helmet"; | |
| function Config({}) { | |
| return ( | |
| <div className="config"> | |
| {/* Add a Helmet tag with the title tag inside */} |
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, useEffect } from "react"; | |
| import { BrowserRouter, Switch, Route, Link } from "react-router-dom"; | |
| function Config({}) { | |
| return ( | |
| <div className="config"> | |
| <h1>Config</h1> | |
| <Link to="/">Todos</Link> | |
| </div> | |
| ); |
NewerOlder