moved default thumbnail from assetpreview to state

This commit is contained in:
bill bittner 2018-03-15 10:48:04 -07:00
parent 2ac570c632
commit 835e30bff4
3 changed files with 16 additions and 4 deletions

View file

@ -0,0 +1,10 @@
import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({site: {defaults: { defaultThumbnail }}}) => {
return {
defaultThumbnail,
};
};
export default connect(mapStateToProps, null)(View);

View file

@ -1,8 +1,7 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
const { assetDefaults: { thumbnail: defaultThumbnail } } = require('../../../config/siteConfig.js');
const AssetPreview = ({ claimData: { name, claimId, fileExt, contentType, thumbnail } }) => { const AssetPreview = ({ defaultThumbnail, claimData: { name, claimId, fileExt, contentType, thumbnail } }) => {
const directSourceLink = `${claimId}/${name}.${fileExt}`; const directSourceLink = `${claimId}/${name}.${fileExt}`;
const showUrlLink = `/${claimId}/${name}`; const showUrlLink = `/${claimId}/${name}`;
return ( return (

View file

@ -1,7 +1,10 @@
const { details: { host } } = require('../../config/siteConfig.js'); const { details: { host }, assetDefaults: { thumbnail: defaultThumbnail } } = require('../../config/siteConfig.js');
const initialState = { const initialState = {
host: host, host,
defaults: {
defaultThumbnail,
},
}; };
export default function (state = initialState, action) { export default function (state = initialState, action) {