Skip to content

Commit bc4e21d

Browse files
committed
feat(dependencies): add @iconify-json/simple-icons and update auth routes
- Added @iconify-json/simple-icons version 1.2.57 to pnpm-lock.yaml and package.json. - Changed the sign-up endpoint from '/sign-in/email' to '/sign-up/email' in AuthController. - Enhanced SocialAuthButtons component with improved styling and accessibility features. - Updated login page layout and error message presentation for better user experience. Signed-off-by: Innei <tukon479@gmail.com>
1 parent 129682d commit bc4e21d

File tree

6 files changed

+62
-42
lines changed

6 files changed

+62
-42
lines changed

be/apps/core/src/modules/auth/auth.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class AuthController {
177177
return response
178178
}
179179

180-
@Post('/sign-in/email')
180+
@Post('/sign-up/email')
181181
async signUpEmail(@ContextParam() context: Context, @Body() body: TenantSignUpRequest) {
182182
if (!body?.account) {
183183
throw new BizException(ErrorCode.COMMON_BAD_REQUEST, { message: '缺少注册账号信息' })

be/apps/dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"devDependencies": {
6060
"@egoist/tailwindcss-icons": "1.9.0",
6161
"@iconify-json/mingcute": "1.2.5",
62+
"@iconify-json/simple-icons": "1.2.57",
6263
"@tailwindcss/container-queries": "0.1.1",
6364
"@tailwindcss/postcss": "4.1.16",
6465
"@tailwindcss/typography": "0.5.19",

be/apps/dashboard/src/modules/auth/components/SocialAuthButtons.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Button } from '@afilmory/ui'
21
import { cx } from '@afilmory/utils'
32
import { memo, useCallback, useMemo } from 'react'
43

@@ -66,26 +65,37 @@ export const SocialAuthButtons = memo(function SocialAuthButtons({
6665
return null
6766
}
6867

69-
const containerClass = layout === 'row' ? 'flex flex-wrap gap-2' : 'grid gap-2 sm:grid-cols-2'
68+
const containerClass = layout === 'row' ? 'flex flex-wrap justify-center gap-3' : 'grid gap-2 sm:grid-cols-2'
69+
70+
const providerIconColors: Record<string, string> = {
71+
github: 'text-[#181717] dark:text-white',
72+
google: 'text-[#4285F4]',
73+
}
7074

7175
return (
7276
<div className={cx('space-y-3', className)}>
7377
{title ? <p className="text-text-tertiary text-xs uppercase tracking-wide">{title}</p> : null}
7478
<div className={containerClass}>
7579
{providers.map((provider) => (
76-
<Button
80+
<button
7781
key={provider.id}
7882
type="button"
79-
variant="ghost"
80-
size="md"
81-
className="justify-start gap-3"
83+
className={cx(
84+
'inline-flex items-center justify-center',
85+
'size-11 rounded-full',
86+
'border border-fill-tertiary bg-background',
87+
'transition-all duration-200',
88+
'hover:border-text/30 hover:bg-fill/50 hover:scale-110',
89+
'active:scale-95',
90+
'focus:outline-none focus:ring-2 focus:ring-accent/40',
91+
'disabled:opacity-50 disabled:cursor-not-allowed',
92+
)}
8293
onClick={() => handleSocialClick(provider.id)}
94+
title={`Continue with ${provider.name}`}
95+
aria-label={`Continue with ${provider.name}`}
8396
>
84-
<span className="flex items-center gap-3">
85-
<i className={cx('text-lg', provider.icon)} aria-hidden />
86-
<span>{provider.name}</span>
87-
</span>
88-
</Button>
97+
<i className={cx('text-xl', provider.icon, providerIconColors[provider.id] || 'text-text')} aria-hidden />
98+
</button>
8999
))}
90100
</div>
91101
</div>

be/apps/dashboard/src/pages/(onboarding)/login.tsx

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ export function Component() {
3737
<div className="bg-background flex flex-1 items-center justify-center">
3838
<LinearBorderContainer>
3939
<form onSubmit={handleSubmit} className="bg-background-tertiary relative w-[600px]">
40-
<div className="p-12">
41-
<h1 className="text-text mb-10 text-3xl font-bold">Login</h1>
42-
43-
<SocialAuthButtons className="mb-8" />
40+
<div className="p-10">
41+
{/* Header */}
42+
<div className="mb-8">
43+
<h1 className="text-text mb-2 text-3xl font-bold">Login</h1>
44+
<p className="text-text-secondary text-sm">Enter your credentials to access the dashboard</p>
45+
</div>
4446

4547
{/* Error Message */}
4648
{error && (
@@ -49,19 +51,22 @@ export function Component() {
4951
animate={{ opacity: 1, height: 'auto' }}
5052
exit={{ opacity: 0, height: 0 }}
5153
transition={Spring.presets.snappy}
52-
className="border-red/60 bg-red/10 mb-6 rounded-lg border px-4 py-3"
54+
className="border-red/60 bg-red/10 mb-6 rounded-lg border px-4 py-3.5"
5355
>
54-
<p className="text-red text-sm">{error}</p>
56+
<div className="flex items-start gap-3">
57+
<i className="i-lucide-circle-alert text-red mt-0.5 text-base" />
58+
<p className="text-red flex-1 text-sm">{error}</p>
59+
</div>
5560
</m.div>
5661
)}
5762

5863
{/* Email Field */}
59-
<div className="mb-6 space-y-2">
64+
<div className="mb-5 space-y-2">
6065
<Label htmlFor="email">Email</Label>
6166
<Input
6267
id="email"
6368
type="email"
64-
placeholder="Enter your email"
69+
placeholder="your.email@example.com"
6570
value={email}
6671
onChange={handleEmailChange}
6772
disabled={isLoading}
@@ -72,7 +77,7 @@ export function Component() {
7277
</div>
7378

7479
{/* Password Field */}
75-
<div className="mb-8 space-y-2">
80+
<div className="mb-6 space-y-2">
7681
<Label htmlFor="password">Password</Label>
7782
<Input
7883
id="password"
@@ -99,27 +104,18 @@ export function Component() {
99104
Sign In
100105
</Button>
101106

102-
{/* Additional Links */}
103-
{/* <div className="mt-6 flex items-center justify-between text-sm">
104-
<Button
105-
type="button"
106-
variant="ghost"
107-
size="sm"
108-
className="text-text-tertiary hover:text-accent"
109-
disabled={isLoading}
110-
>
111-
Forgot password?
112-
</Button>
113-
<Button
114-
type="button"
115-
variant="ghost"
116-
size="sm"
117-
className="text-text-tertiary hover:text-accent"
118-
disabled={isLoading}
119-
>
120-
Create account
121-
</Button>
122-
</div> */}
107+
{/* OR Divider */}
108+
<div className="relative my-8">
109+
<div className="absolute inset-0 flex items-center">
110+
<div className="h-[0.5px] w-full bg-linear-to-r from-transparent via-text/20 to-transparent" />
111+
</div>
112+
<div className="relative flex justify-center text-xs uppercase">
113+
<span className="bg-background-tertiary px-3 text-text-tertiary tracking-wide">Or continue with</span>
114+
</div>
115+
</div>
116+
117+
{/* Social Auth Buttons */}
118+
<SocialAuthButtons layout="row" title="" />
123119
</div>
124120
</form>
125121
</LinearBorderContainer>

be/apps/dashboard/src/styles/tailwind.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,6 @@ body {
249249
@apply bg-background text-foreground;
250250
}
251251
}
252+
253+
@source inline('i-simple-icons-github');
254+
@source inline('i-simple-icons-google');

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)