Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BK-95] : Reflect issues for mainnet testing #246

Merged
merged 32 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e5f403a
fix : Confirm Deposit - ETH link for Titan
SonYoungsung Oct 11, 2024
d8a8348
Merge pull request #238 from tokamak-network/fix/ct-merge-issue
SonYoungsung Oct 11, 2024
01f87f2
Merge remote-tracking branch 'origin/dev' into feat/ct-mobile
tyrannojung Oct 15, 2024
be7f651
fix: apply commafy function to show token price in dollars in selectT…
tyrannojung Oct 15, 2024
e03f675
fix: apply commafy function to show token price in dollars in AmountI…
tyrannojung Oct 15, 2024
dec3395
fix: prevent line break in service fee warning message
tyrannojung Oct 15, 2024
63a3a60
fix: add consistent spacing at the top of Edit Request modal
tyrannojung Oct 15, 2024
1737d6f
fix: update modal padding size for mobile view
tyrannojung Oct 15, 2024
79f4b4c
fix: adjust input value truncation length for mobile view
tyrannojung Oct 15, 2024
83a353a
fix: return null for TxToast component in mobile view
tyrannojung Oct 15, 2024
fffaf3e
fix: prevent line break for 'Cross Trade Bridge' text
tyrannojung Oct 15, 2024
27b2a26
fix: enable button when Standard option is selected in CTOptionModal
tyrannojung Oct 15, 2024
e143ae0
fix: apply formatNumber function to receive amount in mobile view
tyrannojung Oct 15, 2024
bd31fb3
fix: set ScrollToTop button z-index lower than modal to ensure it is …
tyrannojung Oct 15, 2024
2d5820a
feat: display 'No active requests' message when no data is available …
tyrannojung Oct 15, 2024
4d677d6
feat: update GNB naming and adjust case sensitivity
tyrannojung Oct 15, 2024
61d264b
feat: apply lazy loading to Header component with suspense and custom…
tyrannojung Oct 16, 2024
42b9c7c
fix: implement DynamicHeader for improved mobile rendering
tyrannojung Oct 16, 2024
f19e5b9
fix: hide hamburgerMenu when accountDrawer is open
tyrannojung Oct 16, 2024
4aa978d
fix : useCrossTrade - mainnet env
SonYoungsung Oct 16, 2024
2538c58
fix : ts-error
SonYoungsung Oct 16, 2024
dbcfa14
Merge pull request #243 from tokamak-network/fix/ct-merge-issue
SonYoungsung Oct 16, 2024
ee5f66c
fix: correct liquidity routing and improve network handling logic
tyrannojung Oct 16, 2024
2e4f80c
fix: block main page scrolling during account history drawer scroll
tyrannojung Oct 16, 2024
fb8312d
Merge remote-tracking branch 'origin/dev' into feat/ct-mobile
tyrannojung Oct 16, 2024
cfb9903
chore: standard withdraw gasFee
SonYoungsung Oct 16, 2024
d75ba20
feat : Cross Trade - set estimateGas and gasLimit for provideCT
SonYoungsung Oct 16, 2024
7eaba34
fix: adjust slice position for string in editRequest
tyrannojung Oct 16, 2024
e443576
feat : Cross Trade - set estimateGas and gasLimit for edit & cancel
SonYoungsung Oct 16, 2024
d5a144d
Merge pull request #244 from tokamak-network/feat/ct-mobile
SonYoungsung Oct 17, 2024
6352ab9
Merge branch 'dev' into fix/ct-merge-issue
SonYoungsung Oct 17, 2024
0d24f71
Merge pull request #245 from tokamak-network/fix/ct-merge-issue
SonYoungsung Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/app/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import TxToast from "@/components/modal/TxToast";
import { QueryClientProvider } from "@tanstack/react-query";
import { getQueryClient } from "@/client/queryClient";
import Script from "next/script";
import Header from "@/components/header/Index";
import { Flex } from "@chakra-ui/react";
import Modals from "./Modals";
import Drawers from "./Drawers";
import Footer from "@/components/footer";
import useMediaView from "@/hooks/mediaView/useMediaView";
import dynamic from "next/dynamic";

const DynamicHeader = dynamic(() => import("@/components/header/Index"), {
loading: () => <></>,
ssr: false,
});

