We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54b49a2 commit a13f937Copy full SHA for a13f937
src/components/Switch/Switch.tsx
@@ -101,25 +101,16 @@ const Switch = ({
101
checked={checked}
102
onChange={(e) => {
103
if (tag) {
104
- if (e.target.checked) {
105
- tracker.track({
106
- event: AnalyticsEvents.SWITCH_ON,
107
- type: AnalyticsComponentType.SWITCH,
108
- tag,
109
- pages,
110
- merchantId,
111
- ip,
112
- });
113
- } else {
114
115
- event: AnalyticsEvents.SWITCH_OFF,
116
117
118
119
120
121
122
- }
+ tracker.track({
+ event: e.target.checked
+ ? AnalyticsEvents.SWITCH_ON
+ : AnalyticsEvents.SWITCH_OFF,
+ type: AnalyticsComponentType.SWITCH,
+ tag,
+ pages,
+ merchantId,
+ ip,
+ });
123
}
124
onToggleChange(e);
125
}}
0 commit comments