lbry-desktop/ui/page/reportContent/view.jsx
infinite-persistence 63a2430a7c
ReportContent: redirect back after logging in (#1733)
## Issue
1709 - If you sign in while reporting, you end up in the homepage

## Notes
The other option is to just make `<Header>` always redirect back to where it came from using the full path. But existing code elsewhere seem to always trim off any params (e.g. `location.search`, `location.hash`) when doing redirects.

So, ended up making it generic and let the caller decide where to redirect (and with what params).
2022-06-22 09:07:15 -04:00

23 lines
585 B
JavaScript

// @flow
import React from 'react';
import { useHistory } from 'react-router';
import Page from 'component/page';
import ReportContent from 'component/reportContent';
export default function ReportContentPage(props: any) {
const { location } = useHistory();
return (
<Page
noSideNavigation
className="main--report-content"
backout={{
backoutLabel: __('Done'),
title: __('Report content'),
}}
authRedirect={`${location.pathname}${location.search}`} // 'report_content?claimId=xxx'
>
<ReportContent />
</Page>
);
}