generated from mbti-nf-team/nextjs-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from mbti-nf-team/refactor/ga-event
refacotor: useActivityLog hook 구현 및 local 폰트위치 변경
- Loading branch information
Showing
7 changed files
with
105 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import localFont from 'next/font/local'; | ||
|
||
const dungGeunMoFont = localFont({ | ||
src: [ | ||
{ | ||
path: './korean/DungGeunMo.woff2', | ||
weight: '400', | ||
style: 'normal', | ||
}, | ||
], | ||
display: 'swap', | ||
preload: true, | ||
fallback: [ | ||
'DungGeunMo', | ||
'-apple-system', | ||
'BlinkMacSystemFont', | ||
'system-ui', | ||
'Roboto', | ||
'Helvetica Neue', | ||
'Segoe UI', | ||
'Apple SD Gothic Neo', | ||
'Noto Sans KR', | ||
'Malgun Gothic', | ||
'Apple Color Emoji', | ||
'Segoe UI Emoji', | ||
'Segoe UI Symbol', | ||
'sans-serif', | ||
], | ||
}); | ||
|
||
export default dungGeunMoFont; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useCallback } from 'react'; | ||
import ga4 from 'react-ga4'; | ||
|
||
import { SendEvent } from '@/lib/types/event'; | ||
|
||
function useActivityLog() { | ||
const sendEvent = useCallback(({ | ||
action, name, type, value = {}, | ||
}: SendEvent) => { | ||
ga4.event(name, { | ||
action, | ||
...(type ? { type } : {}), | ||
...value, | ||
}); | ||
}, []); | ||
|
||
return { | ||
sendEvent, | ||
}; | ||
} | ||
|
||
export default useActivityLog; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export type EventName = | ||
| 'share_link_success_clicked' | ||
| 'share_link_failed_clicked' | ||
| 'result_song_load_failed' | ||
| 'view_result_song_clicked'; | ||
|
||
export type EventAction = 'click' | 'fail'; | ||
|
||
export type EventType = 'success' | 'error'; | ||
|
||
export type SendEvent = { | ||
name: EventName; | ||
action: EventAction; | ||
type?: EventType; | ||
value?: Record<string, any>; | ||
}; |