Skip to content

Commit

Permalink
fix: Styling alert for API usage banner (#4360)
Browse files Browse the repository at this point in the history
  • Loading branch information
novakzaballa authored Jul 18, 2024
1 parent bce6530 commit 61cfdbf
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions frontend/web/components/OrganisationLimit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,41 @@ const OrganisationLimit: FC<OrganisationLimitType> = ({
totalApiCalls?.totals.total,
)}/${Format.shortenNumber(maxApiCalls?.max_api_calls)}`

const alertMaxApiCallsText = `You have used ${apiUsageMessageText} of your allowed requests.`
const alertMaxApiCallsText = `You have used ${apiUsageMessageText} of your allowed requests`

const QuotaExceededMessage = () => {
return (
<div
className={'alert alert-danger announcement'}
style={{ display: 'initial' }}
>
<span className='icon-alert'>
<Icon name='close-circle' />
</span>
<>
Your organisation has exceeded its API usage quota{' '}
{`(${alertMaxApiCallsText}).`}{' '}
{Utils.getPlanName(organisationPlan) === 'Free' ? (
<b>Please upgrade your plan to continue receiving service.</b>
) : (
<b>Automated billing for the overages may apply.</b>
)}
</>
<Button
className='btn ml-3'
onClick={() => {
document.location.replace(Constants.upgradeURL)
}}
>
Upgrade plan
</Button>
<Row>
<span className='icon-alert'>
<Icon name='close-circle' />
</span>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
Your organisation has exceeded its API usage quota{' '}
{`(${alertMaxApiCallsText}).`}{' '}
{Utils.getPlanName(organisationPlan) === 'Free' ? (
<b>Please upgrade your plan to continue receiving service.</b>
) : (
<b>Automated billing for the overages may apply.</b>
)}
</div>
<Button
className='btn ml-3'
onClick={() => {
document.location.replace(Constants.upgradeURL)
}}
>
Upgrade plan
</Button>
</Row>
</div>
)
}
Expand Down

0 comments on commit 61cfdbf

Please sign in to comment.