Skip to content

Commit

Permalink
Add account support page
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Dec 31, 2024
1 parent 8d71698 commit ce28b2c
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 63 deletions.
13 changes: 13 additions & 0 deletions components/account-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ const AccountMenu: FunctionComponent = function () {
</Link>
</li>
)}

<li
className={`list-item ${
router.pathname.includes('account/support') ? 'active' : ''
}`}
>
<Link
href='/account/support/'
className='list-link text-reset ps-4'
>
Support
</Link>
</li>
</>
)}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion components/plans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const faq: AccordionData = [
title:
'What is the difference between "Email support" and "Enterprise support"?',
content:
"Email support is a standard support service provided to all users. You can contact us at any time by email and we will help you with your questions without a guaranteed response time. Enterprise support is a premium support service provided to Enterprise plan users with a guaranteed response time. For more information, please refer to the <a href='/terms/'>terms of service</a>."
"Email support is a standard support service provided to all our paid customers. You can contact us at any time by email and we will help you with your questions without a guaranteed response time. The usual response time is of one business day. Enterprise support is a premium support service provided to Enterprise plan users with a guaranteed response time. Specific SLA can be negotiated. For more information, please refer to the <a href='/terms/'>terms of service</a>."
},
{
title:
Expand Down
49 changes: 0 additions & 49 deletions pages/account/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,55 +463,6 @@ const AccountSubscription: FunctionComponent = function () {
)}
</>
)}

{!isUserLoading &&
(userData?.plan === 'SOLO' ||
userData?.plan === 'TEAM') && (
<div className='card card-bleed shadow-light-lg mb-6'>
<div className='card-header'>
<h4 className='mb-0'>Email support</h4>
</div>
<div className='card-body'>
<div className='list-group list-group-flush'>
<div className='list-group-item'>
<p className='mb-0'>
Contact us at{' '}
<a href='mailto:[email protected]'>
[email protected]
</a>
</p>
<small className='text-gray-700'>
Usual response time is between 24 and 48 hours
</small>
</div>
</div>
</div>
</div>
)}

{!isUserLoading && userData?.plan === 'ENTERPRISE' && (
<div className='card card-bleed shadow-light-lg mb-6'>
<div className='card-header'>
<h4 className='mb-0'>Priority support</h4>
</div>
<div className='card-body'>
<div className='list-group list-group-flush'>
<div className='list-group-item'>
<p className='mb-0'>
Contact us at{' '}
<a href='mailto:[email protected]'>
[email protected]
</a>
</p>
<small className='text-gray-700'>
Guaranteed response time of one business day (9 am
to 5 pm CET/CEST, Monday to Friday).
</small>
</div>
</div>
</div>
</div>
)}
</div>
</div>
</div>
Expand Down
116 changes: 116 additions & 0 deletions pages/account/support.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import { useRouter } from 'next/router';
import { FunctionComponent, useEffect } from 'react';
import AccountHeader from '../../components/account-header';
import AccountMenu from '../../components/account-menu';
import LoadingPage from '../../components/loading-page';
import Meta from '../../components/meta';
import PaddleScript from '../../components/paddle';
import Layout from '../../layout/layout';
import { useAuth } from '../../utils/auth';
import { useCurrentUser } from '../../utils/queries';

const meta = {
title: 'My account - Priority support',
description: 'Get priority support with your Mockoon Cloud plan'
};

const AccountSubscription: FunctionComponent = function () {
const { isAuth, user, isLoading: isAuthLoading } = useAuth();
const router = useRouter();
const { isLoading: isUserLoading, data: userData } = useCurrentUser();

useEffect(() => {
if (!isAuthLoading) {
if (!user) {
router.push('/login/');
} else if (user && !isAuth) {
router.push('/email-verification/');
}
}
}, [isAuthLoading, user, isAuth]);

return (
<Layout footerBanner='download'>
<Meta title={meta.title} description={meta.description} />

{isAuthLoading && <LoadingPage />}

{!isAuthLoading && isAuth && (
<>
<PaddleScript />
<AccountHeader title='My account' subtitle='Get priority support' />

<main className='pb-8 pb-md-11 mt-md-n6'>
<div className='container-md'>
<div className='row'>
<div className='col-12 col-md-3'>
<AccountMenu />
</div>
<div className='col-12 col-md-9'>
{!isUserLoading &&
(userData?.plan === 'SOLO' ||
userData?.plan === 'TEAM') && (
<div className='card card-bleed shadow-light-lg mb-6'>
<div className='card-header'>
<h4 className='mb-0'>Email support</h4>
<small className='text-gray-700'>
You benefit from priority email support with your
plan
</small>
</div>
<div className='card-body'>
<div className='list-group list-group-flush'>
<div className='list-group-item'>
<p className='mb-0'>
Contact us at{' '}
<a href='mailto:[email protected]'>
[email protected]
</a>
</p>
<small className='text-gray-700'>
Usual response time: one business day
</small>
</div>
</div>
</div>
</div>
)}

{!isUserLoading && userData?.plan === 'ENTERPRISE' && (
<div className='card card-bleed shadow-light-lg mb-6'>
<div className='card-header'>
<h4 className='mb-0'>Priority support</h4>
<small className='text-gray-700'>
You benefit from priority enterprise support with your
plan
</small>
</div>
<div className='card-body'>
<div className='list-group list-group-flush'>
<div className='list-group-item'>
<p className='mb-0'>
Contact us at{' '}
<a href='mailto:[email protected]'>
[email protected]
</a>
</p>
<small className='text-gray-700'>
Guaranteed response time of one business day (9 am
to 5 pm CET/CEST, Monday to Friday).
</small>
</div>
</div>
</div>
</div>
)}
</div>
</div>
</div>
</main>
</>
)}
</Layout>
);
};

export default AccountSubscription;
17 changes: 4 additions & 13 deletions pages/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,15 @@ const Contact: FunctionComponent = function () {
<h3 className='text-center fw-medium'>Community support</h3>
<p className='px-2 text-center text-gray-700'>
You can ask for help or discuss ideas and improvements on
our GitHub Discussion forum. You are also welcome on our
Discord server.
our GitHub Discussion forum.
</p>
<div className='mt-auto text-center'>
<a
href='https://github.com/mockoon/mockoon/discussions'
target='_blank'
rel='noopener'
>
GitHub
</a>
&nbsp;|&nbsp;
<a
href='https://discord.gg/FtJjkejKGp'
target='_blank'
rel='noopener'
>
Discord
Go to the forum
</a>
</div>
</div>
Expand Down Expand Up @@ -102,7 +93,7 @@ const Contact: FunctionComponent = function () {
help you with any issue you may have with the product.
</p>
<div className='mt-auto text-center'>
<a href='/account/subscription/'>Get email support</a>
<a href='/account/support/'>Get email support</a>
</div>
</div>
</div>
Expand All @@ -128,7 +119,7 @@ const Contact: FunctionComponent = function () {
may have with the product.
</p>
<div className='mt-auto text-center'>
<a href='/account/subscription/'>Get priority support</a>
<a href='/account/support/'>Get priority support</a>
</div>
</div>
</div>
Expand Down

0 comments on commit ce28b2c

Please sign in to comment.