Skip to content

Commit

Permalink
Increase counter for position toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
timolins committed Jan 19, 2022
1 parent f5afa56 commit c5e5935
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions site/components/sections/toaster-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Arrow from '../../assets/arrow.svg';
import { Code } from '../code';

import { EmojiButton } from '../emoji-button';
import { SplitbeeCounter } from './splitbee-counter';

export const positions: Array<ToastPosition> = [
'top-left',
Expand Down Expand Up @@ -68,8 +69,6 @@ export const ToasterExample: React.FC<{
: 'bg-white shadow-small-button'
)}
key={p}
data-splitbee-event="Change Position"
data-splitbee-event-position={p}
onClick={() => {
toast.success(
<span>
Expand All @@ -80,6 +79,14 @@ export const ToasterExample: React.FC<{
}
);

(window as any).splitbee?.track('Change Position', {
position: p,
});

(window as any).splitbee?.track('Trigger Toast', {
example: 'position',
});

onPosition(p);
}}
>
Expand Down

1 comment on commit c5e5935

@vercel
Copy link

@vercel vercel bot commented on c5e5935 Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.