Skip to content

Commit

Permalink
feat: 앰플리튜드 이벤트 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
100Gyeon committed Sep 17, 2023
1 parent b75e965 commit f09f292
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/disclosure/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Disclosure as HeadlessDisclosure } from '@headlessui/react';
import { styled } from 'stitches.config';
import ArrowIcon from 'public/assets/svg/arrow_down.svg';
import { parseTextToLink } from '@components/util/parseTextToLink';
import logAmplitudeEvent from '@utils/logAmplitudeEvent';

interface DisclosureProps {
title: string;
Expand All @@ -21,7 +22,7 @@ export default function Disclosure({ title, subTitle, contents, createdDate }: D
<STitle>{title}</STitle>
<SSubTitle>{subTitle}</SSubTitle>
</STitleWrapper>
<HeadlessDisclosure.Button>
<HeadlessDisclosure.Button onClick={() => logAmplitudeEvent(!open ? 'Click-noticeOn' : 'Click-noticeOff')}>
<SArrowIcon isOpen={open} />
</HeadlessDisclosure.Button>
</STitleContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/amplitude/useAmplitudeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type EventProperties = {
[key: string]: string | number | boolean | undefined;
};

export default async function useAmplitudeEvent(
export default function useAmplitudeEvent(
eventName: string,
eventProperties?: EventProperties,
config?: AmplitudeCustomConfig
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logAmplitudeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface AmplitudeCustomConfig {
deps?: DependencyList;
}

export default async function logAmplitudeEvent(
export default function logAmplitudeEvent(
eventName: string,
params?: Record<string, unknown>,
config?: AmplitudeCustomConfig
Expand Down

0 comments on commit f09f292

Please sign in to comment.