Add systemFont preference
This commit is contained in:
parent
500165c478
commit
394aaaf23f
|
@ -4,6 +4,7 @@ import React from 'react';
|
||||||
import { Provider, connect } from 'react-redux';
|
import { Provider, connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Helmet from 'gabsocial/components/helmet';
|
import Helmet from 'gabsocial/components/helmet';
|
||||||
|
import classNames from 'classnames';
|
||||||
import configureStore from '../store/configureStore';
|
import configureStore from '../store/configureStore';
|
||||||
import { INTRODUCTION_VERSION } from '../actions/onboarding';
|
import { INTRODUCTION_VERSION } from '../actions/onboarding';
|
||||||
import { Switch, BrowserRouter, Route } from 'react-router-dom';
|
import { Switch, BrowserRouter, Route } from 'react-router-dom';
|
||||||
|
@ -42,6 +43,7 @@ const mapStateToProps = (state) => {
|
||||||
showIntroduction,
|
showIntroduction,
|
||||||
me,
|
me,
|
||||||
theme: state.getIn(['settings', 'theme']),
|
theme: state.getIn(['settings', 'theme']),
|
||||||
|
systemFont: state.getIn(['settings', 'systemFont']),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,10 +54,11 @@ class GabSocialMount extends React.PureComponent {
|
||||||
showIntroduction: PropTypes.bool,
|
showIntroduction: PropTypes.bool,
|
||||||
me: PropTypes.string,
|
me: PropTypes.string,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
|
systemFont: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { me, theme } = this.props;
|
const { me, theme, systemFont } = this.props;
|
||||||
if (me === null) return null;
|
if (me === null) return null;
|
||||||
|
|
||||||
// Disabling introduction for launch
|
// Disabling introduction for launch
|
||||||
|
@ -65,9 +68,15 @@ class GabSocialMount extends React.PureComponent {
|
||||||
// return <Introduction />;
|
// return <Introduction />;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
const bodyClass = classNames('app-body', {
|
||||||
|
[`theme-${theme}`]: theme,
|
||||||
|
'system-font': systemFont,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
|
<body className={bodyClass} />
|
||||||
{theme && <link rel='stylesheet' href={`/packs/css/${theme}.chunk.css`} />}
|
{theme && <link rel='stylesheet' href={`/packs/css/${theme}.chunk.css`} />}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<BrowserRouter basename='/web'>
|
<BrowserRouter basename='/web'>
|
||||||
|
|
|
@ -132,6 +132,10 @@ class Preferences extends ImmutablePureComponent {
|
||||||
label='Reduce motion in animations'
|
label='Reduce motion in animations'
|
||||||
path={['reduceMotion']}
|
path={['reduceMotion']}
|
||||||
/>
|
/>
|
||||||
|
<SettingsCheckbox
|
||||||
|
label="Use system's default font"
|
||||||
|
path={['systemFont']}
|
||||||
|
/>
|
||||||
</FieldsGroup>
|
</FieldsGroup>
|
||||||
</SimpleForm>
|
</SimpleForm>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
|
@ -22,6 +22,8 @@ const initialState = ImmutableMap({
|
||||||
defaultPrivacy: 'public',
|
defaultPrivacy: 'public',
|
||||||
theme: 'lime',
|
theme: 'lime',
|
||||||
|
|
||||||
|
systemFont: false,
|
||||||
|
|
||||||
home: ImmutableMap({
|
home: ImmutableMap({
|
||||||
shows: ImmutableMap({
|
shows: ImmutableMap({
|
||||||
reblog: true,
|
reblog: true,
|
||||||
|
|
Loading…
Reference in New Issue