From e5072c8681d0c63a8854c96f877dd97e64373694 Mon Sep 17 00:00:00 2001 From: Bradley Ray Date: Sun, 12 Dec 2021 06:03:00 +0000 Subject: [PATCH] Modal repost (#7341) * make repost into a modal * remove unecessary import * removed page/repost * fixed yarn lint errors * added page/repost back * added "Repost" title bar * fixed yarn lint errors --- ui/component/claimRepostButton/index.js | 6 ++++ ui/component/claimRepostButton/view.jsx | 44 +++++++++++++++++++++++++ ui/component/fileActions/view.jsx | 31 +++-------------- ui/component/repostCreate/view.jsx | 35 +++++++++++++------- ui/constants/modal_types.js | 1 + ui/modal/modalRepost/index.js | 9 +++++ ui/modal/modalRepost/view.jsx | 32 ++++++++++++++++++ ui/modal/modalRouter/view.jsx | 3 ++ 8 files changed, 123 insertions(+), 38 deletions(-) create mode 100644 ui/component/claimRepostButton/index.js create mode 100644 ui/component/claimRepostButton/view.jsx create mode 100644 ui/modal/modalRepost/index.js create mode 100644 ui/modal/modalRepost/view.jsx diff --git a/ui/component/claimRepostButton/index.js b/ui/component/claimRepostButton/index.js new file mode 100644 index 000000000..247a1ed18 --- /dev/null +++ b/ui/component/claimRepostButton/index.js @@ -0,0 +1,6 @@ +import { connect } from 'react-redux'; +import { doOpenModal } from 'redux/actions/app'; +import { doToast } from 'redux/actions/notifications'; +import ClaimReportButton from './view'; + +export default connect(null, { doOpenModal, doToast })(ClaimReportButton); diff --git a/ui/component/claimRepostButton/view.jsx b/ui/component/claimRepostButton/view.jsx new file mode 100644 index 000000000..57aa58850 --- /dev/null +++ b/ui/component/claimRepostButton/view.jsx @@ -0,0 +1,44 @@ +// @flow +import { SITE_NAME } from 'config'; +import * as MODALS from 'constants/modal_types'; +import * as ICONS from 'constants/icons'; +import React from 'react'; +import Button from 'component/button'; + +type Props = { + uri: string, + claim: StreamClaim, + hasChannels: boolean, + doOpenModal: (string, {}) => void, + doToast: ({ message: string }) => void, +}; + +export default function ClaimRepostButton(props: Props) { + const { uri, claim, hasChannels, doOpenModal, doToast } = props; + const [contentUri, setContentUri] = React.useState(''); + const [repostUri, setRepostUri] = React.useState(''); + + return ( +