Skip to content

Commit 0b8fb1e

Browse files
committed
Cleans up linter errors
1 parent d20dbb5 commit 0b8fb1e

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

src/apps/accounts/src/settings/tabs/preferences/PreferencesTab.tsx

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/* eslint-disable max-len */
22
import { FC } from 'react'
3-
import { bind } from 'lodash'
43
import { toast } from 'react-toastify'
54

65
import { MemberEmailPreferenceAPI, updateMemberEmailPreferencesAsync, useMemberEmailPreferences, UserProfile } from '~/libs/core'
7-
import { Button, FormToggleSwitch, LoadingSpinner } from '~/libs/ui'
6+
import { Button } from '~/libs/ui'
87
import { EnvironmentConfig } from '~/config'
98

10-
import { EmailIcon, ForumIcon, SettingSection, triggerSurvey } from '../../../lib'
9+
import { ForumIcon, SettingSection, triggerSurvey } from '../../../lib'
1110

12-
import { newsletters, programs, subscribeLink, unsubscribeLink } from './preferences.config'
11+
import { subscribeLink, unsubscribeLink } from './preferences.config'
1312
import styles from './PreferencesTab.module.scss'
1413

1514
interface PreferencesTabProps {
@@ -20,40 +19,14 @@ const PreferencesTab: FC<PreferencesTabProps> = (props: PreferencesTabProps) =>
2019
const { data: emailPreferences, mutate: mutateEmailPreferencesData }: MemberEmailPreferenceAPI
2120
= useMemberEmailPreferences(props.profile.email)
2221

23-
const mailChimpFormAction: string = emailPreferences?.status === 'subscribed' ? unsubscribeLink : subscribeLink
24-
2522
function handleGoToForumPreferences(): void {
2623
window.open(`https://${EnvironmentConfig.ENV === 'prod' ? 'discussions' : 'vanilla'}.${EnvironmentConfig.TC_DOMAIN}/profile/preferences`, '_blank')
2724
}
2825

29-
function handleSubscribtionStatusChange(): void {
30-
if (emailPreferences?.status === 'subscribed') {
31-
window.open(unsubscribeLink, '_self')
32-
} else {
33-
window.open(subscribeLink, '_self')
34-
}
35-
}
36-
37-
function handleUserEmailPreferencesChange(id: string): void {
38-
updateMemberEmailPreferencesAsync(props.profile.email, {
39-
interests: {
40-
[id]: !emailPreferences?.interests[id],
41-
},
42-
})
43-
.then(() => {
44-
toast.success('Your email preferences ware updated.')
45-
mutateEmailPreferencesData()
46-
triggerSurvey()
47-
})
48-
.catch(() => {
49-
toast.error('Something went wrong. Please try again later.')
50-
})
51-
}
52-
5326
return (
5427
<div className={styles.container}>
5528
<h3>PLATFORM PREFERENCES</h3>
56-
29+
5730
<div className={styles.content}>
5831
<SettingSection
5932
leftElement={(

0 commit comments

Comments
 (0)