Skip to content

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

Remove alt prop from ProjectDropdown as no longer necessary

Joshen Lima3c505b60bbe
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/ProjectDropdown.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/ProjectDropdown.tsx
index 232e27d29f5..d8c59401f7c 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/ProjectDropdown.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/ProjectDropdown.tsx
@@ -1,15 +1,14 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
import { ParsedUrlQuery } from 'querystring'
-import { Badge, Button, Dropdown, IconCode, IconPlus, Popover } from 'ui'
+import { Button, Dropdown, IconPlus, Popover } from 'ui'
+import ShimmeringLoader from 'components/ui/ShimmeringLoader'
+import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { useProjectsQuery } from 'data/projects/projects-query'
import { useSelectedOrganization, useSelectedProject } from 'hooks'
import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
-import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { Organization, Project } from 'types'
-import { useOrganizationsQuery } from 'data/organizations/organizations-query'
-import { useProjectSubscriptionV2Query } from 'data/subscriptions/project-subscription-v2-query'
// [Fran] the idea is to let users change projects without losing the current page,
// but at the same time we need to redirect correctly between urls that might be
@@ -73,20 +72,14 @@ const ProjectLink = ({
)
}
-const ProjectDropdown = ({ alt }: { alt?: boolean }) => {
+const ProjectDropdown = () => {
const selectedProject = useSelectedProject()
const selectedOrganization = useSelectedOrganization()
const { data: allProjects, isLoading: isLoadingProjects } = useProjectsQuery()
const { data: allOrganizations } = useOrganizationsQuery()
const selectedOrganizationSlug = selectedOrganization?.slug
- const isOrgBilling = !!selectedOrganization?.subscription_id
- const { data: subscription, isSuccess } = useProjectSubscriptionV2Query(
- { projectRef: selectedProject?.ref },
- { enabled: alt && !isOrgBilling }
- )
-
- if (isLoadingProjects && alt) {
+ if (isLoadingProjects) {
return <ShimmeringLoader className="w-[90px]" />
}
@@ -112,23 +105,13 @@ const ProjectDropdown = ({ alt }: { alt?: boolean }) => {
</>
}
>
- <Button
- type="text"
- iconRight={
- alt ? <IconCode className="text-scale-1100 rotate-90" strokeWidth={2} size={12} /> : null
- }
- >
+ <Button type="text">
<span className="text-sm">{selectedProject?.name}</span>
- {alt && isSuccess && !isOrgBilling && (
- <Badge color="slate" className="ml-2">
- {subscription?.plan.name}
- </Badge>
- )}
</Button>
</Dropdown>
) : (
<Button type="text">
- <span className="text-sm">{selectedProject?.name}</span>
+ <span className="text-xs">{selectedProject?.name}</span>
</Button>
)
}