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 { createClient } from "@agnost/client"; | |
import styled from "styled-components"; | |
import * as fal from "@fal-ai/serverless-client"; | |
fal.config({ | |
// Can also be auto-configured using environment variables: | |
// Either a single FAL_KEY or a combination of FAL_KEY_ID and FAL_KEY_SECRET | |
credentials: | |
"181f3044-5f0b.......65775f5bbcceb424", |
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 json | |
from collections import Counter | |
import re | |
from wordcloud import WordCloud | |
import matplotlib.pyplot as plt | |
# Load the data from a file | |
with open('data.json', 'r') as file: | |
data = json.load(file) |
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 { BrowserRouter, Routes, Route } from 'react-router-dom'; | |
import { Home } from './components/Home'; | |
import { Signup } from './components/Signup'; | |
import { Verification } from './components/Verification'; | |
import { Redirect } from './components/Redirect'; | |
import { Login } from './components/Login'; | |
import { PrivateRoute } from './components/PrivateRoute'; | |
import { AuthProvider } from './contexts/Auth'; | |
import { Profile } from './components/Profile'; |
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 ReactDOM from 'react-dom/client'; | |
import './index.css'; | |
import App from './App'; | |
import reportWebVitals from './reportWebVitals'; | |
const root = ReactDOM.createRoot(document.getElementById('root')); | |
root.render( | |
<React.StrictMode> | |
<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
import { useNavigate } from 'react-router'; | |
import { useAuth } from '../contexts/Auth'; | |
import { altogic } from '../helpers/altogic'; | |
export function Home() { | |
// Get current user and signOut function from context | |
const { user, setUser, setSession } = useAuth(); | |
const navigate = useNavigate(); |
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 { BrowserRouter, Routes, Route } from 'react-router-dom'; | |
import { Home } from './components/Home'; | |
import { Signup } from './components/Signup'; | |
import { Verification } from './components/Verification'; | |
import { Redirect } from './components/Redirect'; | |
import { Login } from './components/Login'; | |
import { PrivateRoute } from './components/PrivateRoute'; | |
import { AuthProvider } from './contexts/Auth'; | |
export default function 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
import React from 'react'; | |
import { useLocation, Navigate } from 'react-router-dom'; | |
import { useAuth } from '../contexts/Auth'; | |
export function PrivateRoute({ children }) { | |
const { session } = useAuth(); | |
let location = useLocation(); | |
return session ? ( | |
children | |
) : ( | |
<Navigate to="/login" state={{ from: location }} replace /> |
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 { useRef, useState } from 'react'; | |
import { useNavigate, Link } from 'react-router-dom'; | |
import { useAuth } from '../contexts/Auth'; | |
import { altogic } from '../helpers/altogic'; | |
export function Login() { | |
const emailRef = useRef(); | |
const passwordRef = useRef(); | |
const { setUser } = useAuth(); | |
const { setSession } = useAuth(); |
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, { useEffect, useState } from 'react'; | |
import { altogic } from '../helpers/altogic'; | |
import { useNavigate } from 'react-router-dom'; | |
import { useAuth } from '../contexts/Auth'; | |
export function Redirect() { | |
const navigate = useNavigate(); | |
const { session, setSession, setUser } = useAuth(); | |
const [errors, setError] = useState(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 { BrowserRouter, Routes, Route } from 'react-router-dom'; | |
import { Home } from './components/Home'; | |
import { Signup } from './components/Signup'; | |
import { Verification } from './components/Verification'; | |
import { Redirect } from './components/Redirect'; | |
import { Login } from './components/Login'; | |
import { AuthProvider } from './contexts/Auth'; | |
export default function App() { | |
return ( |
NewerOlder