Skip to content

Commit

Permalink
Remove feature flags for Pool Details v2 and Portolio pages (#1484)
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyDelott authored Sep 11, 2024
1 parent b336046 commit 0ae50d4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 37 deletions.
6 changes: 0 additions & 6 deletions apps/hyperdrive-trading/src/ui/app/Navbar/DevtoolsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ export function DevtoolsMenu(): ReactElement {
{/* <FeatureFlagMenuItem flagName="name-here">
Menu Item Name here
</FeatureFlagMenuItem> */}
<FeatureFlagMenuItem flagName="pool-details-v2">
Pool Details v2
</FeatureFlagMenuItem>
<FeatureFlagMenuItem flagName="portfolio">
Portfolio
</FeatureFlagMenuItem>
<MenuItem
onClick={() => {
throw new Error(
Expand Down
24 changes: 10 additions & 14 deletions apps/hyperdrive-trading/src/ui/app/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import { ReactElement } from "react";
import { DevtoolsMenu } from "src/ui/app/Navbar/DevtoolsMenu";
import { HyperdriveLogo } from "src/ui/app/Navbar/HyperdriveLogo";
import VersionPicker from "src/ui/base/components/VersionPicker";
import { useFeatureFlag } from "src/ui/base/featureFlags/featureFlags";
import { useIsTailwindSmallScreen } from "src/ui/base/mediaBreakpoints";
import { sepolia } from "viem/chains";
import { useChainId } from "wagmi";
export function Navbar(): ReactElement {
const isTailwindSmallScreen = useIsTailwindSmallScreen();
const { location } = useRouterState();
const chainId = useChainId();
const { isFlagEnabled: isPortfolioEnabled } = useFeatureFlag("portfolio");
return (
<div className="daisy-navbar">
<div className="daisy-navbar-start ml-2">
Expand Down Expand Up @@ -48,18 +46,16 @@ export function Navbar(): ReactElement {
Bridge
</span>
</Link>
{isPortfolioEnabled ? (
<Link to={"/portfolio"}>
<span
className={classNames("text-md", {
"text-white": location.pathname === "/portfolio",
"text-neutral-content": location.pathname !== "/portfolio",
})}
>
Portfolio
</span>
</Link>
) : null}
<Link to={"/portfolio"}>
<span
className={classNames("text-md", {
"text-white": location.pathname === "/portfolio",
"text-neutral-content": location.pathname !== "/portfolio",
})}
>
Portfolio
</span>
</Link>
</div>
</div>
<div className="daisy-navbar-end gap-2 sm:gap-8">
Expand Down
9 changes: 1 addition & 8 deletions apps/hyperdrive-trading/src/ui/markets/Market.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ import { useParams } from "@tanstack/react-router";
import { ReactElement } from "react";
import { Helmet } from "react-helmet";
import { useAppConfig } from "src/ui/appconfig/useAppConfig";
import { useFeatureFlag } from "src/ui/base/featureFlags/featureFlags";
import { MarketDetailsBody } from "src/ui/markets/MarketDetailsBody/MarketDetailsBody";
import { PoolDetails } from "src/ui/markets/PoolDetails/PoolDetails";
import { MARKET_DETAILS_ROUTE } from "src/ui/markets/routes";
import { Address } from "viem";

export function Market(): ReactElement {
const { address, chainId } = useParams({ from: MARKET_DETAILS_ROUTE });
const appConfig = useAppConfig();
const { isFlagEnabled: isPoolDetailsV2 } = useFeatureFlag("pool-details-v2");

const hyperdrive = findHyperdriveConfig({
hyperdriveChainId: Number(chainId),
Expand All @@ -28,11 +25,7 @@ export function Market(): ReactElement {
</title>
</Helmet>

{isPoolDetailsV2 ? (
<PoolDetails hyperdrive={hyperdrive} />
) : (
<MarketDetailsBody hyperdrive={hyperdrive} />
)}
<PoolDetails hyperdrive={hyperdrive} />
</div>
);
}
11 changes: 2 additions & 9 deletions apps/hyperdrive-trading/src/ui/token/SlippageSettingsTwo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
import classNames from "classnames";
import { ReactElement, useState } from "react";
import { PercentInput } from "src/ui/base/components/PercentInput";
import { useFeatureFlag } from "src/ui/base/featureFlags/featureFlags";

export const DEFAULT_SLIPPAGE_AMOUNT = "0.5";

Expand All @@ -23,7 +22,6 @@ export function SlippageSettingsTwo({
tooltip?: string;
}): ReactElement {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const { isFlagEnabled: isPoolDetailsV2 } = useFeatureFlag("pool-details-v2");

return (
<div className="daisy-dropdown daisy-dropdown-bottom flex justify-end">
Expand All @@ -35,17 +33,12 @@ export function SlippageSettingsTwo({
setIsDropdownOpen((prevState) => !prevState);
}}
className={
isPoolDetailsV2
? "daisy-btn daisy-btn-md h-9 min-h-9 rounded-full text-xs font-normal text-neutral-content"
: "daisy-btn daisy-btn-ghost daisy-btn-sm flex flex-row items-center justify-end gap-2 text-xs font-light text-neutral-content"
"daisy-btn daisy-btn-md h-9 min-h-9 rounded-full text-xs font-normal text-neutral-content"
}
>
{`${slippage || DEFAULT_SLIPPAGE_AMOUNT}%`} slippage
<Cog6ToothIcon
className={classNames(
"h-4 stroke-2",
isPoolDetailsV2 ? "test-neutral-content" : "text-base-content",
)}
className={classNames("h-4 stroke-2", "test-neutral-content")}
/>
</button>
{isDropdownOpen && (
Expand Down

0 comments on commit 0ae50d4

Please sign in to comment.