mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-20 19:51:27 +10:00
- using nanoevents as event emitter
- bug: createResumeModal opens twice
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
import { navigate } from "gatsby";
|
||||
import React, { useContext } from "react";
|
||||
import { FaGithub } from "react-icons/fa";
|
||||
import ThemeContext from "../../contexts/ThemeContext";
|
||||
import ModalContext from "../../contexts/ModalContext";
|
||||
import ThemeContext from "../../contexts/ThemeContext";
|
||||
import UserContext from "../../contexts/UserContext";
|
||||
import Button from "../shared/Button";
|
||||
import Logo from "../shared/Logo";
|
||||
import { navigate } from "gatsby";
|
||||
|
||||
const Hero = () => {
|
||||
const { emitter, events } = useContext(ModalContext);
|
||||
const { user, loading } = useContext(UserContext);
|
||||
const { toggleDarkMode } = useContext(ThemeContext);
|
||||
const { authModal } = useContext(ModalContext);
|
||||
|
||||
const handleLogin = () => authModal.setOpen(true);
|
||||
const handleLogin = () => emitter.emit(events.AUTH_MODAL);
|
||||
|
||||
const handleGotoApp = () => navigate("/app/dashboard");
|
||||
|
||||
@ -31,14 +31,10 @@ const Hero = () => {
|
||||
<Button
|
||||
title="Go to App"
|
||||
onClick={handleGotoApp}
|
||||
isLoading={loading || authModal.isOpen}
|
||||
isLoading={loading}
|
||||
/>
|
||||
) : (
|
||||
<Button
|
||||
title="Login"
|
||||
onClick={handleLogin}
|
||||
isLoading={loading || authModal.isOpen}
|
||||
/>
|
||||
<Button title="Login" onClick={handleLogin} isLoading={loading} />
|
||||
)}
|
||||
<Button
|
||||
outline
|
||||
|
||||
Reference in New Issue
Block a user