mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 23:30:35 +00:00
feat(ui): improve mobile responsive layouts
This commit is contained in:
+28
-13
@@ -54,6 +54,7 @@ export function Wallet(props: WalletProps) {
|
||||
const [creemDialogOpen, setCreemDialogOpen] = useState(false)
|
||||
const [selectedCreemProduct, setSelectedCreemProduct] =
|
||||
useState<CreemProduct | null>(null)
|
||||
const [showSubscriptionPanel, setShowSubscriptionPanel] = useState(true)
|
||||
|
||||
const { status } = useStatus()
|
||||
const { currency } = useSystemConfig()
|
||||
@@ -231,6 +232,13 @@ export function Wallet(props: WalletProps) {
|
||||
return topupInfo?.discount?.[topupAmount] || DEFAULT_DISCOUNT_RATE
|
||||
}, [topupInfo, topupAmount])
|
||||
|
||||
const handleSubscriptionAvailabilityChange = useCallback(
|
||||
(available: boolean) => {
|
||||
setShowSubscriptionPanel(available)
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<SectionPageLayout>
|
||||
@@ -239,13 +247,17 @@ export function Wallet(props: WalletProps) {
|
||||
{t('Manage your balance and payment methods')}
|
||||
</SectionPageLayout.Description>
|
||||
<SectionPageLayout.Content>
|
||||
<div className='mx-auto flex w-full max-w-7xl flex-col gap-4'>
|
||||
<div className='mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-5'>
|
||||
<WalletStatsCard user={user} loading={userLoading} />
|
||||
|
||||
<SubscriptionPlansCard topupInfo={topupInfo} />
|
||||
|
||||
<div className='grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(340px,0.4fr)] xl:items-start'>
|
||||
<div className='min-w-0'>
|
||||
<div
|
||||
className={
|
||||
showSubscriptionPanel
|
||||
? 'grid gap-4 xl:grid-cols-[minmax(0,1.05fr)_minmax(360px,0.95fr)] xl:items-start'
|
||||
: 'grid gap-4'
|
||||
}
|
||||
>
|
||||
<div id='wallet-add-funds' className='scroll-mt-4'>
|
||||
<RechargeFormCard
|
||||
topupInfo={topupInfo}
|
||||
presetAmounts={presetAmounts}
|
||||
@@ -279,15 +291,18 @@ export function Wallet(props: WalletProps) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='xl:sticky xl:top-6'>
|
||||
<AffiliateRewardsCard
|
||||
user={user}
|
||||
affiliateLink={affiliateLink}
|
||||
onTransfer={() => setTransferDialogOpen(true)}
|
||||
loading={affiliateLoading}
|
||||
/>
|
||||
</div>
|
||||
<SubscriptionPlansCard
|
||||
topupInfo={topupInfo}
|
||||
onAvailabilityChange={handleSubscriptionAvailabilityChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AffiliateRewardsCard
|
||||
user={user}
|
||||
affiliateLink={affiliateLink}
|
||||
onTransfer={() => setTransferDialogOpen(true)}
|
||||
loading={affiliateLoading}
|
||||
/>
|
||||
</div>
|
||||
</SectionPageLayout.Content>
|
||||
</SectionPageLayout>
|
||||
|
||||
Reference in New Issue
Block a user