Skip to content

Commit 73beab2

Browse files
committed
feat: add AuthDialog styles and update component references
- Introduced AuthDialog.scss for styling the authentication modal, enhancing the UI with a structured layout and responsive design. - Updated AuthDialog component to use new styles and replaced references from AuthModal to AuthDialog. - Integrated new icon components (GoogleIcon, GithubIcon, DiscordIcon) for improved visual consistency in the authentication buttons.
1 parent 76d0991 commit 73beab2

File tree

3 files changed

+39
-129
lines changed

3 files changed

+39
-129
lines changed
Lines changed: 28 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,10 @@
22
@import './Modal.scss';
33

44
.auth-modal {
5-
&__content {
6-
position: relative;
7-
z-index: 1;
8-
padding: 20px;
9-
margin: 12px;
10-
padding-top: 0px;
11-
padding-bottom: 0px;
12-
}
13-
145
&__title-container {
156
display: flex;
167
align-items: center;
17-
gap: 0.5rem;
18-
}
198

20-
&__separator {
21-
width: 100%;
22-
height: 1.5px;
23-
background: rgba(120, 120, 120, 0.25);
24-
margin: 0.75rem auto 1.5rem auto;
25-
border: none;
26-
border-radius: 1px;
279
}
2810

2911
&__title {
@@ -33,22 +15,21 @@
3315
color: white;
3416
text-align: center;
3517
display: inline-block;
36-
margin-bottom: 10px;
3718

3819
&-dot {
3920
color: #fa8933;
4021
}
4122
}
4223

4324
&__description {
44-
margin-top: 35px;
45-
margin-bottom: 35px;
4625
color: #a0a0a9;
47-
font-size: 16px;
26+
font-size: 18px;
4827
line-height: 1.5;
4928
text-align: center;
5029
white-space: pre-line;
51-
max-width: 270px;
30+
padding: 0 90px;
31+
margin-bottom: 40px;
32+
margin-top: 40px;
5233

5334
.highlight {
5435
color: #cfcfcf;
@@ -61,60 +42,53 @@
6142
align-items: center;
6243
flex-direction: column;
6344
gap: 13px;
64-
margin-top: 30px;
6545
margin-bottom: 40px;
66-
}
6746

68-
&__button {
69-
display: flex;
70-
align-items: center;
71-
justify-content: center;
72-
gap: 8px;
73-
width: 85%;
74-
height: 44px;
75-
border-radius: 6px;
76-
font-size: 15px;
77-
font-weight: 500;
78-
transition: all 0.2s ease;
79-
cursor: pointer;
80-
81-
&--outline {
82-
border: 1px solid #3a3a43;
83-
background-color: #2a2a33;
47+
button {
48+
display: flex;
49+
align-items: center;
50+
justify-content: center;
51+
gap: 8px;
52+
width: 85%;
53+
height: 44px;
54+
border-radius: 6px;
55+
border: 1px solid #727279;
56+
font-size: 15px;
57+
font-weight: 500;
58+
transition: all 0.2s ease;
59+
cursor: pointer;
60+
background-color: #464652;
8461
color: white;
85-
}
86-
87-
&--primary {
88-
border: none;
89-
background-color: white;
90-
color: #232329;
62+
63+
&:hover {
64+
border: 1px solid #cc6d24;
65+
}
9166
}
9267
}
9368

9469
&__footer {
70+
9571
display: flex;
9672
justify-content: center;
9773
align-items: center;
98-
gap: 12px;
99-
font-size: 14px;
100-
color: #6b7280;
74+
gap: 16px;
75+
color: #a0a0a0;
76+
margin-bottom: 10px;
10177

10278
&-link {
10379
display: flex;
10480
align-items: center;
105-
color: #6b7280;
106-
text-decoration: none;
81+
color: #b8723c !important;
10782
font-size: 14px;
10883
transition: color 0.15s;
10984

11085
&:hover {
111-
color: #a0a0a0;
86+
color: #a0a0a0 !important;
11287
}
11388
}
11489
}
11590

11691
&__warning {
117-
margin-top: 15px;
11892
text-align: center;
11993
color: #606060bd;
12094
font-size: 12px;

src/frontend/src/styles/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import './fonts.scss';
22
@import './HtmlEditor.scss';
33
@import './Editor.scss';
4-
@import './AuthModal.scss';
4+
@import './AuthDialog.scss';
55
@import './FeedbackButton.scss';
66
@import './DiscordButton.scss';
77
@import './MainMenuLabel.scss';

src/frontend/src/ui/AuthDialog.tsx

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, { useState, useEffect } from "react";
22
import { capture } from "../utils/posthog";
33
import { Mail } from "lucide-react";
44
import { queryClient } from "../api/queryClient";
5+
import { GoogleIcon, GithubIcon, DiscordIcon } from "../icons";
56

6-
import "../styles/AuthModal.scss";
77
import { Dialog } from "@atyrode/excalidraw";
88

99
interface AuthDialogProps {
@@ -14,8 +14,8 @@ interface AuthDialogProps {
1414
}
1515

1616
export const AuthDialog = ({
17-
description = <>Welcome to your <strong className="highlight">whiteboard IDE</strong>. Open <strong className="highlight">terminals</strong> and start coding right away in your own <strong className="highlight">Ubuntu VM</strong>!</>,
18-
warningText = "🚧 This is a beta. Make backups! 🚧",
17+
description = <>Welcome to your <strong className="highlight">whiteboard IDE</strong>. <br /><br /> Open <strong className="highlight">terminals</strong> and start coding right away in your own <strong className="highlight">Ubuntu VM</strong>!</>,
18+
warningText = "This is a beta. Backup your work!",
1919
onClose,
2020
children,
2121
}: AuthDialogProps) => {
@@ -54,14 +54,12 @@ export const AuthDialog = ({
5454
// Prepare the content for the Dialog
5555
const dialogContent = (
5656
<div className="auth-modal__content">
57-
<div className="auth-modal__separator" />
5857

5958
<p className="auth-modal__description">{description}</p>
6059

6160
{/* Sign-in buttons */}
6261
<div className="auth-modal__buttons">
6362
<button
64-
className="auth-modal__button auth-modal__button--primary"
6563
onClick={() => {
6664
window.open(
6765
"/auth/login?kc_idp_hint=google&popup=1",
@@ -70,36 +68,11 @@ export const AuthDialog = ({
7068
);
7169
}}
7270
>
73-
<svg
74-
className="google-icon"
75-
width="20"
76-
height="20"
77-
viewBox="0 0 24 24"
78-
fill="currentColor"
79-
>
80-
<path
81-
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
82-
fill="#4285F4"
83-
/>
84-
<path
85-
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
86-
fill="#34A853"
87-
/>
88-
<path
89-
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
90-
fill="#FBBC05"
91-
/>
92-
<path
93-
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
94-
fill="#EA4335"
95-
/>
96-
<path d="M1 1h22v22H1z" fill="none" />
97-
</svg>
71+
<GoogleIcon className="google-icon" />
9872
<span>Continue with Google</span>
9973
</button>
10074

10175
<button
102-
className="auth-modal__button auth-modal__button--outline"
10376
onClick={() => {
10477
window.open(
10578
"/auth/login?kc_idp_hint=github&popup=1",
@@ -108,56 +81,19 @@ export const AuthDialog = ({
10881
);
10982
}}
11083
>
111-
<svg
112-
xmlns="http://www.w3.org/2000/svg"
113-
width="20"
114-
height="20"
115-
viewBox="0 0 24 24"
116-
fill="none"
117-
stroke="currentColor"
118-
strokeWidth="2"
119-
strokeLinecap="round"
120-
strokeLinejoin="round"
121-
>
122-
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" />
123-
<path d="M9 18c-4.51 2-5-2-7-2" />
124-
</svg>
84+
<GithubIcon />
12585
<span>Continue with GitHub</span>
12686
</button>
12787
</div>
12888

12989
{/* Footer */}
13090
<div className="auth-modal__footer">
13191
<a href="https://discord.com/invite/NnXSESxWpA" className="auth-modal__footer-link" target="_blank" rel="noopener noreferrer">
132-
<svg
133-
width="20"
134-
height="20"
135-
viewBox="0 0 71 55"
136-
fill="none"
137-
xmlns="http://www.w3.org/2000/svg"
138-
>
139-
<path
140-
d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z"
141-
fill="currentColor"
142-
/>
143-
</svg>
92+
<DiscordIcon />
14493
</a>
14594
|
14695
<a href="https://github.com/pad-ws/pad.ws" className="auth-modal__footer-link" target="_blank" rel="noopener noreferrer">
147-
<svg
148-
xmlns="http://www.w3.org/2000/svg"
149-
width="20"
150-
height="20"
151-
viewBox="0 0 24 24"
152-
fill="none"
153-
stroke="currentColor"
154-
strokeWidth="2"
155-
strokeLinecap="round"
156-
strokeLinejoin="round"
157-
>
158-
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" />
159-
<path d="M9 18c-4.51 2-5-2-7-2" />
160-
</svg>
96+
<GithubIcon />
16197
</a>
16298
|
16399
<a href="mailto:contact@pad.ws" className="auth-modal__footer-link" target="_blank" rel="noopener noreferrer">
@@ -177,15 +113,15 @@ export const AuthDialog = ({
177113
{modalIsShown && (
178114
<Dialog
179115
className="auth-modal"
180-
size="regular"
116+
size="small"
181117
onCloseRequest={handleClose}
182118
title={
183119
<div id="modal-title" className="auth-modal__title-container">
184-
<img
120+
{/* <img
185121
src="/assets/images/favicon.png"
186122
alt="pad.ws logo"
187123
className="auth-modal__logo"
188-
/>
124+
/> */}
189125
<h2 className="auth-modal__title">pad<span className="auth-modal__title-dot">.ws</span></h2>
190126
</div>
191127
}

0 commit comments

Comments
 (0)