Add enabled sites marker from data object

This commit is contained in:
Franc Camps-Febrer
2019-01-31 12:42:52 -05:00
parent 3efdf48c52
commit c2cd703f06
6 changed files with 9 additions and 6 deletions

View File

@@ -92,6 +92,7 @@ class Dashboard extends React.Component {
render () {
const { actions, app, domain, ui } = this.props
console.log(app)
return (
<div>
<Toolbar
@@ -170,7 +171,7 @@ function mapDispatchToProps (dispatch) {
}
export default connect(
// state => state,
state => injectSource("Hromadske.tv - Paratroopers Video"),
state => state,
// state => injectSource("Hromadske.tv - Paratroopers Video"),
mapDispatchToProps
)(Dashboard)

View File

@@ -141,7 +141,7 @@ class SourceOverlay extends React.Component {
</svg>
</div>
) : null
console.log(this.props)
console.log(this.state.idx)
console.log(this.props.source.paths.length)
const forwardArrow = this.state.idx < this.props.source.paths.length - 1 ? (

View File

@@ -161,7 +161,7 @@ class Toolbar extends React.Component {
<div className='toolbar-header'><p>{title}</p></div>
<div className='toolbar-tabs'>
{this.renderToolbarTab(0, narrativesLabel, 'timeline')}
{(isCategories) ? this.renderToolbarTab(1, categoriesLabel, 'category') : null}
{(isCategories) ? this.renderToolbarTab(1, categoriesLabel, 'widgets') : null}
{(isTags) ? this.renderToolbarTab(2, tagsLabel, 'filter_list') : null}
</div>
<ToolbarBottomActions

View File

@@ -5,7 +5,8 @@ const siteSchema = Joi.object().keys({
description: Joi.string().allow('').required(),
site: Joi.string().required(),
latitude: Joi.string().required(),
longitude: Joi.string().required()
longitude: Joi.string().required(),
enabled: Joi.string().allow('')
})
export default siteSchema

View File

@@ -26,6 +26,7 @@ $header-inset: 10px;
flex-direction: column;
align-items: center;
height: $panel-height;
max-height: calc(100% - 40px);
width: $panel-width;
max-width: 90vw;
box-shadow: 0 19px 19px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);

View File

@@ -9,7 +9,7 @@ export const getActiveNarrative = state => state.app.narrative
export const getActiveStep = state => state.app.narrativeState.current
export const getSelected = state => state.app.selected
export const getSites = (state) => {
if (process.env.features.USE_SITES) return state.domain.sites
if (process.env.features.USE_SITES) return state.domain.sites.filter(s => !!(+s.enabled))
return []
}
export const getSources = state => {