@@ -48,8 +48,8 @@ export function Login() {
48
48
const { setUser } = useContext ( UserContext ) ;
49
49
const { setTeams } = useContext ( TeamsContext ) ;
50
50
const urlHash = getURLHash ( ) ;
51
- const URLFromPrefix = urlHash ? new URL ( urlHash ) . host : null ;
52
- const showWelcome = ! hasLoggedInBefore ( ) && ! hasVisitedMarketingWebsiteBefore ( ) && urlHash . length === 0 ;
51
+ const URLFromPrefix = urlHash . length > 0 ? new URL ( urlHash ) . host : null ;
52
+ const showWelcome = ! hasLoggedInBefore ( ) && ! hasVisitedMarketingWebsiteBefore ( ) ;
53
53
54
54
const [ authProviders , setAuthProviders ] = useState < AuthProviderInfo [ ] > ( [ ] ) ;
55
55
const [ errorMessage , setErrorMessage ] = useState < string | undefined > ( undefined ) ;
@@ -116,25 +116,33 @@ export function Login() {
116
116
}
117
117
118
118
const renderWelcomeText = ( ) => {
119
- if ( showWelcome ) {
120
- return (
121
- < div className = "mx-auto text-center pb-8 space-y-2" >
122
- < h1 className = "text-3xl" > Log in to Gitpod</ h1 >
123
- < h2 className = "uppercase text-sm text-gray-400" > ALWAYS READY-TO-CODE</ h2 >
124
- </ div >
125
- )
126
- }
127
- return (
128
- < div className = "mx-auto text-center pb-8 space-y-2" >
119
+ if ( providerFromPrefix ) {
120
+ return ( < div className = "mx-auto text-center pb-8 space-y-2" >
129
121
< h1 className = "text-3xl" > Log in / Sign up</ h1 >
130
122
< h2 className = "text-m text-gray-400" > Open a cloud-based environment for</ h2 >
131
123
< h2 className = "text-m text-gray-400" > { urlHash } </ h2 >
124
+ </ div > )
125
+ }
126
+ return (
127
+ < div className = "mx-auto text-center pb-8 space-y-2" >
128
+ < h1 className = "text-3xl" > Log in{ showWelcome ? '' : ' to Gitpod' } </ h1 >
129
+ < h2 className = "uppercase text-sm text-gray-400" > ALWAYS READY-TO-CODE</ h2 >
132
130
</ div >
133
131
)
134
132
}
135
133
136
134
const renderAuthProviders = ( ) => {
137
- if ( showWelcome ) {
135
+ if ( providerFromPrefix ) {
136
+ return (
137
+ < div className = "flex flex-col space-y-3 items-center" >
138
+ < button key = { "button" + providerFromPrefix . host } className = "btn-login flex-none w-56 h-10 p-0 inline-flex" onClick = { ( ) => openLogin ( providerFromPrefix . host ) } >
139
+ { iconForAuthProvider ( providerFromPrefix . authProviderType ) }
140
+ < span className = "pt-2 pb-2 mr-3 text-sm my-auto font-medium truncate overflow-ellipsis" > Continue with { simplifyProviderName ( providerFromPrefix . host ) } </ span >
141
+ </ button >
142
+ </ div >
143
+ )
144
+ }
145
+ return (
138
146
< div className = "flex flex-col space-y-3 items-center" >
139
147
{ authProviders . map ( ap => {
140
148
return (
@@ -145,17 +153,7 @@ export function Login() {
145
153
) ;
146
154
} ) }
147
155
</ div >
148
- }
149
- if ( ! showWelcome && providerFromPrefix ) {
150
- return (
151
- < div className = "flex flex-col space-y-3 items-center" >
152
- < button key = { "button" + providerFromPrefix . host } className = "btn-login flex-none w-56 h-10 p-0 inline-flex" onClick = { ( ) => openLogin ( providerFromPrefix . host ) } >
153
- { iconForAuthProvider ( providerFromPrefix . authProviderType ) }
154
- < span className = "pt-2 pb-2 mr-3 text-sm my-auto font-medium truncate overflow-ellipsis" > Continue with { simplifyProviderName ( providerFromPrefix . host ) } </ span >
155
- </ button >
156
- </ div >
157
- )
158
- }
156
+ )
159
157
}
160
158
161
159
return ( < div id = "login-container" className = "z-50 flex w-screen h-screen" >
0 commit comments