Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"lodash": "^4.17.4",
"marksy": "^0.4.2",
"normalize.css": "^7.0.0",
"radium": "^0.19.1",
"react-emotion": "^8.0.8",
"react-redux": "^5.0.5",
"react-transition-group": "^1.1.3",
"react-typography": "^0.16.5",
"redux": "^3.0.4",
"redux-actions": "^2.0.3",
"to-style": "^1.3.3",
"victory-core": "^15.2.0"
},
"peerDependencies": {
Expand Down
82 changes: 16 additions & 66 deletions src/components/__snapshots__/manager.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,13 @@ exports[`<Manager /> should render correctly. 1`] = `
</div>
</Styled(div)>
</Fullscreen>
<Style
rules={
<style
dangerouslySetInnerHTML={
Object {
".spectacle-presenter-next .fragment": Object {
"display": "none !important",
},
"body": Array [],
"__html": "body { } .spectacle-presenter-next .fragment { display: none !important} ",
}
}
scopeSelector=""
>
<style
dangerouslySetInnerHTML={
Object {
"__html": "body{}.spectacle-presenter-next .fragment{display: none !important;}",
}
}
/>
</Style>
/>
</div>
</Styled(div)>
</Manager>
Expand Down Expand Up @@ -386,27 +374,13 @@ exports[`<Manager /> should render the export configuration when specified. 1`]
</div>
</Styled(div)>
</Export>
<Style
rules={
<style
dangerouslySetInnerHTML={
Object {
".spectacle-presenter-next .fragment": Object {
"display": "none !important",
},
"body": Array [],
"__html": "body { min-width: 1150px; min-height: 850px; overflow: auto} .spectacle-presenter-next .fragment { display: none !important} ",
}
}
scopeSelector=""
>
<style
dangerouslySetInnerHTML={
Object {
"__html": "body{min-width: 1150px;
min-height: 850px;
overflow: auto;}.spectacle-presenter-next .fragment{display: none !important;}",
}
}
/>
</Style>
/>
</div>
</Styled(div)>
</Manager>
Expand Down Expand Up @@ -571,25 +545,13 @@ exports[`<Manager /> should render the overview configuration when specified. 1`
</div>
</Styled(div)>
</Fullscreen>
<Style
rules={
<style
dangerouslySetInnerHTML={
Object {
".spectacle-presenter-next .fragment": Object {
"display": "none !important",
},
"body": Array [],
"__html": "body { } .spectacle-presenter-next .fragment { display: none !important} ",
}
}
scopeSelector=""
>
<style
dangerouslySetInnerHTML={
Object {
"__html": "body{}.spectacle-presenter-next .fragment{display: none !important;}",
}
}
/>
</Style>
/>
</div>
</Styled(div)>
</Manager>
Expand Down Expand Up @@ -874,25 +836,13 @@ exports[`<Manager /> should render with slideset slides 1`] = `
</div>
</Styled(div)>
</Fullscreen>
<Style
rules={
<style
dangerouslySetInnerHTML={
Object {
".spectacle-presenter-next .fragment": Object {
"display": "none !important",
},
"body": Array [],
"__html": "body { } .spectacle-presenter-next .fragment { display: none !important} ",
}
}
scopeSelector=""
>
<style
dangerouslySetInnerHTML={
Object {
"__html": "body{}.spectacle-presenter-next .fragment{display: none !important;}",
}
}
/>
</Style>
/>
</div>
</Styled(div)>
</Manager>
Expand Down
12 changes: 10 additions & 2 deletions src/components/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { setGlobalStyle, updateFragment } from '../actions';
import Typeface from './typeface';
import { getSlideByIndex } from '../utils/slides';
import styled from 'react-emotion';
import { Style } from 'radium';
import { string as toStringStyle } from 'to-style';
import memoize from 'lodash/memoize';

import Presenter from './presenter';
import Export from './export';
Expand All @@ -23,6 +24,13 @@ import Fullscreen from './fullscreen';
import Progress from './progress';
import Controls from './controls';

let convertStyle = styles => {
return Object.keys(styles).map(key => {
return `${key} { ${toStringStyle(styles[key])}} `;
}).join('');
};

convertStyle = memoize(convertStyle);

const StyledDeck = styled.div(props => ({
backgroundColor:
Expand Down Expand Up @@ -657,7 +665,7 @@ export class Manager extends Component {
: ''}

{this.props.globalStyles &&
<Style rules={Object.assign({}, this.context.styles.global, globals)} />}
<style dangerouslySetInnerHTML={{ __html: convertStyle(Object.assign({}, this.context.styles.global, globals)) }}/>}
</StyledDeck>
);
}
Expand Down