Skip to content

Commit

Permalink
Merge pull request #1845 from holium/RE-233
Browse files Browse the repository at this point in the history
hosting.holium.com: Contact Support sidebar link
  • Loading branch information
gdbroman authored Jun 27, 2023
2 parents 84e7099 + 2501974 commit c6127a3
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 11 deletions.
8 changes: 7 additions & 1 deletion hosting-holium-com/src/pages/account/custom-domain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
useUser,
} from '@holium/shared';

import { getSupportEmail } from 'util/constants';

import { Page } from '../../components/Page';
import { thirdEarthApi } from '../../util/thirdEarthApi';
import { accountPageUrl, useNavigation } from '../../util/useNavigation';
Expand Down Expand Up @@ -61,7 +63,11 @@ const CustomDomainPresenter = () => {
};

const onClickSidebarSection = (section: string) => {
goToPage(accountPageUrl[section]);
if (section === 'Contact Support') {
window.open(getSupportEmail(ship?.patp), '_blank');
} else {
goToPage(accountPageUrl[section]);
}
};

const onClickUploadId = () => {
Expand Down
10 changes: 7 additions & 3 deletions hosting-holium-com/src/pages/account/download-realm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@holium/shared';

import { Page } from '../../components/Page';
import { downloadLinks } from '../../util/constants';
import { downloadLinks, getSupportEmail } from '../../util/constants';
import { thirdEarthApi } from '../../util/thirdEarthApi';
import { accountPageUrl, useNavigation } from '../../util/useNavigation';

Expand All @@ -15,12 +15,16 @@ const DownloadRealmPresenter = () => {
const { ships, selectedShipId, setSelectedShipId } = useUser();

const onClickSidebarSection = (section: string) => {
if (section === 'Get Hosting') {
if (section === 'Contact Support') {
const ship = ships.find((ship) => ship.id === selectedShipId);
window.open(getSupportEmail(ship?.patp ?? ''), '_blank');
} else if (section === 'Get Hosting') {
goToPage(accountPageUrl[section], {
back_url: '/account/download-realm',
});
} else {
goToPage(accountPageUrl[section]);
}
goToPage(accountPageUrl[section]);
};

const onClickUploadId = () => {
Expand Down
6 changes: 4 additions & 2 deletions hosting-holium-com/src/pages/account/get-realm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { thirdEarthApi } from 'util/thirdEarthApi';

import { Page } from '../../components/Page';
import { constants } from '../../util/constants';
import { constants, getSupportEmail } from '../../util/constants';
import { accountPageUrl, useNavigation } from '../../util/useNavigation';

export const joinWaitlist = async (email: string) => {
Expand Down Expand Up @@ -48,7 +48,9 @@ const GetRealmPresenter = () => {
};

const onClickSidebarSection = (section: string) => {
if (section === 'Get Hosting') {
if (section === 'Contact Support') {
window.open(getSupportEmail(), '_blank');
} else if (section === 'Get Hosting') {
onClickPurchaseId();
} else {
goToPage(accountPageUrl[section]);
Expand Down
8 changes: 7 additions & 1 deletion hosting-holium-com/src/pages/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
VerifyEmailModal,
} from '@holium/shared';

import { getSupportEmail } from 'util/constants';

import { Page } from '../../components/Page';
import { thirdEarthApi } from '../../util/thirdEarthApi';
import { accountPageUrl, useNavigation } from '../../util/useNavigation';
Expand Down Expand Up @@ -49,7 +51,11 @@ const HostingPresenter = () => {
}, [selectedShip]);

const onClickSidebarSection = (section: string) => {
goToPage(accountPageUrl[section]);
if (section === 'Contact Support') {
window.open(getSupportEmail(selectedShip.patp), '_blank');
} else {
goToPage(accountPageUrl[section]);
}
};

const onSubmitNewEmail = async (email: string) => {
Expand Down
9 changes: 8 additions & 1 deletion hosting-holium-com/src/pages/account/storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
useUser,
} from '@holium/shared';

import { getSupportEmail } from 'util/constants';

import { Page } from '../../components/Page';
import { thirdEarthApi } from '../../util/thirdEarthApi';
import { accountPageUrl, useNavigation } from '../../util/useNavigation';
Expand All @@ -24,7 +26,12 @@ const S3StoragePresenter = () => {
const [minioUsage, setMinioUsage] = useState<number>(0);

const onClickSidebarSection = (section: string) => {
goToPage(accountPageUrl[section]);
if (section === 'Contact Support') {
const ship = ships.find((ship) => ship.id === selectedShipId);
window.open(getSupportEmail(ship?.patp), '_blank');
} else {
goToPage(accountPageUrl[section]);
}
};

const onClickUploadId = () => {
Expand Down
5 changes: 5 additions & 0 deletions hosting-holium-com/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ export const downloadLinks = {
windows: 'https://download.holium.com/latest/windows',
linux: 'https://download.holium.com/latest/linux',
};

export const getSupportEmail = (patp?: string) =>
`mailto:support@holium.com?subject=Hosting Support${
patp ? ` for ${patp}` : ''
}&body=A picture is worth a thousand words. Please attach any screenshots that may help us understand your issue.`;
17 changes: 14 additions & 3 deletions shared/src/onboarding/components/AccountDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export enum SidebarSection {
DownloadRealm = 'Download Realm',
GetHosting = 'Get Hosting',
GetRealm = 'Get Realm',
ContactSupport = 'Contact Support',
}

type Props = {
Expand Down Expand Up @@ -77,22 +78,32 @@ export const AccountDialog = ({
SidebarSection.Hosting,
SidebarSection.CustomDomain,
SidebarSection.DownloadRealm,
SidebarSection.ContactSupport,
];
} else {
sidebarItems = [SidebarSection.Hosting];
sidebarItems = [SidebarSection.Hosting, SidebarSection.ContactSupport];
}
} else {
sidebarItems = [
SidebarSection.Hosting,
SidebarSection.Storage,
SidebarSection.CustomDomain,
SidebarSection.DownloadRealm,
SidebarSection.ContactSupport,
];
}
} else if (hasCSEK.isOn) {
sidebarItems = [SidebarSection.DownloadRealm, SidebarSection.GetHosting];
sidebarItems = [
SidebarSection.DownloadRealm,
SidebarSection.GetHosting,
SidebarSection.ContactSupport,
];
} else {
sidebarItems = [SidebarSection.GetRealm, SidebarSection.GetHosting];
sidebarItems = [
SidebarSection.GetRealm,
SidebarSection.GetHosting,
SidebarSection.ContactSupport,
];
}

useEffect(() => {
Expand Down

1 comment on commit c6127a3

@vercel
Copy link

@vercel vercel bot commented on c6127a3 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hosting-holium-com – ./hosting-holium-com

realm-onboarding.vercel.app
hosting.holium.com
hosting-holium-com-holium.vercel.app
hosting-holium-com-git-master-holium.vercel.app

Please sign in to comment.