From fbcb88b2ef4c59dded7a905b86ddbcc97553d2c7 Mon Sep 17 00:00:00 2001 From: Allard Oelen Date: Wed, 12 Dec 2018 09:48:41 +0100 Subject: [PATCH] Add changed files after revert --- actions/loadDeckView.js | 6 +++++- actions/slide/loadSlideView.js | 4 ++++ components/DefaultHTMLLayout.js | 8 ++++++++ stores/ApplicationStore.js | 3 +++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/actions/loadDeckView.js b/actions/loadDeckView.js index 3237cf11a..12ed1e83a 100644 --- a/actions/loadDeckView.js +++ b/actions/loadDeckView.js @@ -23,7 +23,11 @@ export default function loadDeckView(context, payload, done) { // console.log('loadDeckView params', payload.params, '\n', payload); res.isRootDeck = payload.params.spath === ''; context.dispatch('LOAD_DECK_CONTENT_SUCCESS', res); - context.dispatch('LOAD_DECK_METADATA_SUCCESS', {thumbnailID: res.slidesData.children[0].id}); + context.dispatch('LOAD_DECK_METADATA_SUCCESS', { + thumbnailID: res.slidesData.children[0].id, + thumbnailTheme: res.slidesData.theme, + description: res.deckData.description + }); } let pageTitle = shortTitle + ' | ' + res.slidesData.title; let cleanTitle = pageTitle.replace(/<\/?[^>]+(>|$)/g, '').replace(/'/g, '\'').replace(/"/g, '\"'); diff --git a/actions/slide/loadSlideView.js b/actions/slide/loadSlideView.js index a57c8a284..5675e9b46 100644 --- a/actions/slide/loadSlideView.js +++ b/actions/slide/loadSlideView.js @@ -24,6 +24,10 @@ export default function loadSlideView(context, payload, done) { } else { context.dispatch('LOAD_SLIDE_CONTENT_SUCCESS', res); context.dispatch('LOAD_SLIDE_EDIT_SUCCESS', res); + context.dispatch('LOAD_DECK_METADATA_SUCCESS', { + thumbnailID: res.selector.sid, + thumbnailTheme: context.getStore(DeckTreeStore).theme + }); } let deckTitle = context.getStore(DeckTreeStore).getState().deckTree.get('title'); let pageTitle = shortTitle + ' | ' + deckTitle + ' | ' + res.slide.title; diff --git a/components/DefaultHTMLLayout.js b/components/DefaultHTMLLayout.js index db148a7fe..d2560347f 100644 --- a/components/DefaultHTMLLayout.js +++ b/components/DefaultHTMLLayout.js @@ -12,12 +12,20 @@ hook({ class DefaultHTMLLayout extends React.Component { render() { let user = this.props.context.getUser(); + let pageDescription = this.props.context.getStore(ApplicationStore).getPageDescription(); + return ( {this.props.context.getStore(ApplicationStore).getPageTitle()} + + + + + {pageDescription ? : ''} + diff --git a/stores/ApplicationStore.js b/stores/ApplicationStore.js index c856dcdb1..63414ca10 100644 --- a/stores/ApplicationStore.js +++ b/stores/ApplicationStore.js @@ -7,6 +7,7 @@ class ApplicationStore extends BaseStore { super(dispatcher); this.pageTitle = ''; this.pageThumbnail = '/assets/images/slideWiki-logo-linear.png'; //can add a default image here + this.pageDescription = ''; this.showActivationMessage = false; //this.frozen = false; } @@ -55,12 +56,14 @@ class ApplicationStore extends BaseStore { return { pageTitle: this.pageTitle, pageThumbnail: this.pageThumbnail, + pageDescription: this.pageDescription, showActivationMessage: this.showActivationMessage, }; } rehydrate(state) { this.pageTitle = state.pageTitle; this.pageThumbnail = state.pageThumbnail; + this.pageDescription = state.pageDescription; this.showActivationMessage = state.showActivationMessage; } }