Skip to content

Commit d2a6906

Browse files
committed
cleanup
1 parent 9d11e3a commit d2a6906

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

src/components/LanguagePicker/MenuItem.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const MenuItem = ({ displayInfo, ...props }: ItemProps) => {
7272
>
7373
{targetName}
7474
</p>
75-
{/* TODO */}
7675
{isBrowserDefault && (
7776
<Badge
7877
className="h-fit-content rounded border-body-medium p-1 text-2xs font-normal uppercase leading-none text-body-medium"

src/components/LanguagePicker/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,7 @@ const LanguagePicker = ({
3333
className,
3434
}: LanguagePickerProps) => {
3535
const { asPath, push } = useRouter()
36-
const {
37-
t,
38-
disclosure,
39-
filteredNames,
40-
// TODO: Implement this
41-
// handleInputFocus,
42-
} = useLanguagePicker(handleClose)
36+
const { t, disclosure, filteredNames } = useLanguagePicker(handleClose)
4337
const { isOpen, setValue, onClose, onOpen } = disclosure
4438

4539
/**

src/components/LanguagePicker/useLanguagePicker.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ export const useLanguagePicker = (handleClose?: () => void) => {
2626

2727
const [filteredNames, setFilteredNames] = useState<LocaleDisplayInfo[]>([])
2828

29-
// Used to only send one matomo event for users who focus the filter input
30-
const [hasFocusedInput, setHasFocusedInput] = useState(false)
31-
32-
// Reset if user switches languages
33-
useEffect(() => {
34-
setHasFocusedInput(false)
35-
}, [locale])
36-
3729
// perform all the filtering and mapping when the filter value change
3830
useEffect(() => {
3931
const locales = filterRealLocales(rawLocales)
@@ -187,25 +179,9 @@ export const useLanguagePicker = (handleClose?: () => void) => {
187179
)
188180
}
189181

190-
/**
191-
* Send Matomo event when user focuses in the filter input.
192-
* Only send once per user per session per language
193-
* @returns void
194-
*/
195-
const handleInputFocus = (): void => {
196-
if (hasFocusedInput) return
197-
trackCustomEvent({
198-
...eventBase,
199-
eventAction: "Filter input",
200-
eventName: "Focused inside filter input",
201-
})
202-
setHasFocusedInput(true)
203-
}
204-
205182
return {
206183
t,
207184
disclosure: { isOpen, setValue, onOpen, onClose },
208185
filteredNames,
209-
handleInputFocus,
210186
}
211187
}

0 commit comments

Comments
 (0)