Skip to content

Commit ad3db32

Browse files
committed
🐛 fix settings text color
1 parent 167bbe8 commit ad3db32

File tree

2 files changed

+69
-52
lines changed

2 files changed

+69
-52
lines changed

client/components/mobile/Selector.jsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import styled from 'styled-components';
4+
import { prop } from '../../theme';
5+
6+
7+
const PreferenceTitle = styled.h4.attrs(props => ({ ...props, className: 'preference__title' }))`
8+
color: ${prop('primaryTextColor')} !important;
9+
`;
10+
11+
const Selector = ({
12+
title, value, onSelect, options,
13+
}) => (
14+
<div className="preference">
15+
{/* <h4 className="preference__title">{title}</h4> */}
16+
<PreferenceTitle>{title}</PreferenceTitle>
17+
{options.map(option => (
18+
<div className="preference__options" key={option.id}>
19+
<input
20+
type="radio"
21+
onChange={() => onSelect(option.value)}
22+
aria-label={option.ariaLabel}
23+
name={option.name}
24+
id={option.id}
25+
className="preference__radio-button"
26+
value={option.value}
27+
checked={value === option.value}
28+
/>
29+
<label htmlFor={option.id} className="preference__option">{option.label}</label>
30+
</div>))}
31+
</div>
32+
);
33+
34+
Selector.defaultProps = {
35+
options: []
36+
};
37+
38+
Selector.propTypes = {
39+
title: PropTypes.string.isRequired,
40+
value: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).isRequired,
41+
options: PropTypes.arrayOf(PropTypes.shape({
42+
id: PropTypes.string,
43+
name: PropTypes.string,
44+
label: PropTypes.string,
45+
ariaLabel: PropTypes.string,
46+
})),
47+
onSelect: PropTypes.func.isRequired,
48+
};
49+
50+
export default Selector;

client/modules/Mobile/MobilePreferences.jsx

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as IdeActions from '../IDE/actions/ide';
1010

1111
import Screen from '../../components/mobile/MobileScreen';
1212
import Header from '../../components/mobile/Header';
13+
import Selector from '../../components/mobile/Selector';
1314
import { ExitIcon } from '../../common/icons';
1415
import { 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

6529
const 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

Comments
 (0)