mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 07:09:07 +03:00
Present use card option only if paid org subscription
This commit is contained in:
1 parent
97d90c3597
commit
1a57ebf15e
1 file changed
+12
-7
+12
-7
@@ -32,6 +32,7 @@ const PaymentMethods = () => {
|
||||
const [showAddPaymentMethodModal, setShowAddPaymentMethodModal] = useState(false)
|
||||
|
||||
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: slug })
|
||||
console.log(subscription)
|
||||
const {
|
||||
data: paymentMethods,
|
||||
error,
|
||||
@@ -143,13 +144,17 @@ const PaymentMethods = () => {
|
||||
size="tiny"
|
||||
align="end"
|
||||
overlay={[
|
||||
<Dropdown.Item
|
||||
key="make-default"
|
||||
onClick={() => setSelectedMethodForUse(paymentMethod)}
|
||||
>
|
||||
Use this card
|
||||
</Dropdown.Item>,
|
||||
<Dropdown.Separator key="card-separator" />,
|
||||
...(subscription?.plan.id !== 'free'
|
||||
? [
|
||||
<Dropdown.Item
|
||||
key="make-default"
|
||||
onClick={() => setSelectedMethodForUse(paymentMethod)}
|
||||
>
|
||||
Use this card
|
||||
</Dropdown.Item>,
|
||||
<Dropdown.Separator key="card-separator" />,
|
||||
]
|
||||
: []),
|
||||
<Dropdown.Item
|
||||
key="delete-method"
|
||||
onClick={() => setSelectedMethodToDelete(paymentMethod)}
|
||||
|
||||
Reference in new issue
Block a user