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
<?php | |
require 'vendor/autoload.php'; | |
use Kreait\Firebase\Factory; | |
use Kreait\Firebase\Auth; | |
use Kreait\Firebase\Firestore; | |
$serviceAccountPath = __DIR__ . '/credentials.json'; |
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
// database/index.ts ou firebase/index.ts | |
// Onde configuramos e inicializamos o firebase | |
// Usaremos a biblioteca modular do firebase | |
import firebase from "firebase/compat/app"; | |
import "firebase/compat/auth"; | |
import admin from "firebase-admin"; | |
const serviceAccount = require("./credentials.json"); // JSON contendo apikey e credenciais do nosso usuário admin do projeto Firebase |
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 { useRef, useCallback } from "react"; | |
const scrollingRef = useRef<HTMLDivElement>(null); | |
const onAssetFocus = useCallback( | |
({ x }: { x: number }) => { | |
if (scrollingRef.current) { | |
scrollingRef.current.scrollLeft = x; | |
scrollingRef.current.style.scrollBehavior = "smooth"; | |
} |