Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/config/brand.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@
"tos": "https://hello.mu.social/terms",
"privacy": "https://hello.mu.social/privacy",
"community": "https://hello.mu.social/guidelines",
"copyright": "https://bsky.social/about/support/copyright",
"support": "https://bsky.social/about/support",
"copyright": "https://hello.mu.social/copyright",
"support": "https://hello.mu.social/contact",
"faq": "https://bsky.social/about/faq",
"dataPrivacy": "https://blueskyweb.zendesk.com/hc/en-us/articles/15835264007693-Data-Privacy",
"helpDesk": "https://blueskyweb.zendesk.com/hc/en-us",
"supportRequest": "https://blueskyweb.zendesk.com/hc/requests/new",
"helpDesk": "https://hello.mu.social/contact",
"supportRequest": "https://hello.mu.social/contact",
"download": "https://bsky.app/download",
"statusPage": "https://status.bsky.app/"
},
Expand Down
32 changes: 2 additions & 30 deletions src/lib/hooks/useCreateSupportLink.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
import {useCallback} from 'react'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'

import {useSession} from '#/state/session'
import {BRAND} from '#/config/brand'

export const ZENDESK_SUPPORT_URL = BRAND.links.supportRequest
export const SUPPORT_REQUEST_URL = BRAND.links.supportRequest

export enum SupportCode {
AA_DID = 'AA_DID',
AA_BIRTHDATE = 'AA_BIRTHDATE',
}

/**
* {@link https://support.zendesk.com/hc/en-us/articles/4408839114522-Creating-pre-filled-ticket-forms}
*/
export function useCreateSupportLink() {
const {_} = useLingui()
const {currentAccount} = useSession()

return useCallback(
({code, email}: {code: SupportCode; email?: string}) => {
const url = new URL(ZENDESK_SUPPORT_URL)
if (currentAccount) {
url.search = new URLSearchParams({
tf_anonymous_requester_email: email || currentAccount.email || '', // email will be defined
tf_description:
`[Code: ${code}] — ` + _(msg`Please write your message below:`),
/**
* Custom field specific to {@link ZENDESK_SUPPORT_URL} form
*/
tf_17205412673421: currentAccount.handle + ` (${currentAccount.did})`,
}).toString()
}
return url.toString()
},
[_, currentAccount],
)
return (_args: {code: SupportCode; email?: string}) => SUPPORT_REQUEST_URL
}
Loading