@@ -10,6 +10,7 @@ import * as IdeActions from '../IDE/actions/ide';
10
10
11
11
import Screen from '../../components/mobile/MobileScreen' ;
12
12
import Header from '../../components/mobile/Header' ;
13
+ import Selector from '../../components/mobile/Selector' ;
13
14
import { ExitIcon } from '../../common/icons' ;
14
15
import { remSize } from '../../theme' ;
15
16
@@ -24,43 +25,6 @@ const Content = styled.div`
24
25
margin-top: ${ remSize ( 68 ) } ;
25
26
` ;
26
27
27
- const Selector = ( {
28
- title, value, onSelect, options,
29
- } ) => (
30
- < div className = "preference" >
31
- < h4 className = "preference__title" > { title } </ h4 >
32
- { options . map ( option => (
33
- < div className = "preference__options" key = { option . id } >
34
- < input
35
- type = "radio"
36
- onChange = { ( ) => onSelect ( option . value ) }
37
- aria-label = { option . ariaLabel }
38
- name = { option . name }
39
- id = { option . id }
40
- className = "preference__radio-button"
41
- value = { option . value }
42
- checked = { value === option . value }
43
- />
44
- < label htmlFor = { option . id } className = "preference__option" > { option . label } </ label >
45
- </ div > ) ) }
46
- </ div >
47
- ) ;
48
-
49
- Selector . defaultProps = {
50
- options : [ ]
51
- } ;
52
-
53
- Selector . propTypes = {
54
- title : PropTypes . string . isRequired ,
55
- value : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . string ] ) . isRequired ,
56
- options : PropTypes . arrayOf ( PropTypes . shape ( {
57
- id : PropTypes . string ,
58
- name : PropTypes . string ,
59
- label : PropTypes . string ,
60
- ariaLabel : PropTypes . string ,
61
- } ) ) ,
62
- onSelect : PropTypes . func . isRequired ,
63
- } ;
64
28
65
29
const SettingsHeader = styled ( Header ) `
66
30
background: transparent
@@ -121,21 +85,24 @@ const MobilePreferences = (props) => {
121
85
// useEffect(() => { });
122
86
123
87
return (
124
- < Screen >
125
- < SettingsHeader >
126
- < h1 > Settings</ h1 >
127
-
128
- < div style = { { marginLeft : '2rem' } } >
129
- < IconLinkWrapper to = "/mobile" aria-label = "Return to ide view" >
130
- < ExitIcon />
131
- </ IconLinkWrapper >
132
-
133
- </ div >
134
- </ SettingsHeader >
135
- < section className = "preferences" >
136
- < Content >
137
- { preferences . map ( option => < Selector key = { `${ option . title } wrapper` } { ...option } /> ) }
138
- </ Content >
88
+ < Screen fullscreen >
89
+ < section >
90
+
91
+ < SettingsHeader >
92
+ < h1 > Settings</ h1 >
93
+
94
+ < div style = { { marginLeft : '2rem' } } >
95
+ < IconLinkWrapper to = "/mobile" aria-label = "Return to ide view" >
96
+ < ExitIcon />
97
+ </ IconLinkWrapper >
98
+
99
+ </ div >
100
+ </ SettingsHeader >
101
+ < section className = "preferences" >
102
+ < Content >
103
+ { preferences . map ( option => < Selector key = { `${ option . title } wrapper` } { ...option } /> ) }
104
+ </ Content >
105
+ </ section >
139
106
</ section >
140
107
</ Screen > ) ;
141
108
} ;
0 commit comments