From a3c505b60bbec2f8727160299a72cb97040fbd58 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 31 Jul 2023 10:57:52 +0800 Subject: [PATCH] Remove alt prop from ProjectDropdown as no longer necessary --- .../LayoutHeader/ProjectDropdown.tsx | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) 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 } @@ -112,23 +105,13 @@ const ProjectDropdown = ({ alt }: { alt?: boolean }) => { } > - ) : ( ) }