diff --git a/packages/web/src/components/common/button/Button.spec.tsx b/packages/web/src/components/common/button/Button.spec.tsx index d77e818c6..c561990e7 100644 --- a/packages/web/src/components/common/button/Button.spec.tsx +++ b/packages/web/src/components/common/button/Button.spec.tsx @@ -36,7 +36,7 @@ describe("Button Component", () => { height: 50, justify: "space-between", padding: "0px 10px", - textColor: "", + textColor: "text01", }} /> diff --git a/packages/web/src/components/common/button/Button.styles.ts b/packages/web/src/components/common/button/Button.styles.ts index b755b9bcd..2d276982c 100644 --- a/packages/web/src/components/common/button/Button.styles.ts +++ b/packages/web/src/components/common/button/Button.styles.ts @@ -40,6 +40,7 @@ export const ButtonWrapper = styled.button` transition: background-color 0.3s ease; background-color: ${({ hierarchy, bgColor, theme }) => { if (hierarchy === ButtonHierarchy.Primary) return theme.color.background04; + if (hierarchy === ButtonHierarchy.Gray) return theme.color.background17; if (hierarchy === ButtonHierarchy.Dark) return theme.color.background05; return theme.color[bgColor ?? "background04"]; }}; @@ -80,6 +81,7 @@ export const StyledText = styled.span` ${({ fontType }) => fonts[fontType ?? "body9"]}; color: ${({ theme, textColor, hierarchy }) => { if (hierarchy === ButtonHierarchy.Primary) return theme.color.text09; + if (hierarchy === ButtonHierarchy.Gray) return theme.color.text20; return theme.color[textColor ?? "text03"]; }}; `; diff --git a/packages/web/src/components/common/button/Button.tsx b/packages/web/src/components/common/button/Button.tsx index b28570600..285b7391b 100644 --- a/packages/web/src/components/common/button/Button.tsx +++ b/packages/web/src/components/common/button/Button.tsx @@ -12,6 +12,7 @@ interface ButtonProps { export enum ButtonHierarchy { Primary = "Primary", + Gray = "Gray", Dark = "Dark", } diff --git a/packages/web/src/components/common/icons/IconLink.tsx b/packages/web/src/components/common/icons/IconLink.tsx new file mode 100644 index 000000000..61036c8a6 --- /dev/null +++ b/packages/web/src/components/common/icons/IconLink.tsx @@ -0,0 +1,19 @@ +const IconLink = ({ className }: { className?: string }) => ( + + + +); + +export default IconLink; diff --git a/packages/web/src/components/common/icons/IconNote.tsx b/packages/web/src/components/common/icons/IconNote.tsx index 327505a11..af947fa1d 100644 --- a/packages/web/src/components/common/icons/IconNote.tsx +++ b/packages/web/src/components/common/icons/IconNote.tsx @@ -1,17 +1,17 @@ -const Icon = ({ className }: { className?: string }) => ( +const IconNote = ({ className }: { className?: string }) => ( ); -export default Icon; +export default IconNote; diff --git a/packages/web/src/components/common/icons/IconRouter.tsx b/packages/web/src/components/common/icons/IconRouter.tsx new file mode 100644 index 000000000..cddc63ca2 --- /dev/null +++ b/packages/web/src/components/common/icons/IconRouter.tsx @@ -0,0 +1,17 @@ +const IconRouter = ({ className }: { className?: string }) => ( + + + +); + +export default IconRouter; diff --git a/packages/web/src/components/common/icons/IconStrokeArrowDown.tsx b/packages/web/src/components/common/icons/IconStrokeArrowDown.tsx index 14137dbb1..c794aebeb 100644 --- a/packages/web/src/components/common/icons/IconStrokeArrowDown.tsx +++ b/packages/web/src/components/common/icons/IconStrokeArrowDown.tsx @@ -1,4 +1,10 @@ -const IconStrokeArrowDown = ({ className }: { className?: string }) => ( +const IconStrokeArrowDown = ({ + className, + onClick, +}: { + className?: string; + onClick?: () => void; +}) => ( ( fill="none" xmlns="http://www.w3.org/2000/svg" className={className} + onClick={onClick} > ( +const IconStrokeArrowUp = ({ + className, + onClick, +}: { + className?: string; + onClick?: () => void; +}) => ( ( fill="none" xmlns="http://www.w3.org/2000/svg" className={className} + onClick={onClick} > ( + + + +); + +export default IconVector; diff --git a/packages/web/src/components/common/tooltip/Tooltip.styles.ts b/packages/web/src/components/common/tooltip/Tooltip.styles.ts index 2a058b28f..b63ef1f1a 100644 --- a/packages/web/src/components/common/tooltip/Tooltip.styles.ts +++ b/packages/web/src/components/common/tooltip/Tooltip.styles.ts @@ -7,5 +7,5 @@ export const Content = styled.div` border-radius: 8px; box-sizing: border-box; width: max-content; - max-width: calc(100vw - 10px); + // max-width: calc(100vw - 10px); `; diff --git a/packages/web/src/components/common/tooltip/Tooltip.tsx b/packages/web/src/components/common/tooltip/Tooltip.tsx index 1ac8a732a..ee8180455 100644 --- a/packages/web/src/components/common/tooltip/Tooltip.tsx +++ b/packages/web/src/components/common/tooltip/Tooltip.tsx @@ -91,6 +91,7 @@ const Tooltip: React.FC> = ({ data-state={open ? "open" : "closed"} style={{ display: "flex", + width: "100%", }} > {children} diff --git a/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.spec.tsx b/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.spec.tsx new file mode 100644 index 000000000..689360aff --- /dev/null +++ b/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.spec.tsx @@ -0,0 +1,23 @@ +import { render } from "@testing-library/react"; +import { Provider as JotaiProvider } from "jotai"; +import GnoswapThemeProvider from "@providers/gnoswap-theme-provider/GnoswapThemeProvider"; +import SwapButtonTooltip from "./SwapButtonTooltip"; +import { dummySwapGasInfo } from "@containers/swap-container/SwapContainer"; +import Button from "@components/common/button/Button"; + +describe("SwapButtonTooltip Component", () => { + it("SwapButtonTooltip render", () => { + const mockProps = { + swapGasInfo: dummySwapGasInfo, + children: , + }; + + render( + + + + + , + ); + }); +}); diff --git a/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.stories.tsx b/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.stories.tsx new file mode 100644 index 000000000..60dfa7c57 --- /dev/null +++ b/packages/web/src/components/swap/swap-button-tooltip/SwapButtonTooltip.stories.tsx @@ -0,0 +1,44 @@ +import React from "react"; +import { ComponentStory, ComponentMeta } from "@storybook/react"; +import SwapButtonTooltip from "./SwapButtonTooltip"; +import { css, Theme } from "@emotion/react"; +import { dummySwapGasInfo } from "@containers/swap-container/SwapContainer"; +import Button, { ButtonHierarchy } from "@components/common/button/Button"; + +export default { + title: "swap/SwapButtonTooltip", + component: SwapButtonTooltip, +} as ComponentMeta; + +const Template: ComponentStory = args => ( +
+
+ +
+
+); + +export const Default = Template.bind({}); +Default.args = { + swapGasInfo: dummySwapGasInfo, + children: ( +