Skip to content

Commit

Permalink
feat(events): adds and updates some events
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-thayto committed Feb 26, 2024
1 parent abaa5e6 commit 74219b6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/components/BlogCard/BlogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const BlogCard = ({
href={href}
onClick={() => {
window.umami.track('blog-card-clicked', {
name: 'blog-post-back-btn',
data: { href, title },
href,
title,
})
}}
>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const ThemeSwitcher = () => {
type="button"
aria-label="Use Dark Mode"
onClick={() => {
window.umami.track('switch-theme', {
from: 'dark-to-light',
})
document.documentElement.classList.add('dark')
localStorage.setItem('theme', 'dark')
}}
Expand All @@ -70,6 +73,9 @@ const ThemeSwitcher = () => {
type="button"
aria-label="Use Light Mode"
onClick={() => {
window.umami.track('switch-theme', {
from: 'light-to-dark',
})
document.documentElement.classList.remove('dark')
localStorage.setItem('theme', 'light')
}}
Expand Down
19 changes: 5 additions & 14 deletions src/pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ const PostPage = ({
href="/blog"
onClick={() => {
window.umami.track('blog-post-back-btn', {
name: 'blog-post-back-btn',
data: {
title: prevPost.title,
},
title: prevPost.title,
})
}}
className="flex justify-start"
Expand Down Expand Up @@ -136,11 +133,8 @@ const PostPage = ({
className="py-8 px-10 text-center md:text-right first:rounded-t-lg md:first:rounded-tr-none md:first:rounded-l-lg last:rounded-r-lg first last:rounded-b-lg backdrop-blur-lg bg-slate-50 bg-opacity-100 dark:bg-opacity-10 hover:bg-opacity-30 dark:hover:bg-opacity-20 transition border border-gray-800 border-opacity-10 last:border-t md:border-r-0 md:last:border-r md:last:rounded-r-none flex flex-col"
onClick={() => {
window.umami.track('change-post-btn', {
name: 'blog-post-back-btn',
data: {
href: `/blog/${prevPost.slug}`,
title: prevPost.title,
},
href: `/blog/${prevPost.slug}`,
title: prevPost.title,
})
}}
>
Expand All @@ -159,11 +153,8 @@ const PostPage = ({
className="py-8 px-10 text-center md:text-left md:first:rounded-t-lg last:rounded-b-lg first:rounded-l-lg md:last:rounded-bl-none md:last:rounded-r-lg backdrop-blur-lg bg-slate-50 bg-opacity-100 dark:bg-opacity-10 hover:bg-opacity-30 dark:hover:bg-opacity-20 transition border border-gray-800 border-opacity-10 border-t-0 first:border-t first:rounded-t-lg md:border-t border-b-0 last:border-b flex flex-col"
onClick={() => {
window.umami.track('change-post-btn', {
name: 'blog-post-back-btn',
data: {
href: `/blog/${nextPost.slug}`,
title: nextPost.title,
},
href: `/blog/${nextPost.slug}`,
title: nextPost.title,
})
}}
>
Expand Down
7 changes: 2 additions & 5 deletions src/pages/linktree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,8 @@ const LinksPage = () => {
className="flex justify-center font-medium cursor-pointer rounded-full border border-slate-900 hover:hover:bg-indigo-300 dark:hover:hover:bg-indigo-500 px-10 py-4 mb-4 text-slate-900 dark:text-gray-300 bg-white dark:bg-gray-600"
onClick={() => {
window.umami.track('linktree-button-clicked', {
name: 'linktree-button-clicked',
data: {
href,
title: text,
},
href,
title: text,
})
}}
>
Expand Down

0 comments on commit 74219b6

Please sign in to comment.