Skip to content

Commit

Permalink
deprecate some growthbook code
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Sep 4, 2024
1 parent 6dfaecd commit 5b2a6cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 38 deletions.
29 changes: 1 addition & 28 deletions www/src/components/Plural.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Suspense, lazy, useEffect, useState } from 'react'
import { Suspense, lazy } from 'react'
import { Navigate, Outlet, Route, Routes, useMatch } from 'react-router-dom'
import { Toast } from '@pluralsh/design-system'

import { growthbook } from '../helpers/growthbook'
import { useHistory } from '../router'

import { WrapStripe } from './WrapStripe'
Expand Down Expand Up @@ -270,30 +268,6 @@ function OAuthOrFallback() {
)
}

function TestBanner() {
const [enable, setEnable] = useState(true)

useEffect(() => {
const timeout = setTimeout(() => setEnable(false), 5000)

return () => clearTimeout(timeout)
}, [])

if (growthbook.isOn('growthbook-test') && enable) {
return (
<Toast
severity="success"
marginBottom="medium"
marginRight="xxxxlarge"
>
Growthbook Test!
</Toast>
)
}

return null
}

export function PluralInner() {
return (
<WrapStripe>
Expand All @@ -304,7 +278,6 @@ export function PluralInner() {
<LegacyExpirationNotice />
<VerifyEmailConfirmed />
<DeviceLoginNotif />
<TestBanner />
<Routes>
{/* --- OAUTH --- */}
{/* TODO: Enable if route will be used by the app */}
Expand Down
4 changes: 1 addition & 3 deletions www/src/components/marketplace/MarketplaceRepositories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import orderBy from 'lodash/orderBy'

import { upperFirst } from 'lodash'

import { growthbook } from '../../helpers/growthbook'

import { ResponsiveLayoutSidecarContainer } from '../utils/layout/ResponsiveLayoutSidecarContainer'
import { ResponsiveLayoutSpacer } from '../utils/layout/ResponsiveLayoutSpacer'

Expand Down Expand Up @@ -109,7 +107,7 @@ function MarketplaceRepositories({ publisher }: { publisher?: any }) {

const isFiltered = !isEmpty(categories) || !isEmpty(tags)
const isFilteredOrSearched = isFiltered || search
const shouldRenderStacks = growthbook.isOn('stacks') && !isFilteredOrSearched
const shouldRenderStacks = !isFilteredOrSearched

useEffect(() => {
const { current } = scrollRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { useContext, useEffect, useState } from 'react'

import { FormField, ListBoxItem, Select } from '@pluralsh/design-system'

import { growthbook } from '../../../../../helpers/growthbook'
import { CloudProvider, CloudProviderDisplayName } from '../../context/types'
import { OnboardingContext } from '../../context/onboarding'

import Provider from './provider/Provider'

const CLOUDS = Object.values(CloudProvider)
const GROWTHBOOK_AZURE_CLOUD_KEY = 'azure-cloud-shell'

interface ProviderItem {
key: string
Expand All @@ -21,11 +19,7 @@ function CloudCredentials() {
const [provider, setProvider] = useState<CloudProvider>(
cloud?.provider || CloudProvider.AWS
)
const providers = (
growthbook.isOn(GROWTHBOOK_AZURE_CLOUD_KEY)
? CLOUDS
: CLOUDS.filter((c) => c !== CloudProvider.Azure)
).map<ProviderItem>((c) => ({
const providers = CLOUDS.map<ProviderItem>((c) => ({
key: c,
label: CloudProviderDisplayName[c],
}))
Expand Down

0 comments on commit 5b2a6cc

Please sign in to comment.