@@ -6,11 +6,12 @@ import {
66 SubscriberTypeContext ,
77 useSubscriptions ,
88} from '../../contexts' ;
9- import { Button , Col , descriptors , Flex , localizationKeys } from '../../customizables' ;
9+ import { Col , descriptors , Flex , localizationKeys } from '../../customizables' ;
1010import {
1111 Alert ,
1212 Card ,
1313 Header ,
14+ ProfileSection ,
1415 Tab ,
1516 TabPanel ,
1617 TabPanels ,
@@ -20,6 +21,7 @@ import {
2021 withCardStateProvider ,
2122} from '../../elements' ;
2223import { useTabState } from '../../hooks/useTabState' ;
24+ import { ArrowsUpDown } from '../../icons' ;
2325import { useRouter } from '../../router' ;
2426import { InvoicesList } from '../Invoices' ;
2527import { PaymentSources } from '../PaymentSources' ;
@@ -53,7 +55,7 @@ const OrganizationBillingPageInternal = withCardStateProvider(() => {
5355 >
5456 < Header . Root >
5557 < Header . Title
56- localizationKey = { localizationKeys ( 'userProfile .billingPage.title' ) }
58+ localizationKey = { localizationKeys ( 'organizationProfile .billingPage.title' ) }
5759 textVariant = 'h2'
5860 />
5961 </ Header . Root >
@@ -68,56 +70,70 @@ const OrganizationBillingPageInternal = withCardStateProvider(() => {
6870 < Tab
6971 localizationKey = {
7072 subscriptions . data . length > 0
71- ? localizationKeys ( 'userProfile .billingPage.start.headerTitle__subscriptions' )
72- : localizationKeys ( 'userProfile .billingPage.start.headerTitle__plans' )
73+ ? localizationKeys ( 'organizationProfile .billingPage.start.headerTitle__subscriptions' )
74+ : localizationKeys ( 'organizationProfile .billingPage.start.headerTitle__plans' )
7375 }
7476 />
75- < Tab localizationKey = { localizationKeys ( 'userProfile .billingPage.start.headerTitle__invoices' ) } />
77+ < Tab localizationKey = { localizationKeys ( 'organizationProfile .billingPage.start.headerTitle__invoices' ) } />
7678 </ TabsList >
7779 < TabPanels >
7880 < TabPanel sx = { { width : '100%' , flexDirection : 'column' } } >
79- < Flex
80- sx = { { width : '100%' , flexDirection : 'column' } }
81- gap = { 4 }
82- >
83- { subscriptions . data . length > 0 ? (
84- < >
81+ { subscriptions . data . length > 0 ? (
82+ < Flex
83+ sx = { { width : '100%' , flexDirection : 'column' } }
84+ gap = { 4 }
85+ >
86+ < ProfileSection . Root
87+ id = 'subscriptionsList'
88+ title = { localizationKeys ( 'organizationProfile.billingPage.subscriptionsListSection.title' ) }
89+ centered = { false }
90+ sx = { t => ( {
91+ borderTop : 'none' ,
92+ paddingTop : t . space . $1 ,
93+ } ) }
94+ >
8595 < Protect condition = { has => ! has ( { permission : 'org:sys_billing:manage' } ) } >
8696 < Alert
8797 variant = 'info'
8898 colorScheme = 'info'
89- title = { localizationKeys ( 'organizationProfile.billingPage.alerts.noPemissionsToManageBilling ' ) }
99+ title = { localizationKeys ( 'organizationProfile.billingPage.alerts.noPermissionsToManageBilling ' ) }
90100 />
91101 </ Protect >
92102 < SubscriptionsList />
93- < Button
94- localizationKey = 'View all plans'
95- hasArrow
96- variant = 'ghost'
97- onClick = { ( ) => navigate ( 'plans' ) }
98- sx = { {
99- width : 'fit-content' ,
100- } }
103+ < ProfileSection . ArrowButton
104+ id = 'subscriptionsList'
105+ textLocalizationKey = { localizationKeys (
106+ 'organizationProfile.billingPage.subscriptionsListSection.actionLabel__switchPlan' ,
107+ ) }
108+ sx = { [
109+ t => ( {
110+ justifyContent : 'start' ,
111+ height : t . sizes . $8 ,
112+ } ) ,
113+ ] }
114+ leftIcon = { ArrowsUpDown }
115+ leftIconSx = { t => ( { width : t . sizes . $4 , height : t . sizes . $4 } ) }
116+ onClick = { ( ) => void navigate ( 'plans' ) }
101117 />
102- < Protect condition = { has => has ( { permission : 'org:sys_billing:manage' } ) } >
103- < PaymentSources / >
104- </ Protect >
105- </ >
106- ) : (
107- < >
108- < Protect condition = { has => ! has ( { permission : 'org:sys_billing:manage' } ) } >
109- < Alert
110- variant = 'info'
111- colorScheme = 'info'
112- title = { localizationKeys ( 'organizationProfile.billingPage.alerts.noPemissionsToManageBilling' ) }
113- />
114- </ Protect >
115- < PricingTableContext . Provider value = { { componentName : 'PricingTable' , mode : 'modal' } } >
116- < PricingTable / >
117- </ PricingTableContext . Provider >
118- </ >
119- ) }
120- </ Flex >
118+ </ ProfileSection . Root >
119+ < Protect condition = { has => has ( { permission : 'org:sys_billing:manage' } ) } >
120+ < PaymentSources / >
121+ </ Protect >
122+ </ Flex >
123+ ) : (
124+ < >
125+ < Protect condition = { has => ! has ( { permission : 'org:sys_billing:manage' } ) } >
126+ < Alert
127+ variant = 'info'
128+ colorScheme = 'info'
129+ title = { localizationKeys ( 'organizationProfile.billingPage.alerts.noPermissionsToManageBilling' ) }
130+ / >
131+ </ Protect >
132+ < PricingTableContext . Provider value = { { componentName : ' PricingTable' , mode : 'modal' } } >
133+ < PricingTable / >
134+ </ PricingTableContext . Provider >
135+ </ >
136+ ) }
121137 </ TabPanel >
122138 < TabPanel sx = { { width : '100%' } } >
123139 < InvoicesContextProvider >
0 commit comments