From 233a2b27ba7d408c1137f0dda5a6103ee8645bee Mon Sep 17 00:00:00 2001 From: Bradley Date: Thu, 3 Mar 2022 10:21:36 -0600 Subject: [PATCH] pass in contentName to repost modal --- ui/modal/modalRepost/view.jsx | 8 +++++--- ui/page/show/view.jsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/modal/modalRepost/view.jsx b/ui/modal/modalRepost/view.jsx index 6990976dc..183e0a230 100644 --- a/ui/modal/modalRepost/view.jsx +++ b/ui/modal/modalRepost/view.jsx @@ -6,20 +6,22 @@ import RepostCreate from 'component/repostCreate'; import useThrottle from 'effects/use-throttle'; type Props = { - uri: string, + uri?: string, + contentName?: string, + // --- redux --- closeModal: () => void, resolveUri: (string) => void, }; function ModalRepost(props: Props) { - const { uri, closeModal, resolveUri } = props; + const { uri, contentName, closeModal, resolveUri } = props; const { location: { search }, } = useHistory(); const urlParams = new URLSearchParams(search); - const param = urlParams.get('name') || urlParams.get('q'); + const param = urlParams.get('name') || urlParams.get('q') || contentName; const repostTo = param && param[0] === '@' ? param.slice(1) : param; const [contentUri, setContentUri] = React.useState(''); diff --git a/ui/page/show/view.jsx b/ui/page/show/view.jsx index 4cb81b86f..993838859 100644 --- a/ui/page/show/view.jsx +++ b/ui/page/show/view.jsx @@ -192,7 +192,7 @@ export default function ShowPage(props: Props) {