This repository was archived by the owner on Apr 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -228,20 +228,24 @@ const Styled = styled.label`
228
228
}
229
229
`
230
230
231
- const errorMessage = 'Please Enter a valid Github or GitLab repo Url! '
231
+ const errorMessage = 'Please Enter a valid GitLab, GitHub, or Bitbucket repo URL '
232
232
233
233
const PrefixInput = ( ) => {
234
234
const [ url , setUrl ] = useState < string > ( `https://github.com/gitpod-io/spring-petclinic` )
235
235
const [ error , setError ] = useState < string > ( '' )
236
236
237
237
const validateUrl = ( url : string ) => {
238
238
const lowerCaseUrl = url . toLowerCase ( )
239
- if ( ! ( lowerCaseUrl . includes ( 'github.com' ) || lowerCaseUrl . includes
240
- ( 'gitlab.com' ) ) ) {
241
- return false
242
- } else {
243
- return true
239
+ if ( lowerCaseUrl . includes ( 'github.com' ) ) {
240
+ return true ;
241
+ }
242
+ if ( lowerCaseUrl . includes ( 'gitlab.com' ) ) {
243
+ return true ;
244
+ }
245
+ if ( lowerCaseUrl . includes ( 'bitbucket.org' ) ) {
246
+ return true ;
244
247
}
248
+ return false ;
245
249
}
246
250
247
251
const handleChange = ( e : React . FormEvent < HTMLInputElement > ) => {
@@ -258,7 +262,7 @@ const PrefixInput = () => {
258
262
if ( e . key === 'Enter' ) {
259
263
const el = e . target as HTMLInputElement
260
264
if ( validateUrl ( el . value ) ) {
261
- window . open ( `https://gitpod.io#${ el . value } ` , '_blank' )
265
+ window . open ( `https://gitpod.io/ #${ el . value } ` , '_blank' )
262
266
setError ( '' )
263
267
} else {
264
268
setError ( errorMessage )
You can’t perform that action at this time.
0 commit comments