modify default settings constant, use new constant when setting initial settings

main
briandennis 7 years ago committed by Brian Dennis
parent 91cf4b7734
commit d62145f727

@ -420,17 +420,23 @@ if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
} }
export const DEFAULT_SETTINGS = { export const DEFAULT_SETTINGS = {
paddingVertical: '50px', paddingVertical: '48px',
paddingHorizontal: '50px', paddingHorizontal: '32px',
marginVertical: '45px', marginVertical: '45px',
marginHorizontal: '45px', marginHorizontal: '45px',
backgroundImage: null,
backgroundImageSelection: null,
backgroundMode: 'color', backgroundMode: 'color',
backgroundColor: 'rgba(171, 184, 195, 1)', backgroundColor: DEFAULT_BG_COLOR,
dropShadow: true,
dropShadowOffsetY: '20px', dropShadowOffsetY: '20px',
dropShadowBlurRadius: '68px', dropShadowBlurRadius: '68px',
theme: 'seti', theme: DEFAULT_THEME.id,
windowTheme: 'none', windowTheme: 'none',
language: DEFAULT_LANGUAGE, language: DEFAULT_LANGUAGE,
fontFamily: 'Hack', fontFamily: 'Hack',
fontSize: '14px' fontSize: '14px',
windowControls: true,
widthAdjustment: true,
lineNumbers: false
} }

@ -61,20 +61,7 @@ class Editor extends React.Component {
super(props) super(props)
this.state = Object.assign( this.state = Object.assign(
{ {
backgroundMode: 'color', ...DEFAULT_SETTINGS,
backgroundColor: DEFAULT_BG_COLOR,
backgroundImage: null,
backgroundImageSelection: null,
theme: DEFAULT_THEME.id,
language: DEFAULT_LANGUAGE,
dropShadow: true,
dropShadowOffsetY: '20px',
dropShadowBlurRadius: '68px',
windowControls: true,
widthAdjustment: true,
lineNumbers: false,
paddingVertical: '48px',
paddingHorizontal: '32px',
uploading: false, uploading: false,
code: props.content, code: props.content,
_initialState: this.props.initialState _initialState: this.props.initialState

Loading…
Cancel
Save