@@ -10,6 +10,7 @@ import * as IdeActions from '../IDE/actions/ide';
1010
1111import Screen from '../../components/mobile/MobileScreen' ;
1212import Header from '../../components/mobile/Header' ;
13+ import Selector from '../../components/mobile/Selector' ;
1314import { ExitIcon } from '../../common/icons' ;
1415import { remSize } from '../../theme' ;
1516
@@ -24,43 +25,6 @@ const Content = styled.div`
2425 margin-top: ${ remSize ( 68 ) } ;
2526` ;
2627
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- } ;
6428
6529const SettingsHeader = styled ( Header ) `
6630 background: transparent
@@ -121,21 +85,24 @@ const MobilePreferences = (props) => {
12185 // useEffect(() => { });
12286
12387 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 >
139106 </ section >
140107 </ Screen > ) ;
141108} ;
0 commit comments