From c84a675c07fd1997588794a26bf41c04f23c121e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 10 Mar 2021 14:46:15 +0100 Subject: getting rid of basically all instances of bindActionCreators and mapDispatchToActions. hopefully never have to use these functions again --- .../media/components/media.formImageSelection.js | 1 - .../editor/media/components/media.indexOptions.js | 11 ++----- .../views/editor/media/components/media.menu.js | 34 ++++++++++++---------- 3 files changed, 21 insertions(+), 25 deletions(-) (limited to 'animism-align/frontend/app/views/editor/media/components') diff --git a/animism-align/frontend/app/views/editor/media/components/media.formImageSelection.js b/animism-align/frontend/app/views/editor/media/components/media.formImageSelection.js index 966eb58..b601304 100644 --- a/animism-align/frontend/app/views/editor/media/components/media.formImageSelection.js +++ b/animism-align/frontend/app/views/editor/media/components/media.formImageSelection.js @@ -1,6 +1,5 @@ import React, { Component } from 'react' import { Link } from 'react-router-dom' -import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import toBlob from 'data-uri-to-blob' diff --git a/animism-align/frontend/app/views/editor/media/components/media.indexOptions.js b/animism-align/frontend/app/views/editor/media/components/media.indexOptions.js index d8187c9..beb9517 100644 --- a/animism-align/frontend/app/views/editor/media/components/media.indexOptions.js +++ b/animism-align/frontend/app/views/editor/media/components/media.indexOptions.js @@ -1,6 +1,4 @@ import React, { Component } from 'react' -import { Link } from 'react-router-dom' -import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import actions from 'app/actions' @@ -18,8 +16,8 @@ const thumbnailOptions = [ const sortOptions = [ { name: 'id-asc', label: 'Most recent' }, { name: 'id-desc', label: 'Oldest first' }, - { name: 'username-asc', label: 'Username (A-Z)' }, - { name: 'username-desc', label: 'Username (Z-A)' }, + // { name: 'username-asc', label: 'Username (A-Z)' }, + // { name: 'username-desc', label: 'Username (Z-A)' }, { name: 'author-asc', label: 'Author (A-Z)' }, { name: 'author-desc', label: 'Author (Z-A)' }, { name: 'title-asc', label: 'Title (A-Z)' }, @@ -53,7 +51,4 @@ const mapStateToProps = state => ({ options: state.upload.options, }) -const mapDispatchToProps = dispatch => ({ -}) - -export default connect(mapStateToProps, mapDispatchToProps)(IndexOptions) +export default connect(mapStateToProps)(IndexOptions) diff --git a/animism-align/frontend/app/views/editor/media/components/media.menu.js b/animism-align/frontend/app/views/editor/media/components/media.menu.js index b782cdc..9a15354 100644 --- a/animism-align/frontend/app/views/editor/media/components/media.menu.js +++ b/animism-align/frontend/app/views/editor/media/components/media.menu.js @@ -1,35 +1,36 @@ import React, { Component } from 'react' -import { Route, Link } from 'react-router-dom' +import { Route } from 'react-router-dom' import { connect } from 'react-redux' import { history } from 'app/store' import actions from 'app/actions' -import { MenuButton, FileInput } from 'app/common' +import { MenuButton } from 'app/common' const mapStateToProps = state => ({ media: state.media, + episode_id: state.site.episode.id, }) export default class MediaMenu extends Component { render() { return (
- - - - + + + +
) } } -const MediaIndexMenu = () => ([ - , -]) +const MediaIndexMenu = connect(mapStateToProps)((props) => ([ + , +])) const MediaShowMenu = connect(mapStateToProps)((props) => ([ - , - , + , + , { const { res: media } = props.media.show if (confirm("Really delete this media?")) { @@ -40,13 +41,13 @@ const MediaShowMenu = connect(mapStateToProps)((props) => ([ }} />, ])) -const MediaNewMenu = (props) => ([ - , -]) +const MediaNewMenu = connect(mapStateToProps)((props) => ([ + , +])) const MediaEditMenu = connect(mapStateToProps)((props) => ([ - , - , + , + , { const { res: media } = props.media.show if (confirm("Really delete this media?")) { @@ -56,3 +57,4 @@ const MediaEditMenu = connect(mapStateToProps)((props) => ([ } }} />, ])) + -- cgit v1.2.3-70-g09d2