moved default thumbnail from assetpreview to state
This commit is contained in:
parent
2ac570c632
commit
835e30bff4
3 changed files with 16 additions and 4 deletions
10
react/components/AssetPreview/index.js
Normal file
10
react/components/AssetPreview/index.js
Normal 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);
|
|
@ -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 (
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue