diff --git a/components/waves/drops/WaveCreatorPreviewItem.tsx b/components/waves/drops/WaveCreatorPreviewItem.tsx index e011d76851..018687be2b 100644 --- a/components/waves/drops/WaveCreatorPreviewItem.tsx +++ b/components/waves/drops/WaveCreatorPreviewItem.tsx @@ -15,10 +15,14 @@ import WavesIcon from "@/components/common/icons/WavesIcon"; interface WaveCreatorPreviewItemProps { readonly wave: ApiWave; + readonly onSelect?: + | ((wave: ApiWave, href: string, event: React.MouseEvent) => void) + | undefined; } export const WaveCreatorPreviewItem: React.FC = ({ wave, + onSelect, }) => { const isDirectMessage = wave.chat.scope.group?.is_direct_message ?? false; const waveHref = getWaveRoute({ @@ -35,6 +39,12 @@ export const WaveCreatorPreviewItem: React.FC = ({ { + if (!onSelect) return; + event.preventDefault(); + event.stopPropagation(); + onSelect(wave, waveHref, event); + }} className="tw-group tw-flex tw-items-center tw-gap-3 tw-rounded-lg tw-border tw-border-iron-800/70 tw-bg-iron-950/60 tw-px-4 tw-py-3 tw-no-underline tw-transition tw-duration-200 focus:tw-outline-none focus-visible:tw-ring-2 focus-visible:tw-ring-primary-400/60 desktop-hover:hover:tw-border-iron-700 desktop-hover:hover:tw-bg-iron-900/60" >
diff --git a/components/waves/drops/WaveCreatorPreviewModal.tsx b/components/waves/drops/WaveCreatorPreviewModal.tsx index 4bc7518d18..67b6909dbc 100644 --- a/components/waves/drops/WaveCreatorPreviewModal.tsx +++ b/components/waves/drops/WaveCreatorPreviewModal.tsx @@ -57,7 +57,7 @@ export const WaveCreatorPreviewModal = ({ {}} > -
{ - e.stopPropagation(); - onClose(); - }} - > +
- + e.stopPropagation()} + > = ({ user, isOpen, onClose, isApp = false }) => { + const router = useRouter(); const identity = user.handle ?? user.primary_address; const displayName = user.handle ?? shortenAddress(user.primary_address); @@ -60,6 +63,12 @@ export const WaveCreatorPreviewModalContent: React.FC< const waveCountLabel = isInitialLoading ? "Loading waves..." : `Showing ${waves.length} wave${wavePlural}`; + const handleWaveSelect = useCallback( + (_wave: ApiWave, href: string) => { + router.push(href); + }, + [router] + ); return (
@@ -118,7 +127,11 @@ export const WaveCreatorPreviewModalContent: React.FC< {waves.length > 0 && (
{waves.map((wave) => ( - + ))}
)}