Skip to content

Commit

Permalink
fix: hashtag search
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Dec 21, 2023
1 parent 62afbc4 commit add7d54
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/web/src/components/Shared/Markup/MarkupLink/Hashtag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import isPrideMonth from '@hey/lib/isPrideMonth';
import stopEventPropagation from '@hey/lib/stopEventPropagation';
import { Leafwatch } from '@lib/leafwatch';
import Link from 'next/link';
import urlcat from 'urlcat';

const Hashtag: FC<MarkupLinkProps> = ({ title }) => {
if (!title) {
Expand All @@ -23,12 +24,14 @@ const Hashtag: FC<MarkupLinkProps> = ({ title }) => {
<span className="inline-flex items-center space-x-1">
<span>
<Link
href={`/search?q=${title.slice(1)}&type=pubs&src=link_click`}
href={urlcat('/search', {
q: title,
src: 'link_click',
type: 'pubs'
})}
onClick={(event) => {
stopEventPropagation(event);
Leafwatch.track(PUBLICATION.CLICK_HASHTAG, {
hashtag: title.slice(1)
});
Leafwatch.track(PUBLICATION.CLICK_HASHTAG, { hashtag: tag });
}}
>
{isPrideHashtag ? <span className="pride-text">{title}</span> : title}
Expand Down

0 comments on commit add7d54

Please sign in to comment.