Open wgwz opened 1 year ago
Also see https://github.com/regen-network/regen-web/pull/1551#discussion_r1021386380 that would avoid importing tracking types into web-components
There are only two places where web-components is dependent on tracking code:
$ rg 'track<' web-components
web-components/src/components/cards/ProjectCard/ProjectCard.tsx
236: track<'buy1', Buy1Event>('buy1', {
web-components/src/components/form/CreateSellOrderForm.tsx
92: track<'sell2', Sell2Event>('sell2', {
I.e. in the case of ProjectCard
the track
call could be moved to this higher-level component:
Similarly the track
call in CreateSellOrderForm
can be moved into this higher-level component:
TL;DR I don't think we necessarily have to refactor the track function to make web-components independent of tracking code.
Is your feature request related to a problem? Please describe.
We want to reduce the number of side effects in web-components, specifically, we don't want to be directly dependent on tracking code in web-components. This task is move tracking calls into regen-web specific components, or to find a way to pass tracking code through props.
Additional context (optional)
See this convo in PR #1551 for more context.
For Admin Use