|
1 | 1 | import { AuthProvider, OAuthProvider, signInWithPopup } from 'firebase/auth' |
2 | | -import { FaGithub, FaGoogle } from 'react-icons/fa' |
| 2 | +import { FaGithub, FaHeart } from 'react-icons/fa' |
| 3 | +import { FcGoogle } from 'react-icons/fc' |
| 4 | +import { IoMdClose } from 'react-icons/io' |
3 | 5 | import ReactModal from 'react-modal' |
4 | 6 | import toast from 'react-simple-toasts' |
5 | 7 | import { useAuth } from 'src/features/auth' |
6 | 8 | import { firebaseAuth, githubAuthProvider, googleAuthProvider } from 'src/lib/firebase' |
| 9 | +import './authModal.css' |
7 | 10 |
|
8 | 11 | type AuthModalProps = { |
9 | 12 | showAuth: boolean |
10 | | - closeModal: () => void |
11 | 13 | } |
12 | 14 |
|
13 | | -export const AuthModal = ({ showAuth, closeModal }: AuthModalProps) => { |
| 15 | +export const AuthModal = ({ showAuth }: AuthModalProps) => { |
14 | 16 | const { closeAuthModal, initState } = useAuth() |
15 | 17 |
|
16 | 18 | const signIn = (provider: AuthProvider, providerName: string) => { |
@@ -46,40 +48,41 @@ export const AuthModal = ({ showAuth, closeModal }: AuthModalProps) => { |
46 | 48 | shouldCloseOnEsc={true} |
47 | 49 | shouldCloseOnOverlayClick={true} |
48 | 50 | shouldFocusAfterRender={false} |
49 | | - onRequestClose={closeModal} |
| 51 | + onRequestClose={closeAuthModal} |
50 | 52 | contentLabel="Auth" |
51 | | - className="Modal scrollable" |
| 53 | + className="Modal authModal" |
52 | 54 | style={{ |
53 | 55 | overlay: { |
54 | 56 | zIndex: 3, |
55 | 57 | }, |
56 | 58 | }} |
57 | 59 | overlayClassName="Overlay"> |
58 | | - <div> |
59 | | - <div> |
60 | | - <h1>Welcome to Hackertab</h1> |
61 | | - <p> |
62 | | - To enhance your experience and unlock our new rewards system, we’ve introduced a simple |
63 | | - and secure way to sign in. Connect your account with GitHub or Google to start earning |
64 | | - rewards, save your progress, and enjoy personalized features. |
65 | | - </p> |
66 | | - </div> |
67 | | - <div> |
68 | | - <button |
69 | | - className="extraTextWithIconBtn" |
70 | | - onClick={() => signIn(githubAuthProvider, 'Github')}> |
71 | | - <FaGithub /> |
72 | | - Sign in with Github |
73 | | - </button> |
74 | | - <button |
75 | | - className="extraTextWithIconBtn" |
76 | | - style={{ marginLeft: 10 }} |
77 | | - onClick={() => signIn(googleAuthProvider, 'Google')}> |
78 | | - <FaGoogle /> |
79 | | - Sign in with Google |
80 | | - </button> |
81 | | - </div> |
| 60 | + <div className="titleAndCloseBtn"> |
| 61 | + <h3> |
| 62 | + <FaHeart /> Join the community |
| 63 | + </h3> |
| 64 | + <button className="extraBtn" onClick={closeAuthModal}> |
| 65 | + <IoMdClose /> |
| 66 | + </button> |
82 | 67 | </div> |
| 68 | + <div className="buttons"> |
| 69 | + <button |
| 70 | + className="extraTextWithIconBtn" |
| 71 | + onClick={() => signIn(githubAuthProvider, 'Github')}> |
| 72 | + <FaGithub /> |
| 73 | + Connect with Github |
| 74 | + </button> |
| 75 | + <button |
| 76 | + className="extraTextWithIconBtn" |
| 77 | + onClick={() => signIn(googleAuthProvider, 'Google')}> |
| 78 | + <FcGoogle /> |
| 79 | + Connect with Google |
| 80 | + </button> |
| 81 | + </div> |
| 82 | + <p className="description"> |
| 83 | + We use your account to save your settings and track streaks for rowards 🎁 ... or risk |
| 84 | + losing them like unusaved code! |
| 85 | + </p> |
83 | 86 | </ReactModal> |
84 | 87 | ) |
85 | 88 | } |
0 commit comments