[Refactor] Amplitude tracking 로직 컴포넌트로 분리 #473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue : Closes #460
🧑🎤 Summary
event tracking 로직이 기존에는 handler 함수 안에 포함되어 있어서 이를 분리해줬어요
이때 track이 필요한 곳이
<Button>
뿐 아니라 일반<button>
과<Link>
,<a>
등 여러 군데에서 사용되고 있어서 Button에 props로 넘겨주는 것 대신 Track 컴포넌트를 새로 만드는 방법을 택했습니다.일단 Button 컴포넌트에는 필수적으로 필요해서 각각에 감싸주기 보다 공통 Button component에 한 번 싸주었습니다
그 외는 아래와 같이 해주었어요
tracking 하는데 있어서 살짝의 로직이 필요한 곳들은 그냥 track을 이용해줬습니다