Skip to content

Commit

Permalink
Merge pull request #955 from decentraland/fix/remove-layout-feature-f…
Browse files Browse the repository at this point in the history
…lags

fix: Remove layout feature flags
  • Loading branch information
LautaroPetaccio authored Jan 17, 2025
2 parents 12438de + df0f5e2 commit 431c7a1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions src/components/Layout/Layout2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import {
import useAuthContext from '../../context/Auth/useAuthContext'
import useProfileInjected from '../../context/Auth/useProfileContext'
import { getSupportedChainIds } from '../../context/Auth/utils'
import { useFeatureFlagContext } from '../../context/FeatureFlag'
import { DappsFeatureFlags } from '../../context/FeatureFlag/types'
import useShareContext from '../../context/Share/useShareContext'
import useTrackLinkContext from '../../context/Track/useTrackLinkContext'
import useAsyncState from '../../hooks/useAsyncState'
Expand All @@ -53,7 +51,6 @@ import TokenList from '../../utils/dom/TokenList'
import { fetchManaBalance } from '../../utils/loader/manaBalance'
import trackEvent from '../../utils/segment/trackEvent'
import ShareModal from '../Modal/ShareModal'
import WalletSelectorModal from '../Modal/WalletSelectorModal'
import WrongNetworkModal from '../Modal/WrongNetworkModal'
import Profile from '../Profile/Avatar'

Expand Down Expand Up @@ -84,7 +81,6 @@ export default function Layout2({
}: LayoutProps) {
const locale = pageContext?.intl?.locale || 'en'
const locales = pageContext?.intl?.locales || ['en']
const [ff] = useFeatureFlagContext()
const [user, userState] = useAuthContext()
const [, shareState] = useShareContext()
const identity: AuthIdentity | undefined = useMemo(() => {
Expand Down Expand Up @@ -196,20 +192,8 @@ export default function Layout2({
[userState]
)

const handleConnect = useCallback(
(providerType: ProviderType, chainId: ChainId) =>
userState.connect(providerType, chainId),
[userState]
)

const handleCancelConnect = useCallback(
() => userState.select(false),
[userState]
)

const [profile, profileState] = useProfileInjected()
const chainId = useChainId()
const isAuthDappEnabled = ff.enabled(DappsFeatureFlags.AuthDappEnabled)
const loading = userState.loading || profileState.loading

const [manaBalances] = useAsyncState<
Expand Down Expand Up @@ -282,9 +266,7 @@ export default function Layout2({
onClickNavbarItem={handleClickNavbarOption}
onClickUserMenuItem={handleClickUserMenuOption}
onClickOpen={handleOpen}
onClickSignIn={
isAuthDappEnabled ? userState.authorize : userState.select
}
onClickSignIn={userState.authorize}
onClickSignOut={handleSignOut}
notifications={notificationProps}
/>
Expand All @@ -299,15 +281,6 @@ export default function Layout2({
onSwitchNetwork={handleSwitchNetwork}
providerType={userState.providerType}
/>
<WalletSelectorModal
open={userState.selecting}
loading={userState.loading}
error={userState.error}
onConnect={handleConnect}
availableProviders={availableProviders}
disabledWalletConnect2={!ff.enabled(DappsFeatureFlags.WalletConnectV2)}
onClose={handleCancelConnect}
/>
{!hideFooter && (
<Footer
locale={locale as Locale}
Expand Down

0 comments on commit 431c7a1

Please sign in to comment.