2
0

🐛 (limits) Fix storage limit trigger and e2e tests

This commit is contained in:
Baptiste Arnaud
2022-09-24 08:58:23 +02:00
committed by Baptiste Arnaud
parent 1e26703ad4
commit 30dff2d5d7
52 changed files with 1024 additions and 2205 deletions

View File

@ -5,9 +5,9 @@ import { isNotDefined } from 'utils'
import { ChangePlanModal } from '../modals/ChangePlanModal'
import { LimitReached } from '../modals/ChangePlanModal'
type Props = { type?: LimitReached } & ButtonProps
type Props = { limitReachedType?: LimitReached } & ButtonProps
export const UpgradeButton = ({ type, ...props }: Props) => {
export const UpgradeButton = ({ limitReachedType, ...props }: Props) => {
const { isOpen, onOpen, onClose } = useDisclosure()
const { workspace } = useWorkspace()
return (
@ -18,7 +18,11 @@ export const UpgradeButton = ({ type, ...props }: Props) => {
onClick={onOpen}
>
{props.children ?? 'Upgrade'}
<ChangePlanModal isOpen={isOpen} onClose={onClose} type={type} />
<ChangePlanModal
isOpen={isOpen}
onClose={onClose}
type={limitReachedType}
/>
</Button>
)
}