diff --git a/src/typescript/frontend/src/components/EmojiPill.tsx b/src/typescript/frontend/src/components/EmojiPill.tsx new file mode 100644 index 000000000..dbc8b08dd --- /dev/null +++ b/src/typescript/frontend/src/components/EmojiPill.tsx @@ -0,0 +1,36 @@ +import { type MouseEventHandler } from "react"; +import { Text } from "components/text"; +import { Emoji } from "utils/emoji"; +import Popup from "./popup"; +import { emoji } from "utils"; +import { type AnyEmojiName } from "@sdk/emoji_data/types"; + +export const EmojiPill = ({ + emoji: emojiName, + description, + onClick, +}: { + emoji: AnyEmojiName; + description: string; + onClick?: MouseEventHandler; +}) => { + return ( + + {description} + + } + > +
+ +
+
+ ); +}; diff --git a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx index d3f6b3bd9..bfd3de81a 100644 --- a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx +++ b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx @@ -1,13 +1,7 @@ "use client"; import { AptosInputLabel, EmojiInputLabel } from "./InputLabels"; -import { - type PropsWithChildren, - useEffect, - useState, - useMemo, - type MouseEventHandler, -} from "react"; +import { type PropsWithChildren, useEffect, useState, useMemo } from "react"; import FlipInputsArrow from "./FlipInputsArrow"; import { Column, Row } from "components/layout/components/FlexContainers"; import { SwapButton } from "./SwapButton"; @@ -23,8 +17,6 @@ import { useAptos } from "context/wallet-context/AptosContextProvider"; import { AnimatePresence, motion } from "framer-motion"; import { toCoinTypes } from "@sdk/markets/utils"; import { Flex, FlexGap } from "@containers"; -import Popup from "components/popup"; -import { Text } from "components/text"; import { InputNumeric } from "components/inputs"; import { emoji } from "utils"; import { getTooltipStyles } from "components/selects/theme"; @@ -32,34 +24,7 @@ import { useThemeContext } from "context"; import { TradeOptions } from "components/selects/trade-options"; import { getMaxSlippageSettings } from "utils/slippage"; import { Emoji } from "utils/emoji"; -import { type AnyEmojiName } from "@sdk/emoji_data/types"; - -const SmallEmojiButton = ({ - emoji: emojiName, - description, - onClick, -}: { - emoji: AnyEmojiName; - description: string; - onClick?: MouseEventHandler; -}) => { - return ( - - {description} - - } - > -
- -
-
- ); -}; +import { EmojiPill } from "components/EmojiPill"; const SimulateInputsWrapper = ({ children }: PropsWithChildren) => (
{children}
@@ -236,14 +201,14 @@ export default function SwapComponent({ {isSell ? ( <> - { setInputAmount(emojicoinBalance / 2n); }} /> - { @@ -253,21 +218,21 @@ export default function SwapComponent({ ) : ( <> - { setInputAmount(availableAptBalance / 4n); }} /> - { setInputAmount(availableAptBalance / 2n); }} /> - { diff --git a/src/typescript/frontend/src/components/pages/home/components/main-card/MainCard.tsx b/src/typescript/frontend/src/components/pages/home/components/main-card/MainCard.tsx index 7f8adf43a..53b436073 100644 --- a/src/typescript/frontend/src/components/pages/home/components/main-card/MainCard.tsx +++ b/src/typescript/frontend/src/components/pages/home/components/main-card/MainCard.tsx @@ -91,7 +91,7 @@ const MainCard = (props: MainCardProps) => { -
+
HOT  
diff --git a/src/typescript/frontend/src/components/pages/pools/components/liquidity/index.tsx b/src/typescript/frontend/src/components/pages/pools/components/liquidity/index.tsx index 24f7d4650..e44a099dc 100644 --- a/src/typescript/frontend/src/components/pages/pools/components/liquidity/index.tsx +++ b/src/typescript/frontend/src/components/pages/pools/components/liquidity/index.tsx @@ -28,6 +28,7 @@ import { TypeTag } from "@aptos-labs/ts-sdk"; import Info from "components/info"; import { type AnyNumberString } from "@sdk/types/types"; import { type PoolsData } from "../../ClientPoolsPage"; +import { EmojiPill } from "components/EmojiPill"; type LiquidityProps = { market: PoolsData | undefined; @@ -253,29 +254,78 @@ const Liquidity: React.FC = ({ market, geoblocked }) => { return ( - - - - {t(direction === "add" ? "Add liquidity" : "Remove liquidity")} - - - - + + + + + + {t(direction === "add" ? "Add liquidity" : "Remove liquidity")} - - - + + + Liquidity providers receive a 0.25% fee from all trades, proportional to their + pool share. Fees are continuously reinvested in the pool and can be claimed by + withdrawing liquidity. + + + + + + {direction === "add" ? ( + <> + { + setLiquidity(aptBalance / 4n); + }} + /> + { + setLiquidity(aptBalance / 2n); + }} + /> + { + setLiquidity(aptBalance); + }} + /> + + ) : ( + <> + { + setLP(emojicoinLPBalance / 2n); + }} + /> + { + setLP(emojicoinLPBalance); + }} + /> + + )} + {direction === "add" ? (