Skip to content

Commit

Permalink
Feedback form needs to check for preexisting query params when formin…
Browse files Browse the repository at this point in the history
…g the referral link.
  • Loading branch information
devcshort committed Sep 30, 2023
1 parent 8b165fe commit 3efd226
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/client/components/organisms/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ export function AppHeader(props: Props) {
}

if (appConfig?.contact?.feedbackUrl) {
const currentUrl = new URL(appConfig?.contact?.feedbackUrl);
const feedbackUrl = currentUrl.toString().split('?')[0];
const urlParams = new URLSearchParams(currentUrl.searchParams);
urlParams.set('referring_url', window.location.href);

items.push(
<Button
key="feedback"
className="feedback"
component={Link}
href={appConfig.contact.feedbackUrl}
href={`${feedbackUrl}?${urlParams.toString()}`}
onClick={(e) => {
e.preventDefault();
window.open(
Expand Down Expand Up @@ -171,7 +176,7 @@ export function AppHeader(props: Props) {
>
<Anchor href="/" aria-label={t('header.home') as string}>
<img
src="https://cdn.c211.io/logo_hlc988_9ff6e2727e.svg"
src={appConfig?.brand?.logoUrl}
alt={t('header.home') as string}
width="auto"
height={65}
Expand Down

0 comments on commit 3efd226

Please sign in to comment.