File tree Expand file tree Collapse file tree 7 files changed +71
-16
lines changed Expand file tree Collapse file tree 7 files changed +71
-16
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const Notifications = React.lazy(() => import('./settings/Notifications'));
14
14
const Plans = React . lazy ( ( ) => import ( './settings/Plans' ) ) ;
15
15
const EnvironmentVariables = React . lazy ( ( ) => import ( './settings/EnvironmentVariables' ) ) ;
16
16
const GitIntegrations = React . lazy ( ( ) => import ( './settings/GitIntegrations' ) ) ;
17
- const DefaultIDE = React . lazy ( ( ) => import ( './settings/DefaultIDE ' ) ) ;
17
+ const Preferences = React . lazy ( ( ) => import ( './settings/Preferences ' ) ) ;
18
18
19
19
function Loading ( ) {
20
20
return ( < h3 > Loading...</ h3 > ) ;
@@ -73,7 +73,7 @@ function App() {
73
73
< Route path = "/plans" exact component = { Plans } />
74
74
< Route path = "/variables" exact component = { EnvironmentVariables } />
75
75
< Route path = "/integrations" exact component = { GitIntegrations } />
76
- < Route path = "/default-ide " exact component = { DefaultIDE } />
76
+ < Route path = "/preferences " exact component = { Preferences } />
77
77
</ React . Fragment >
78
78
) }
79
79
</ Switch >
Original file line number Diff line number Diff line change
1
+ export interface OptionCardProps {
2
+ title : string ;
3
+ selected : boolean ;
4
+ className ?: string ;
5
+ onClick : ( ) => void ;
6
+ children ?: React . ReactNode ;
7
+ }
8
+
9
+ function OptionCard ( props : OptionCardProps ) {
10
+ return < div className = { `rounded-xl px-4 py-3 flex flex-col group border-2 ${ props . selected ? 'border-green-600' : 'border-gray-300 hover:border-gray-400' } ${ props . className || '' } ` } onClick = { props . onClick } >
11
+ < div className = "flex items-center" >
12
+ < p className = { `w-full text-base font-semibold ${ props . selected ? 'text-green-600' : 'text-gray-300 group-hover:text-gray-400' } ` } > { props . title } </ p >
13
+ < input type = "radio" checked = { props . selected } />
14
+ </ div >
15
+ { props . children }
16
+ </ div > ;
17
+ }
18
+
19
+ export default OptionCard ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { useContext , useState } from "react" ;
2
+ import OptionCard from "../components/OptionCard" ;
3
+ import { SettingsPage } from "../components/SettingsPage" ;
4
+ import { UserContext } from "../user-context" ;
5
+ import settingsMenu from "./settings-menu" ;
6
+
7
+ export default function Preferences ( ) {
8
+ const { user } = useContext ( UserContext ) ;
9
+ const [ defaultIde , setDefaultIde ] = useState < string > ( user ?. additionalData ?. ideSettings ?. defaultIde || 'code' ) ;
10
+
11
+ return < div >
12
+ < SettingsPage title = 'Preferences' subtitle = 'Configure your Default IDE for all workspaces.' menuEntries = { settingsMenu } >
13
+ < h3 > Default IDE</ h3 >
14
+ < p className = "text-base" > Gitpod is using Code as the default IDE.</ p >
15
+ < div className = "mt-4 space-x-4 flex" >
16
+ < OptionCard className = "w-36 h-40" title = "VS Code" selected = { defaultIde === 'code' } onClick = { ( ) => setDefaultIde ( 'code' ) } >
17
+ < div className = "flex-grow flex justify-center align-center" >
18
+ < img className = "w-16" src = "/images/vscode.svg" />
19
+ </ div >
20
+ </ OptionCard >
21
+ < OptionCard className = "w-36 h-40" title = "Theia" selected = { defaultIde === 'theia' } onClick = { ( ) => setDefaultIde ( 'theia' ) } >
22
+ < div className = "flex-grow flex justify-center align-center" >
23
+ < img className = "w-16" src = "/images/theia.svg" />
24
+ </ div >
25
+ </ OptionCard >
26
+ < OptionCard className = "w-36 h-40" title = "Custom" selected = { ! [ 'code' , 'theia' ] . includes ( defaultIde ) } onClick = { ( ) => setDefaultIde ( '' ) } > </ OptionCard >
27
+ </ div >
28
+ < div className = "mt-4" >
29
+ < label className = { [ 'code' , 'theia' ] . includes ( defaultIde ) ? 'opacity-0' : 'opacity-100' } >
30
+ < p className = "text-base text-gray-600 font-bold leading-5" > Custom IDE image name</ p >
31
+ < input className = "w-80 mt-1" type = "text" />
32
+ </ label >
33
+ </ div >
34
+ </ SettingsPage >
35
+ </ div > ;
36
+ }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default [
20
20
link : '/integrations'
21
21
} ,
22
22
{
23
- title : 'Default IDE ' ,
24
- link : '/default-ide '
23
+ title : 'Preferences ' ,
24
+ link : '/preferences '
25
25
} ,
26
26
] ;
You can’t perform that action at this time.
0 commit comments