Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Bring changes in from part 1 and resolve conflicts

Joshen Lim0c4750338f9b
diff --cc studio/components/interfaces/Organization/Usage/Usage.tsx
index 6eb04b9fe30,087e221556c..9b333974260
--- a/studio/components/interfaces/Organization/Usage/Usage.tsx
+++ b/studio/components/interfaces/Organization/Usage/Usage.tsx
@@@ -10,7 -10,7 +10,8 @@@ import { TIME_PERIODS_BILLING, TIME_PER
import SizeAndCounts from './SizeAndCounts'
import Activity from './Activity'
import { IconLoader } from 'ui'
+import { useOrgUsageQuery } from 'data/usage/org-usage-query'
+ import { ScaffoldContainer, ScaffoldDivider, ScaffoldSection } from 'components/layouts/Scaffold'
const Usage = () => {
const { slug } = useParams()
@@@ -68,43 -66,48 +69,49 @@@
return (
<>
- <div className="flex items-center space-x-4 px-4 py-4 border-b">
- {!isLoadingSubscription && (
- <DateRangePicker
- id="billingCycle"
- name="billingCycle"
- onChange={setDateRange}
- value={TIME_PERIODS_BILLING[0].key}
- options={[...TIME_PERIODS_BILLING, ...TIME_PERIODS_REPORTS]}
- loading={isLoadingSubscription}
- currentBillingPeriodStart={subscription?.current_period_start}
- className="!w-[200px]"
- />
- )}
+ <ScaffoldContainer>
+ <div className="py-4 flex items-center space-x-4">
+ {!isLoadingSubscription && (
+ <DateRangePicker
+ id="billingCycle"
+ name="billingCycle"
+ onChange={setDateRange}
+ value={TIME_PERIODS_BILLING[0].key}
+ options={[...TIME_PERIODS_BILLING, ...TIME_PERIODS_REPORTS]}
+ loading={isLoadingSubscription}
+ currentBillingPeriodStart={subscription?.current_period_start}
+ className="!w-[200px]"
+ />
+ )}
+
+ {isLoadingSubscription ? (
+ <IconLoader className="animate-spin" size={14} />
+ ) : subscription !== undefined ? (
+ <div className="flex flex-col xl:flex-row xl:gap-3">
+ <p className={clsx('text-sm transition', isLoadingSubscription && 'opacity-50')}>
+ Organization is on the {subscription.plan.name} plan
+ </p>
+ <p className="text-sm text-scale-1000">
+ {billingCycleStart.format('DD MMM YYYY')} - {billingCycleEnd.format('DD MMM YYYY')}
+ </p>
+ </div>
+ ) : null}
+ </div>
+ </ScaffoldContainer>
+
+ <ScaffoldDivider />
- {isLoadingSubscription ? (
- <IconLoader className="animate-spin" size={14} />
- ) : subscription !== undefined ? (
- <div className="flex flex-col xl:flex-row xl:gap-3">
- <p className={clsx('text-sm transition', isLoadingSubscription && 'opacity-50')}>
- Organization is on the {subscription.plan.name} plan
- </p>
- <p className="text-sm text-scale-1000">
- {billingCycleStart.format('DD MMM YYYY')} - {billingCycleEnd.format('DD MMM YYYY')}
- </p>
- </div>
- ) : null}
- </div>
<Bandwidth
+ orgSlug={slug as string}
projectRef={selectedProjectRef}
subscription={subscription}
startDate={startDate}
endDate={endDate}
currentBillingCycleSelected={currentBillingCycleSelected}
/>
+
<SizeAndCounts
- projectRef={selectedProjectRef}
+ orgSlug={slug as string}
subscription={subscription}
startDate={startDate}
endDate={endDate}
diff --cc studio/components/interfaces/Organization/Usage/UsageSection.tsx
index fd1f6e0a87f,50ac24685e5..1c623761d23
--- a/studio/components/interfaces/Organization/Usage/UsageSection.tsx
+++ b/studio/components/interfaces/Organization/Usage/UsageSection.tsx
@@@ -24,10 -24,10 +24,11 @@@ import
getUpgradeUrl,
} from './Usage.utils'
import UsageBarChart from './UsageBarChart'
+ import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
interface UsageSectionProps {
- projectRef: string
+ orgSlug: string
+ projectRef?: string // [Joshen TODO] remove
categoryKey: CategoryMetaKey
subscription: ProjectSubscriptionResponse | undefined
chartMeta: {