Skip to content

Commit 217c9a9

Browse files
committed
feat: New AuthModal ui.
1 parent 4a0c08e commit 217c9a9

4 files changed

Lines changed: 59 additions & 31 deletions

File tree

src/assets/App.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ a {
122122
}
123123

124124
.extras {
125-
display: flex;
125+
display: nore;
126126
flex-direction: row;
127127
align-content: center;
128128
order: 2;

src/components/Layout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const AppLayout = () => {
1616

1717
<div className="App">
1818
<Header />
19-
<AuthModal showAuth={isAuthModalOpen} closeModal={closeAuthModal} />
19+
<AuthModal showAuth={isAuthModalOpen} />
2020
<React.Suspense
2121
fallback={
2222
<div className="appLoading">
Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
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'
35
import ReactModal from 'react-modal'
46
import toast from 'react-simple-toasts'
57
import { useAuth } from 'src/features/auth'
68
import { firebaseAuth, githubAuthProvider, googleAuthProvider } from 'src/lib/firebase'
9+
import './authModal.css'
710

811
type AuthModalProps = {
912
showAuth: boolean
10-
closeModal: () => void
1113
}
1214

13-
export const AuthModal = ({ showAuth, closeModal }: AuthModalProps) => {
15+
export const AuthModal = ({ showAuth }: AuthModalProps) => {
1416
const { closeAuthModal, initState } = useAuth()
1517

1618
const signIn = (provider: AuthProvider, providerName: string) => {
@@ -46,40 +48,41 @@ export const AuthModal = ({ showAuth, closeModal }: AuthModalProps) => {
4648
shouldCloseOnEsc={true}
4749
shouldCloseOnOverlayClick={true}
4850
shouldFocusAfterRender={false}
49-
onRequestClose={closeModal}
51+
onRequestClose={closeAuthModal}
5052
contentLabel="Auth"
51-
className="Modal scrollable"
53+
className="Modal authModal"
5254
style={{
5355
overlay: {
5456
zIndex: 3,
5557
},
5658
}}
5759
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>
8267
</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>
8386
</ReactModal>
8487
)
8588
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.authModal {
2+
display: flex;
3+
flex-direction: column;
4+
row-gap: 30px;
5+
overflow-y: hidden;
6+
}
7+
8+
.authModal .titleAndCloseBtn {
9+
display: flex;
10+
flex-direction: row;
11+
align-items: center;
12+
justify-content: space-between;
13+
}
14+
15+
.authModal .buttons {
16+
display: flex;
17+
flex-direction: column;
18+
row-gap: 16px;
19+
margin: auto;
20+
}
21+
22+
.authModal .description {
23+
margin: 20px 100px;
24+
text-align: center;
25+
}

0 commit comments

Comments
 (0)