/**
* test domain building commit
Expand All @@ -32,7 +36,7 @@ const GoogleAnalyticsScript = () => {
<>
<Script
async
src="https://www.googletagmanager.com/gtag/js?id=G-WBYF8R92QK"
src='https://www.googletagmanager.com/gtag/js?id=G-WBYF8R92QK'
></Script>
<Script>
{`window.dataLayer = window.dataLayer || [];
Expand All @@ -46,15 +50,14 @@ const GoogleAnalyticsScript = () => {

export default function Entry({ children }: { children: React.ReactNode }) {
const queryClient = getQueryClient();
const { mobileView } = useMediaView();

return (
<>
<GoogleAnalyticsScript />
<QueryClientProvider client={queryClient}>
<ChakraProvidersForNextJs>
<Flex flexDir={"column"} h={"100vh"}>
<Header />
<DynamicHeader />
<Flex flexDir={"column"} flexGrow={1}>
<Flex
justifyContent={"center"}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pools/add/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Button, Flex, Spinner, Text } from "@chakra-ui/react";
import { useCallback, useMemo } from "react";
import { useRecoilState } from "recoil";
import { Hash } from "viem";
import { useContractWrite, useWaitForTransaction } from "wagmi";
import { useContractWrite } from "wagmi";
import useConnectedNetwork from "@/hooks/network";
import { USDT_ADDRESS_BY_CHAINID } from "@/constant/contracts/tokens";
import USDT_ABI from "@/constant/abis/USDT.json";
Expand Down
28 changes: 14 additions & 14 deletions src/components/header/HamburgerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CustomMenuItem = (props: {
return (
<Flex
align={"center"}
target="_blank"
target='_blank'
as={"a"}
href={link}
h={"40px"}
Expand All @@ -40,11 +40,11 @@ const CustomMenuItem = (props: {
_hover={{ bg: "#313442" }}
borderRadius={"8px"}
>
<Flex mr="9px">
<Flex mr='9px'>
<Image
width={title === "User Guide" || title === "Get Help" ? 24 : 18}
src={icon}
alt="icon"
alt='icon'
/>
</Flex>
<Text
Expand Down Expand Up @@ -88,7 +88,7 @@ const HamburgerMenu = () => {
return (
<Drawer
isOpen={isHamburgerOpen}
placement="right"
placement='right'
onClose={() => {
setHamburgerOpen(false);
}}
Expand Down Expand Up @@ -118,28 +118,28 @@ const HamburgerMenu = () => {
flexDir={"column"}
padding={"32px 21px"}
>
<Image src={LOGO} alt="Logo" />
<Image src={LOGO} alt='Logo' />
<Box padding={"8px"} marginTop={"32px"}>
<RouterMenu title="BRIDGE & SWAP" link="/" />
<RouterMenu title="POOLS" link="/pools" />
<RouterMenu title='Bridge & Swap' link='/' />
<RouterMenu title='Liquidity' link='/pools' />
<CustomMenuItem
link="https://tokamaknetwork.gitbook.io/home/02-service-guide/tokamak-bridge"
title="User Guide"
link='https://tokamaknetwork.gitbook.io/home/02-service-guide/tokamak-bridge'
title='User Guide'
icon={userguide}
hoverIcon={userGuideHover}
/>
<CustomMenuItem
link="https://forms.gle/GLY1PZq4BH4RqZY79"
title="Get Help"
link='https://forms.gle/GLY1PZq4BH4RqZY79'
title='Get Help'
icon={lightbulb}
hoverIcon={lightbulbHover}
/>
<Flex w="100%" alignItems={"center"} mt={"8px"} mb={"8px"}>
<Flex w="52px" h="1px" bg={"#757893"} mr="10px"></Flex>
<Flex w='100%' alignItems={"center"} mt={"8px"} mb={"8px"}>
<Flex w='52px' h='1px' bg={"#757893"} mr='10px'></Flex>
<Text color={"#757893"} fontSize={"12px"}>
COMMUNITY
</Text>
<Flex w="52px" h="1px" bg={"#757893"} ml="10px"></Flex>
<Flex w='52px' h='1px' bg={"#757893"} ml='10px'></Flex>
</Flex>
{menuLinks.map((link: any) => {
return (
Expand Down
35 changes: 19 additions & 16 deletions src/components/header/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import { useInOutTokens } from "@/hooks/token/useInOutTokens";
import { useAccount } from "wagmi";
import WARNING_ICON from "assets/icons/pool/unsupportedNetworkWarning.svg";
import { useGetMode } from "@/hooks/mode/useGetMode";
import { accountDrawerStatus } from "@/recoil/modal/atom";
import { useRecoilValue } from "recoil";

const menuList = [
{
Expand Down Expand Up @@ -96,19 +98,19 @@ const CustomMenuItem = (props: {
<MenuItem
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
target="_blank"
target='_blank'
as={"a"}
href={link}
h={"18px"}
marginBottom={"16px"}
padding={"0px"}
// border={'1px solid red'}
bg="#0F0F12"
bg='#0F0F12'
_focus={{ background: "0F0F12" }}
_hover={{ bg: "none", color: "#2a72e5" }}
>
<Flex mr="9px">
<Image src={hover ? hoverIcon : icon} alt="icon" />
<Flex mr='9px'>
<Image src={hover ? hoverIcon : icon} alt='icon' />
</Flex>
<Text
fontSize={
Expand All @@ -129,7 +131,7 @@ export const menuLinks = [
hoverIcon: mediumHover,
},
{
title: "Twitter",
title: "X",
link: "https://twitter.com/tokamak_network",
icon: twitter,
hoverIcon: twitterHover,
Expand Down Expand Up @@ -172,6 +174,7 @@ export default function Header() {
const { isSupportedChain } = useConnectedNetwork();
const router = useRouter();
const { mode } = useGetMode();
const isAccountDrawerOpen = useRecoilValue(accountDrawerStatus);

const handleMenuButtonhover = (
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
Expand Down Expand Up @@ -252,13 +255,13 @@ export default function Header() {
// width={"24px"}
transform={menuState === true ? "rotate(180deg)" : ""}
>
<Image src={arrow} alt="icon_arrow" />
<Image src={arrow} alt='icon_arrow' />
</Flex>
</Flex>
</MenuButton>
<MenuList
onMouseLeave={() => setMenuState(false)}
bg="#0F0F12"
bg='#0F0F12'
mt={"17px"}
border={"1px solid #313442"}
style={{
Expand All @@ -270,23 +273,23 @@ export default function Header() {
}}
>
<CustomMenuItem
link="https://docs.tokamak.network/home/02-service-guide/tokamak-bridge"
title="User Guide"
link='https://docs.tokamak.network/home/02-service-guide/tokamak-bridge'
title='User Guide'
icon={userguide}
hoverIcon={userGuideHover}
/>
<CustomMenuItem
link="https://forms.gle/GLY1PZq4BH4RqZY79"
title="Get Help"
link='https://forms.gle/GLY1PZq4BH4RqZY79'
title='Get Help'
icon={lightbulb}
hoverIcon={lightbulbHover}
/>
<Flex w="100%" alignItems={"center"} mb={"16px"}>
<Flex w="24px" h="1px" bg={"#757893"} mr="10px"></Flex>
<Flex w='100%' alignItems={"center"} mb={"16px"}>
<Flex w='24px' h='1px' bg={"#757893"} mr='10px'></Flex>
<Text color={"#757893"} fontSize={"12px"}>
COMMUNITY
</Text>
<Flex w="24px" h="1px" bg={"#757893"} ml="10px"></Flex>
<Flex w='24px' h='1px' bg={"#757893"} ml='10px'></Flex>
</Flex>
{menuLinks.map((link: any) => {
return (
Expand Down Expand Up @@ -327,7 +330,7 @@ export default function Header() {
<Account />
{/* <AccountModal /> */}
</Flex>
{!menuView && (
{!menuView && !isAccountDrawerOpen && (
<Flex
w={!mobileView ? "48px" : "32px"}
h={!mobileView ? "48px" : "32px"}
Expand All @@ -342,7 +345,7 @@ export default function Header() {
}}
>
<Image
alt="hamburger"
alt='hamburger'
src={!mobileView ? big_hamburger : hamburger}
/>
</Flex>
Expand Down
5 changes: 4 additions & 1 deletion src/components/history/AccountHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
import { Action, CT_ACTION, HISTORY_SORT } from "@/staging/types/transaction";
import { useHistoryTab } from "@/staging/hooks/useHistoryTab";
import { BetaIcon } from "@/staging/components/cross-trade/components/common/BetaIcon";
import { ctConfirmModalStatus } from "@/recoil/modal/atom";
import { useRecoilValue } from "recoil";

export default function AccountHistory() {
const [isOpen, setIsOpen] = useRecoilState(accountDrawerStatus);
Expand All @@ -35,6 +37,7 @@ export default function AccountHistory() {
const { isOnOfficialStandard, isOnCrossTrade } = useHistoryTab();
const [_selectedTransactionCategory, setSelectedTransactionCategory] =
useRecoilState(selectedTransactionCategory);
const checkConfirmModal = useRecoilValue(ctConfirmModalStatus).isOpen;

useEffect(() => {
if (address === undefined) {
Expand Down Expand Up @@ -131,7 +134,7 @@ export default function AccountHistory() {
variant='clickThrough'
trapFocus={false}
useInert={true}
blockScrollOnMount={false}
blockScrollOnMount={!checkConfirmModal ? true : false}
>
<DrawerOverlay
bg={{ base: "#000000F0", lg: "none" }}
Expand Down
44 changes: 23 additions & 21 deletions src/components/mobile/input/MobileTokenBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { tokenModalStatus } from "@/recoil/bridgeSwap/atom";
import { MAINNET_CONTRACTS } from "@/constant/contracts";
import useIsTon from "@/hooks/token/useIsTon";
import { useAccount } from "wagmi";
import formatNumber from "@/staging/utils/formatNumbers";
import commafy from "@/utils/trim/commafy";

export default function MobileTokenBox(props: {
inToken: boolean;
Expand Down Expand Up @@ -179,46 +181,46 @@ export default function MobileTokenBox(props: {
return (
<Flex
visibility={visibilityTypeState ? "visible" : "hidden"}
direction="column"
direction='column'
ml={inToken ? "" : "5"}
mr={inToken ? "5" : ""}
mt="2"
w="148px"
h="84px"
mt='2'
w='148px'
h='84px'
cursor={inToken ? "pointer" : "default"} // 조건에 따른 cursor 스타일 설정
onClick={inToken ? handleClick : undefined} // 조건에 따라 onClick 핸들러 설정
>
{visibilityTypeState && valueProp ? (
<>
<Box bg="#1F2128" p="2" rounded="md" w="full" mb="1">
<Text fontSize="md" fontWeight="bold" color="white">
<Box bg='#1F2128' p='2' rounded='md' w='full' mb='1'>
<Text fontSize='md' fontWeight='bold' color='white'>
{valueProp}
</Text>
</Box>
<Text fontSize="sm" color="gray.400">
${marketPrice}
<Text fontSize='sm' color='gray.400'>
${commafy(marketPrice)}
</Text>
</>
) : (
<>
<Box
p="5"
rounded="md"
w="full"
bgSize="200% 100%"
mb="1"
bgGradient="linear(to-r, #2b2f42 8%, #2b2f42 38%, #1c1d25 54%)"
p='5'
rounded='md'
w='full'
bgSize='200% 100%'
mb='1'
bgGradient='linear(to-r, #2b2f42 8%, #2b2f42 38%, #1c1d25 54%)'
borderRadius={"8px"}
animation={`${useIsMoibleLoading} 10s linear infinite`}
/>
<Box
bg="#1F2128"
p="2"
rounded="md"
w="full"
bgSize="200% 100%"
mb="1"
bgGradient="linear(to-r, #2b2f42 8%, #2b2f42 38%, #1c1d25 54%)"
bg='#1F2128'
p='2'
rounded='md'
w='full'
bgSize='200% 100%'
mb='1'
bgGradient='linear(to-r, #2b2f42 8%, #2b2f42 38%, #1c1d25 54%)'
borderRadius={"8px"}
animation={`${useIsMoibleLoading} 10s linear infinite`}
/>
Expand Down
23 changes: 11 additions & 12 deletions src/components/mobile/input/MobileTokenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Warning from "@/app/BridgeSwap/Warning";

import useAmountModal from "@/hooks/modal/useAmountModal";
import { mobileTokenModalStatus } from "@/recoil/mobile/atom";
import commafy from "@/utils/trim/commafy";

export default function MobileTokenInput(props: {
inToken: boolean;
Expand Down Expand Up @@ -449,9 +450,9 @@ export default function MobileTokenInput(props: {
) : (
<Flex
flexDir={"column"}
border="1px solid"
borderColor="#59628d"
borderRadius="8px"
border='1px solid'
borderColor='#59628d'
borderRadius='8px'
>
{/* {mobileView && <Warning />} */}
<Flex
Expand All @@ -474,11 +475,11 @@ export default function MobileTokenInput(props: {
{/* <Warning /> */}
<Input
autoFocus
autoComplete="off"
type="number"
pattern="[0-9]*"
autoComplete='off'
type='number'
pattern='[0-9]*'
flexGrow={1}
inputMode="decimal"
inputMode='decimal'
id={inToken ? "LeftInput" : "RightInput"}
w={"100%"}
h={"24px"}
Expand Down Expand Up @@ -521,11 +522,9 @@ export default function MobileTokenInput(props: {
<GradientSpinner />
</Flex>
) : (
<Text
ml={"5px"}
fontSize={14}
color={"#A0A3AD"}
>{`$${marketPrice}`}</Text>
<Text ml={"5px"} fontSize={14} color={"#A0A3AD"}>{`$${commafy(
marketPrice
)}`}</Text>
))}
{hasMaxButton && !isMax && (
<Button
Expand Down
Loading
Loading