File tree Expand file tree Collapse file tree 6 files changed +27
-8
lines changed Expand file tree Collapse file tree 6 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 7
7
title: string ;
8
8
subtitle? : string ;
9
9
oauthText? : string ;
10
+ oauthMode? : ' signin' | ' signup' ;
10
11
bottomLinkText? : string ;
11
12
bottomLinkHref? : string ;
12
13
bottomLinkLabel? : string ;
17
18
title,
18
19
subtitle,
19
20
oauthText = ' Or continue with' ,
21
+ oauthMode = ' signin' ,
20
22
bottomLinkText,
21
23
bottomLinkHref,
22
24
bottomLinkLabel,
41
43
<span class ="text-12" >{oauthText }</span >
42
44
</div >
43
45
44
- <OAuthButtons />
46
+ <OAuthButtons mode ={ oauthMode } />
45
47
</div >
46
48
47
49
{#if bottomLinkText && bottomLinkHref && bottomLinkLabel }
Original file line number Diff line number Diff line change 6
6
interface Props {
7
7
title: string ;
8
8
children: Snippet ;
9
+ showBackLink? : boolean ;
9
10
}
10
11
11
- let { title, children }: Props = $props ();
12
+ let { title, children, showBackLink = true }: Props = $props ();
12
13
13
14
const routesService = inject (WEB_ROUTES_SERVICE );
14
15
</script >
21
22
22
23
<div class =" text-12 service-form__footer" >
23
24
<p >
24
- ← Back to
25
- <a href ={routesService .loginPath ()}>Login</a >
25
+ {#if showBackLink }
26
+ ← Back to
27
+ <a href ={routesService .loginPath ()}>Login</a >
28
+ {/if }
26
29
</p >
30
+
27
31
<p >
28
32
Need help?
29
33
<a
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { env } from ' $env/dynamic/public' ;
3
+
4
+ interface Props {
5
+ mode? : ' signin' | ' signup' ;
6
+ }
7
+
8
+ let { mode = ' signin' }: Props = $props ();
9
+
10
+ const actionText = mode === ' signup' ? ' Sign up' : ' Sign in' ;
3
11
</script >
4
12
5
13
<div class =" oauth-buttons" >
6
14
{#snippet oauthButton (provider : ' github' | ' google' )}
7
15
{@const config = {
8
16
github: {
9
17
endpoint: ' auth/github' ,
10
- title: ' Sign in with GitHub' ,
18
+ title: ` ${ actionText } with GitHub` ,
11
19
label: ' GitHub' ,
12
20
svg: ` <svg class="oauth-logo" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
13
21
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#000"/>
14
22
</svg> `
15
23
},
16
24
google: {
17
25
endpoint: ' auth/google_oauth2' ,
18
- title: ' Sign in with Google' ,
26
+ title: ` ${ actionText } with Google` ,
19
27
label: ' Google' ,
20
28
svg: ` <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="oauth-logo">
21
29
<path 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" fill="#4285f4"></path>
55
63
align-items : center;
56
64
justify-content : center;
57
65
padding : 8 px ;
66
+ padding-right : 14 px ;
58
67
gap : 8 px ;
59
68
border : 1 px solid var (--clr-border-2 );
60
69
border-radius : var (--radius-m );
Original file line number Diff line number Diff line change 152
152
const isCommitPage = $derived (page .url .pathname .includes (' /commit/' ));
153
153
const isLoginPage = $derived (page .url .pathname .includes (' /login' ));
154
154
const isSignupPage = $derived (page .url .pathname .includes (' /signup' ));
155
- const hasNavigation = $derived (! isCommitPage && ! isLoginPage && ! isSignupPage );
156
- const isFullScreen = $derived (isLoginPage || isSignupPage );
155
+ const isFinalized = $derived (page .url .pathname .includes (' /finalize' ));
156
+ const hasNavigation = $derived (! isCommitPage && ! isLoginPage && ! isSignupPage && ! isFinalized );
157
+ const isFullScreen = $derived (isLoginPage || isSignupPage || isFinalized );
157
158
</script >
158
159
159
160
<RedirectIfNotFinalized />
179
180
flex-direction : column;
180
181
width : 100 % ;
181
182
min-height : 100 vh ;
183
+ margin : 0 auto;
182
184
padding : 24 px var (--layout-side-paddings );
183
185
&:not (.full-screen ) {
184
186
max-width : calc (1440 px + var (--layout-side-paddings ) * 2 );
Original file line number Diff line number Diff line change 74
74
title =" Login"
75
75
subtitle =" to GitButler"
76
76
oauthText =" Or log in with"
77
+ oauthMode =" signin"
77
78
bottomLinkText =" Don't have an account?"
78
79
bottomLinkHref ={routesService .signupPath ()}
79
80
bottomLinkLabel =" Sign Up now"
Original file line number Diff line number Diff line change 63
63
title =" Sign Up"
64
64
subtitle =" for GitButler"
65
65
oauthText =" Or sign up with"
66
+ oauthMode =" signup"
66
67
bottomLinkText =" Already have an account?"
67
68
bottomLinkHref ={routesService .loginPath ()}
68
69
bottomLinkLabel =" Log in"
You can’t perform that action at this time.
0 commit comments