Commit 733a5287 authored by chris's avatar chris
Browse files

add theme from editoria

parent 1cb99294
Pipeline #9264 failed with stages
in 16 seconds
......@@ -57,6 +57,7 @@ class Editor extends AbstractEditor {
autoSave,
user,
tools,
theme,
} = this.props
const {
......@@ -69,74 +70,48 @@ class Editor extends AbstractEditor {
fullScreen,
} = this.state
const containerProps = {
chapterNumber,
changesNotSaved,
commandStates,
configurator,
containerId,
mode,
diacriticsModal,
findAndReplaceModal,
shortCutsModal,
fullScreen,
editing,
editorSession,
onClose,
spellCheck,
trackChanges,
trackChangesView,
autoSave,
update,
user,
tools,
theme,
}
const { editorSession } = this
editorSession.configurator.config.autoSave = autoSave
const commandStates = this.commandManager.getCommandStates()
let renderLayout
const el = $$('div').addClass('sc-prose-editor')
/*
TODO
-- make layout loading properly dynamic
-- be more generic in the props you pass down
-- if you make layouts components, they can have their own dependencies
(eg. comments, notes etc. are useless in bare layout)
*/
if (layout === 'bare') {
el.addClass('sc-layout-bare')
renderLayout = $$(BareLayout, {
configurator,
containerId,
editing,
mode,
editorSession,
trackChanges,
})
} else if (layout === 'editoria') {
el.addClass('sc-layout-editoria')
renderLayout = $$(EditoriaLayout, {
chapterNumber,
changesNotSaved,
commandStates,
configurator,
containerId,
mode,
diacriticsModal,
findAndReplaceModal,
shortCutsModal,
fullScreen,
editing,
editorSession,
onClose,
spellCheck,
trackChanges,
trackChangesView,
autoSave,
update,
user,
tools,
})
} else {
el.addClass('sc-layout-default')
renderLayout = $$(DefaultLayout, {
changesNotSaved,
commandStates,
configurator,
containerId,
editing,
mode,
diacriticsModal,
findAndReplaceModal,
shortCutsModal,
editorSession,
onClose,
trackChanges,
trackChangesView,
update,
user,
})
const el = $$('div').addClass('sc-prose-editor')
el.addClass(`sc-layout-${layout}`)
el.addClass(`wax-e-${theme}`)
switch (layout) {
case 'bare':
renderLayout = $$(BareLayout, containerProps)
break
case 'editoria':
renderLayout = $$(EditoriaLayout, containerProps)
break
default:
renderLayout = $$(DefaultLayout, containerProps)
}
renderLayout.ref('layout')
......
@import './bibliographyEntry/bibliographyEntry';
// @import './chapterNumber/chapterNumber';
@import './chapterSubtitle/chapterSubtitle';
@import './chapterTitle/chapterTitle';
//Themes
@import '../themes/default';
// Elements
@import './comment/comment';
@import './epigraphPoetry/epigraphPoetry';
@import './epigraphProse/epigraphProse';
......
// bibliography
.wax-e-default .sc-bibliography-entry {
padding-left: 25px;
text-indent: -25px;
}
// chapter-number
.wax-e-default .sc-chapter-number {
display: block;
font-size: 1.17em;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
text-transform: uppercase;
}
// subtitle
.wax-e-default .sc-chapter-subtitle {
display: block;
font-size: 1.5em;
margin-top: 0.83em;
margin-bottom: 0.83em;
margin-left: 0;
margin-right: 0;
font-style: italic;
}
// title
.wax-e-default .sc-chapter-title {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
}
......@@ -98,7 +98,7 @@ export class WaxPubsweet extends React.Component {
renderWax(editing) {
const { config, fragment, history, user } = this.props
const { layout, autoSave, tools } = config
const { layout, autoSave, tools, theme } = config
// From editoria config, this is just for testing purposes
......@@ -198,6 +198,7 @@ export class WaxPubsweet extends React.Component {
user={user}
mode={mode}
tools={tools}
theme={theme}
/>
)
}
......
......@@ -122,6 +122,7 @@ class Wax extends React.Component {
autoSave,
mode,
tools,
theme,
} = this.props
this.configurator = new Configurator().import(config)
......@@ -155,6 +156,7 @@ class Wax extends React.Component {
mode,
autoSave,
tools,
theme,
},
el,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment