From a45d91deb5434576210227bb3089884e0c874a2c Mon Sep 17 00:00:00 2001 From: Bradley Ray Date: Fri, 10 Dec 2021 15:54:38 -0600 Subject: [PATCH] removed page/repost --- ui/component/router/view.jsx | 2 - ui/page/repost/index.js | 15 ------- ui/page/repost/view.jsx | 77 ------------------------------------ 3 files changed, 94 deletions(-) delete mode 100644 ui/page/repost/index.js delete mode 100644 ui/page/repost/view.jsx diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index f19eb169c..f7e8c3c4a 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -48,7 +48,6 @@ import PasswordSetPage from 'page/passwordSet'; import PublishPage from 'page/publish'; import ReportContentPage from 'page/reportContent'; import ReportPage from 'page/report'; -import RepostNew from 'page/repost'; import SearchPage from 'page/search'; import SettingsCreatorPage from 'page/settingsCreator'; @@ -273,7 +272,6 @@ function AppRouter(props: Props) { component={ChannelsFollowingDiscoverPage} /> - diff --git a/ui/page/repost/index.js b/ui/page/repost/index.js deleted file mode 100644 index 6dcd035be..000000000 --- a/ui/page/repost/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import { connect } from 'react-redux'; - -import { doResolveUri } from 'redux/actions/claims'; -import { selectBalance } from 'redux/selectors/wallet'; -import RepostPage from './view'; - -const select = (state, props) => ({ - balance: selectBalance(state), -}); - -const perform = (dispatch) => ({ - resolveUri: (uri) => dispatch(doResolveUri(uri)), -}); - -export default connect(select, perform)(RepostPage); diff --git a/ui/page/repost/view.jsx b/ui/page/repost/view.jsx deleted file mode 100644 index b1e2e1023..000000000 --- a/ui/page/repost/view.jsx +++ /dev/null @@ -1,77 +0,0 @@ -// @flow -import React from 'react'; -import Page from 'component/page'; -import { useHistory } from 'react-router'; -import RepostCreate from 'component/repostCreate'; -import YrblWalletEmpty from 'component/yrblWalletEmpty'; -import useThrottle from 'effects/use-throttle'; -import classnames from 'classnames'; - -type Props = { - balance: number, - resolveUri: string => void, -}; -function RepostPage(props: Props) { - const { balance, resolveUri } = props; - - const REPOST_FROM = 'from'; - const REPOST_TO = 'to'; - const REDIRECT = 'redirect'; - const { - location: { search }, - } = useHistory(); - - const urlParams = new URLSearchParams(search); - const repostFrom = urlParams.get(REPOST_FROM); - const redirectUri = urlParams.get(REDIRECT); - const repostTo = urlParams.get(REPOST_TO); - const [contentUri, setContentUri] = React.useState(''); - const [repostUri, setRepostUri] = React.useState(''); - const throttledContentValue = useThrottle(contentUri, 500); - const throttledRepostValue = useThrottle(repostUri, 500); - - React.useEffect(() => { - if (throttledContentValue) { - resolveUri(throttledContentValue); - } - }, [throttledContentValue, resolveUri]); - - React.useEffect(() => { - if (throttledRepostValue) { - resolveUri(throttledRepostValue); - } - }, [throttledRepostValue, resolveUri]); - - React.useEffect(() => { - if (repostTo) { - resolveUri(repostTo); - } - }, [repostTo, resolveUri]); - - const decodedFrom = repostFrom && decodeURIComponent(repostFrom); - return ( - - {balance === 0 && } -
- -
-
- ); -} - -export default RepostPage;