File tree 2 files changed +31
-3
lines changed
2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change
1
+ export interface OptionCardProps {
2
+ title : string ;
3
+ selected : boolean ;
4
+ onClick : ( ) => void ;
5
+ children ?: React . ReactNode ;
6
+ }
7
+
8
+ function OptionCard ( props : OptionCardProps ) {
9
+ return < div className = { `rounded-xl p-4 border-2 ${ props . selected ? 'border-green-500' : 'border-gray-300 hover:border-gray-400' } ` } >
10
+ < p className = { `text-base font-semibold ${ props . selected ? 'color-green-600' : 'color-gray-300 hover:color-gray-400' } ` } > { props . title } </ p >
11
+ { props . children }
12
+ </ div > ;
13
+ }
14
+
15
+ export default OptionCard ;
Original file line number Diff line number Diff line change
1
+ import { useContext , useState } from "react" ;
2
+ import OptionCard from "../components/OptionCard" ;
1
3
import { SettingsPage } from "../components/SettingsPage" ;
2
- import settingsMenu from './settings-menu' ;
4
+ // import { getGitpodService } from "../service/service";
5
+ import { UserContext } from "../user-context" ;
6
+ import settingsMenu from "./settings-menu" ;
3
7
4
8
export default function DefaultIDE ( ) {
9
+ const { user } = useContext ( UserContext ) ;
10
+ const [ defaultIde , setDefaultIde ] = useState < string > ( user ?. additionalData ?. ideSettings ?. defaultIde || 'code' ) ;
11
+
5
12
return < div >
6
13
< SettingsPage title = 'Default IDE' subtitle = 'Configure your default IDE' menuEntries = { settingsMenu } >
7
- < div className = "lg:px-28 px-10 flex pt-10" >
8
- Default IDE
14
+ < div className = "flex flex-col lg:flex-row" >
15
+ < div className = "pb-6" >
16
+ < div className = "pt-6" >
17
+ < OptionCard title = "Code" selected = { defaultIde === 'code' } onClick = { ( ) => setDefaultIde ( 'code' ) } > </ OptionCard >
18
+ < OptionCard title = "Theia" selected = { defaultIde === 'theia' } onClick = { ( ) => setDefaultIde ( 'theia' ) } > </ OptionCard >
19
+ < OptionCard title = "Custom" selected = { ! [ 'code' , 'theia' ] . includes ( defaultIde ) } onClick = { ( ) => setDefaultIde ( '' ) } > </ OptionCard >
20
+ </ div >
21
+ </ div >
9
22
</ div >
10
23
</ SettingsPage >
11
24
</ div > ;
You can’t perform that action at this time.
0 commit comments