11---
2+ import Icon from " ~/components/Icon.astro" ;
23import { auth as betterAuth } from " ~/lib/auth" ;
34
45const auth = betterAuth (
@@ -20,7 +21,9 @@ const session = await auth.api.getSession({
2021 src = { session .user .image }
2122 />
2223 ) : (
23- <button id = " login" ><svg xmlns = " http://www.w3.org/2000/svg" width = " 32" height = " 32" viewBox = " 0 0 24 24" ><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><g fill = " none" stroke = " currentColor" stroke-width = " 1.5" ><path stroke-linecap = " round" d = " M8 16c0 2.828 0 4.243.879 5.121C9.757 22 11.172 22 14 22h1c2.828 0 4.243 0 5.121-.879C21 20.243 21 18.828 21 16V8c0-2.828 0-4.243-.879-5.121C19.243 2 17.828 2 15 2h-1c-2.828 0-4.243 0-5.121.879C8 3.757 8 5.172 8 8" /><path d = " M8 19.5c-2.357 0-3.536 0-4.268-.732C3 18.035 3 16.857 3 14.5v-5c0-2.357 0-3.536.732-4.268S5.643 4.5 8 4.5" opacity = " .5" /><path stroke-linecap = " round" stroke-linejoin = " round" d = " M6 12h9m0 0l-2.5 2.5M15 12l-2.5-2.5" /></g ></svg ></button >
24+ <button id = " login" >
25+ <Icon />
26+ </button >
2427 )
2528}
2629
@@ -38,37 +41,37 @@ const session = await auth.api.getSession({
3841</script >
3942
4043<style >
41- #login {
42- width: 2rem;
43- height: 2rem;
44- border-radius: 50%;
45- display: flex;
46- align-items: center;
47- justify-content: center;
48- padding: 0;
49- background: linear-gradient(135deg, #e6e6e6 0%, #ffffff 50%, #e6e6e6 100%);
50- border: none;
51- color: #666;
52- cursor: pointer;
53- }
54-
55- @media (prefers-color-scheme: dark) {
5644 #login {
57- background: linear-gradient(
58- 135deg,
59- rgba(255,255,255,0.10) 0%,
60- rgba(255,255,255,0.18) 50%,
61- rgba(255,255,255,0.10) 100%
62- );
63- color: #eee;
45+ width: 2rem;
46+ height: 2rem;
47+ border-radius: 50%;
48+ display: flex;
49+ align-items: center;
50+ justify-content: center;
51+ padding: 0;
52+ background: linear-gradient(135deg, #e6e6e6 0%, #ffffff 50%, #e6e6e6 100%);
53+ border: none;
54+ color: #666;
55+ cursor: pointer;
6456 }
65- }
6657
67- #login svg {
68- width: 1.25rem;
69- height: 1.25rem;
70- display: block;
71- }
58+ @media (prefers-color-scheme: dark) {
59+ #login {
60+ background: linear-gradient(
61+ 135deg,
62+ rgba(255, 255, 255, 0.1) 0%,
63+ rgba(255, 255, 255, 0.18) 50%,
64+ rgba(255, 255, 255, 0.1) 100%
65+ );
66+ color: #eee;
67+ }
68+ }
69+
70+ #login svg {
71+ width: 1.25rem;
72+ height: 1.25rem;
73+ display: block;
74+ }
7275 #logout {
7376 cursor: pointer;
7477 }
0 commit comments