-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove contact us message for team users that want to downgrade (
- Loading branch information
1 parent
cb20ddd
commit 7e90ac2
Showing
1 changed file
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import {useFragment} from 'react-relay' | |
import {OrgBillingDangerZone_organization$key} from '~/__generated__/OrgBillingDangerZone_organization.graphql' | ||
import ArchiveOrganization from '~/modules/teamDashboard/components/ArchiveTeam/ArchiveOrganization' | ||
import Panel from '../../../../components/Panel/Panel' | ||
import useRouter from '../../../../hooks/useRouter' | ||
import {PALETTE} from '../../../../styles/paletteV3' | ||
import {ElementWidth, Layout} from '../../../../types/constEnums' | ||
|
||
|
@@ -24,25 +25,6 @@ const PanelRow = styled('div')({ | |
textAlign: 'center' | ||
}) | ||
|
||
const Unsubscribe = styled('div')({ | ||
alignItems: 'center', | ||
color: PALETTE.SLATE_700, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
'& a': { | ||
alignItems: 'center', | ||
color: PALETTE.SKY_500, | ||
display: 'flex', | ||
marginLeft: 8, | ||
'& > u': { | ||
textDecoration: 'none' | ||
}, | ||
'&:hover > u, &:focus > u': { | ||
textDecoration: 'underline' | ||
} | ||
} | ||
}) | ||
|
||
const StyledPanel = styled(Panel)<{isWide: boolean}>(({isWide}) => ({ | ||
maxWidth: isWide ? ElementWidth.PANEL_WIDTH : 'inherit' | ||
})) | ||
|
@@ -58,33 +40,58 @@ const OrgBillingDangerZone = (props: Props) => { | |
graphql` | ||
fragment OrgBillingDangerZone_organization on Organization { | ||
...ArchiveOrganization_organization | ||
id | ||
isBillingLeader | ||
billingTier | ||
} | ||
`, | ||
organizationRef | ||
) | ||
const {isBillingLeader, billingTier} = organization | ||
const {history} = useRouter() | ||
const {id, isBillingLeader, billingTier} = organization | ||
if (!isBillingLeader) return null | ||
const isStarter = billingTier === 'starter' | ||
const isTeam = billingTier === 'team' | ||
|
||
const handleDowngrade = () => { | ||
history.push(`/me/organizations/${id}/billing`) | ||
} | ||
|
||
return ( | ||
<StyledPanel isWide={isWide} label='Danger Zone'> | ||
<PanelRow> | ||
{isStarter ? ( | ||
<ArchiveOrganization organization={organization} /> | ||
) : isTeam ? ( | ||
<div className='flex items-center justify-center text-slate-700'> | ||
<span>{'Need to cancel? '}</span> | ||
<a | ||
onClick={handleDowngrade} | ||
title='Downgrade' | ||
className='ml-1 mr-1 flex items-center text-sky-500' | ||
> | ||
<u className='no-underline hover:cursor-pointer hover:underline focus:underline'> | ||
{'Downgrade'} | ||
</u> | ||
</a> | ||
<span>{' to the Starter tier'}</span> | ||
</div> | ||
) : ( | ||
<Unsubscribe> | ||
<div className='flex items-center justify-center text-slate-700'> | ||
<span>{'Need to cancel? It’s painless. '}</span> | ||
<a | ||
href='mailto:[email protected]?subject=Instant Unsubscribe from Team Plan' | ||
title='Instant Unsubscribe from Team Plan' | ||
className='ml-1 mr-1 flex items-center text-sky-500' | ||
> | ||
<u>{'Contact us'}</u> | ||
<u className='no-underline hover:cursor-pointer hover:underline focus:underline'> | ||
{'Contact us'} | ||
</u> | ||
<EnvelopeIcon> | ||
<EmailIcon /> | ||
</EnvelopeIcon> | ||
</a> | ||
</Unsubscribe> | ||
</div> | ||
)} | ||
</PanelRow> | ||
</StyledPanel> | ||
|