removed page/repost
This commit is contained in:
parent
ade9546838
commit
a45d91deb5
3 changed files with 0 additions and 94 deletions
|
@ -48,7 +48,6 @@ import PasswordSetPage from 'page/passwordSet';
|
||||||
import PublishPage from 'page/publish';
|
import PublishPage from 'page/publish';
|
||||||
import ReportContentPage from 'page/reportContent';
|
import ReportContentPage from 'page/reportContent';
|
||||||
import ReportPage from 'page/report';
|
import ReportPage from 'page/report';
|
||||||
import RepostNew from 'page/repost';
|
|
||||||
import SearchPage from 'page/search';
|
import SearchPage from 'page/search';
|
||||||
|
|
||||||
import SettingsCreatorPage from 'page/settingsCreator';
|
import SettingsCreatorPage from 'page/settingsCreator';
|
||||||
|
@ -273,7 +272,6 @@ function AppRouter(props: Props) {
|
||||||
component={ChannelsFollowingDiscoverPage}
|
component={ChannelsFollowingDiscoverPage}
|
||||||
/>
|
/>
|
||||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
|
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
|
||||||
<PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} />
|
|
||||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
|
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
|
||||||
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
|
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
|
||||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
|
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
|
||||||
|
|
|
@ -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);
|
|
|
@ -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 (
|
|
||||||
<Page
|
|
||||||
noFooter
|
|
||||||
noSideNavigation
|
|
||||||
backout={{
|
|
||||||
title: __('Repost'),
|
|
||||||
backLabel: __('Back'),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{balance === 0 && <YrblWalletEmpty />}
|
|
||||||
<div className={classnames({ 'card--disabled': balance === 0 })}>
|
|
||||||
<RepostCreate
|
|
||||||
uri={decodedFrom}
|
|
||||||
name={repostTo}
|
|
||||||
redirectUri={redirectUri}
|
|
||||||
repostUri={repostUri}
|
|
||||||
contentUri={contentUri}
|
|
||||||
setContentUri={setContentUri}
|
|
||||||
setRepostUri={setRepostUri}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Page>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default RepostPage;
|
|
Loading…
Reference in a new issue