Add systemFont preference

stable/1.0.x
Alex Gleason 2020-04-21 15:05:49 -05:00
rodzic 500165c478
commit 394aaaf23f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 16 dodań i 1 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import React from 'react';
import { Provider, connect } from 'react-redux';
import PropTypes from 'prop-types';
import Helmet from 'gabsocial/components/helmet';
import classNames from 'classnames';
import configureStore from '../store/configureStore';
import { INTRODUCTION_VERSION } from '../actions/onboarding';
import { Switch, BrowserRouter, Route } from 'react-router-dom';
@ -42,6 +43,7 @@ const mapStateToProps = (state) => {
showIntroduction,
me,
theme: state.getIn(['settings', 'theme']),
systemFont: state.getIn(['settings', 'systemFont']),
};
};
@ -52,10 +54,11 @@ class GabSocialMount extends React.PureComponent {
showIntroduction: PropTypes.bool,
me: PropTypes.string,
theme: PropTypes.string,
systemFont: PropTypes.bool,
};
render() {
const { me, theme } = this.props;
const { me, theme, systemFont } = this.props;
if (me === null) return null;
// Disabling introduction for launch
@ -65,9 +68,15 @@ class GabSocialMount extends React.PureComponent {
// return <Introduction />;
// }
const bodyClass = classNames('app-body', {
[`theme-${theme}`]: theme,
'system-font': systemFont,
});
return (
<>
<Helmet>
<body className={bodyClass} />
{theme && <link rel='stylesheet' href={`/packs/css/${theme}.chunk.css`} />}
</Helmet>
<BrowserRouter basename='/web'>

Wyświetl plik

@ -132,6 +132,10 @@ class Preferences extends ImmutablePureComponent {
label='Reduce motion in animations'
path={['reduceMotion']}
/>
<SettingsCheckbox
label="Use system's default font"
path={['systemFont']}
/>
</FieldsGroup>
</SimpleForm>
</Column>

Wyświetl plik

@ -22,6 +22,8 @@ const initialState = ImmutableMap({
defaultPrivacy: 'public',
theme: 'lime',
systemFont: false,
home: ImmutableMap({
shows: ImmutableMap({
reblog: true,