make sure to show correct url on winning search term

This commit is contained in:
Sean Yesmunt 2020-02-11 14:32:49 -05:00
parent c8451483b3
commit 24b29f341b
3 changed files with 5 additions and 4 deletions

View file

@ -224,7 +224,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
'claim-preview__wrapper--small': type === 'small', 'claim-preview__wrapper--small': type === 'small',
})} })}
> >
{type !== 'large' && type !== 'inline' && <ClaimRepostAuthor uri={uri} />} <ClaimRepostAuthor uri={uri} />
<div <div
className={classnames('claim-preview', { className={classnames('claim-preview', {

View file

@ -9,16 +9,17 @@ type Props = {
uri: string, uri: string,
doToast: ({ message: string }) => void, doToast: ({ message: string }) => void,
inline?: boolean, inline?: boolean,
noShortUrl?: boolean,
}; };
function ClaimUri(props: Props) { function ClaimUri(props: Props) {
const { shortUrl, uri, doToast, inline = false } = props; const { shortUrl, uri, doToast, inline = false, noShortUrl = false } = props;
return ( return (
<Button <Button
className={classnames('media__uri', { 'media__uri--inline': inline })} className={classnames('media__uri', { 'media__uri--inline': inline })}
button="alt" button="alt"
label={shortUrl || uri} label={noShortUrl ? uri : shortUrl || uri}
onClick={() => { onClick={() => {
clipboard.writeText(shortUrl || uri); clipboard.writeText(shortUrl || uri);
doToast({ doToast({

View file

@ -54,7 +54,7 @@ export default function SearchPage(props: Props) {
<Fragment> <Fragment>
<header className="search__header"> <header className="search__header">
<div className="claim-preview__actions--header"> <div className="claim-preview__actions--header">
<ClaimUri uri={uriFromQuery} /> <ClaimUri uri={uriFromQuery} noShortUrl />
<Button <Button
className="media__uri--right" className="media__uri--right"
button="alt" button="alt"