Skip to content

Commit

Permalink
feat(message): add onClick handler
Browse files Browse the repository at this point in the history
fixes #177
  • Loading branch information
nolimits4web committed Oct 20, 2023
1 parent 6b51367 commit 4df47e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/svelte/components/Message.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
export let textFooter = '';
export let avatar = undefined;
export let onClick = undefined;
const rippleEl = { current: null };
const dark = useDarkClasses();
Expand Down Expand Up @@ -53,6 +55,7 @@
{id}
bind:this={rippleEl.current}
class={classes}
on:click={onClick}
{...$$restProps}
>
{#if avatar || $$slots.avatar}
Expand Down
5 changes: 5 additions & 0 deletions src/types/Message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,9 @@ interface Props {
* Message user's avatar URL
*/
avatar?: string | React.ReactNode;

/**
* Message click handler
*/
onClick?: (e: any) => void;
}

0 comments on commit 4df47e3

Please sign in to comment.