create settings section header component

This commit is contained in:
ghalestrilo 2020-06-23 17:03:51 -03:00
parent 181e832bfd
commit a9c17b5267
2 changed files with 12 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import { prop } from '../../theme';
const PreferenceTitle = styled.h4.attrs(props => ({ ...props, className: 'preference__title' }))` const PreferenceTitle = styled.h4.attrs(props => ({ ...props, className: 'preference__title' }))`
color: ${prop('primaryTextColor')} !important; color: ${prop('primaryTextColor')};
`; `;
const Preference = styled.div.attrs(props => ({ ...props, className: 'preference' }))` const Preference = styled.div.attrs(props => ({ ...props, className: 'preference' }))`

View file

@ -12,7 +12,7 @@ import Screen from '../../components/mobile/MobileScreen';
import Header from '../../components/mobile/Header'; import Header from '../../components/mobile/Header';
import Selector from '../../components/mobile/Selector'; import Selector from '../../components/mobile/Selector';
import { ExitIcon } from '../../common/icons'; import { ExitIcon } from '../../common/icons';
import { remSize } from '../../theme'; import { remSize, prop } from '../../theme';
const IconLinkWrapper = styled(Link)` const IconLinkWrapper = styled(Link)`
width: 3rem; width: 3rem;
@ -30,12 +30,17 @@ const SettingsHeader = styled(Header)`
background: transparent background: transparent
`; `;
const SectionHeader = styled.h2`
color: ${prop('primaryTextColor')};
padding-top: 2rem
`;
const MobilePreferences = (props) => { const MobilePreferences = (props) => {
const { setTheme, setAutosave, setLinewrap } = props; const { setTheme, setAutosave, setLinewrap } = props;
const { theme, autosave, linewrap } = props; const { theme, autosave, linewrap } = props;
const preferences = [ const generalSettings = [
{ {
title: 'Theme', title: 'Theme',
value: theme, value: theme,
@ -95,12 +100,14 @@ const MobilePreferences = (props) => {
<IconLinkWrapper to="/mobile" aria-label="Return to ide view"> <IconLinkWrapper to="/mobile" aria-label="Return to ide view">
<ExitIcon /> <ExitIcon />
</IconLinkWrapper> </IconLinkWrapper>
</div> </div>
</SettingsHeader> </SettingsHeader>
<section className="preferences"> <section className="preferences">
<Content> <Content>
{ preferences.map(option => <Selector key={`${option.title}wrapper`} {...option} />) } <SectionHeader>General Settings</SectionHeader>
{ generalSettings.map(option => <Selector key={`${option.title}wrapper`} {...option} />) }
<SectionHeader>Accessibility</SectionHeader>
</Content> </Content>
</section> </section>
</section> </section>