From 362d2c54f7f37c95150e674bcd07c3bb4dfd8d16 Mon Sep 17 00:00:00 2001 From: Matt <90358481+xbtmatt@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:46:18 -0700 Subject: [PATCH] [ECO-1920] Fix `div` child of `td` hydration error warning (#138) Co-authored-by: matt --- .../trade-history/table-row/index.tsx | 19 +-- .../home/components/main-card/MainCard.tsx | 92 ++++++----- .../home/components/main-card/module.css | 143 ++++++++++++++++++ .../home/components/main-card/styled.tsx | 123 --------------- 4 files changed, 190 insertions(+), 187 deletions(-) diff --git a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-history/table-row/index.tsx b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-history/table-row/index.tsx index 74a5169a5..e738d9e61 100644 --- a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-history/table-row/index.tsx +++ b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-history/table-row/index.tsx @@ -1,7 +1,6 @@ "use client"; import React, { type PropsWithChildren } from "react"; -import { useTooltip } from "hooks"; import { type TableRowDesktopProps } from "./types"; import { toCoinDecimalString } from "lib/utils/decimals"; import { toNominalPrice } from "@sdk/utils/nominal-price"; @@ -36,16 +35,9 @@ const TableRowStyles = const TableCellStyles = "h-[33px]"; const TableRow = ({ item, showBorder }: TableRowDesktopProps) => { - const { targetRef, tooltip } = useTooltip( -
{item.emoji}
, - { - placement: "top", - } - ); - return ( -
{ className={`min-w-[60px] xl:min-w-[71px] xl:ml-[0.5ch] xl:mr-[-0.5ch] ${TableCellStyles}`} >
- - {item.rankIcon} - - {tooltip} + {item.rankIcon}
-
{toCoinDecimalString(item.apt, 3)}
+ {toCoinDecimalString(item.apt, 3)}
-
{toCoinDecimalString(item.emoji, 3)}
+ {toCoinDecimalString(item.emoji, 3)}
{ alt="Planet" /> - {featured?.symbol ?? "🖤"} +
{featured?.symbol ?? "🖤"}
- - {"01"} - - +
01
+
{(featured ? emojisToName(featured.emojis) : "BLACK HEART").toUpperCase()} - +
{typeof featured !== "undefined" && ( -
- - {t("Mkt. Cap:")}  - - - {toCoinDecimalString(marketCap, 2)} - - -   - - -
+ <> +
+ {t("Mkt. Cap:")} +
+
+
+
{toCoinDecimalString(marketCap, 2)}
+   + +
+
+ )}
{typeof featured !== "undefined" && ( -
- - {t("24 hour vol:")}  - - - {toCoinDecimalString(roughDailyVolume, 2)} - - -   - - -
+ <> +
+
+ {t("24 hour vol:")} +
+
+
+
+
{toCoinDecimalString(roughDailyVolume, 2)}
+   + +
+
+ )}
{typeof featured !== "undefined" && ( -
- - {t("All-time vol:")}  - - - {toCoinDecimalString(roughAllTimeVolume, 2)} - - -   - - -
+ <> +
+ {t("All-time vol:")} +
+
+
+
{toCoinDecimalString(roughAllTimeVolume, 2)}
+   + +
+
+ )}
diff --git a/src/typescript/frontend/src/components/pages/home/components/main-card/module.css b/src/typescript/frontend/src/components/pages/home/components/main-card/module.css index 7cc7e4a55..609c71873 100644 --- a/src/typescript/frontend/src/components/pages/home/components/main-card/module.css +++ b/src/typescript/frontend/src/components/pages/home/components/main-card/module.css @@ -12,4 +12,147 @@ #hero-image { animation: image-pulse 4s infinite ease-in-out; + width: 289px; + + @media screen and (min-width: 578px) { + width: 417px; + } + + @media screen and (min-width: 1096px) { + width: 545px; + } + + @media screen and (min-width: 1355px) { + width: 675px; + } + + @media screen and (min-width: 1614px) { + width: 803px; + } + + @media screen and (min-width: 1873px) { + width: 932px; + } +} + +div#styled-emoji { + position: absolute; + left: 61%; + transform: translateX(-50%); + font-size: 51px; + line-height: unset; + padding-top: 8px; + + @media screen and (min-width: 578px) { + font-size: 74px; + padding-top: 14px; + } + + @media screen and (min-width: 1096px) { + font-size: 97px; + padding-top: 18px; + } + + @media screen and (min-width: 1355px) { + font-size: 120px; + padding-top: 32px; + } + + @media screen and (min-width: 1614px) { + font-size: 143px; + } + + @media screen and (min-width: 1873px) { + font-size: 166px; + } +} + +div.pixel-heading-text { + font-size: 26px; + + @media screen and (min-width: 578px) { + font-size: 37px; + } + + @media screen and (min-width: 1096px) { + font-size: 49px; + } + + @media screen and (min-width: 1355px) { + font-size: 60px; + } + + @media screen and (min-width: 1614px) { + font-size: 72px; + } + + @media screen and (min-width: 1873px) { + font-size: 83px; + } +} + +div.market-data-text { + font-size: 11px; + line-height: unset; + margin-bottom: 7px; + + @media screen and (min-width: 578px) { + font-size: 16px; + margin-bottom: 9px; + } + + @media screen and (min-width: 1096px) { + font-size: 21px; + margin-bottom: 9px; + } + + @media screen and (min-width: 1355px) { + font-size: 26px; + margin-bottom: 14px; + } + + @media screen and (min-width: 1614px) { + font-size: 31px; + margin-bottom: 10px; + } + + @media screen and (min-width: 1873px) { + font-size: 37px; + margin-bottom: 8px; + } +} + +div.display-font-text { + font-size: 38px; + line-height: unset; + margin-top: -12px; + margin-bottom: 7px; + color: white; + + @media screen and (min-width: 578px) { + font-size: 55px; + margin-bottom: 5px; + margin-top: -4px; + } + + @media screen and (min-width: 1096px) { + font-size: 72px; + margin-bottom: 16px; + } + + @media screen and (min-width: 1355px) { + font-size: 89px; + margin-top: 12px; + margin-bottom: 24px; + } + + @media screen and (min-width: 1614px) { + font-size: 106px; + margin-bottom: 10px; + } + + @media screen and (min-width: 1873px) { + font-size: 124px; + margin-bottom: 8px; + } } diff --git a/src/typescript/frontend/src/components/pages/home/components/main-card/styled.tsx b/src/typescript/frontend/src/components/pages/home/components/main-card/styled.tsx index 33bd8d94d..13e5d9e1f 100644 --- a/src/typescript/frontend/src/components/pages/home/components/main-card/styled.tsx +++ b/src/typescript/frontend/src/components/pages/home/components/main-card/styled.tsx @@ -1,129 +1,6 @@ import styled from "styled-components"; -import { Text } from "components/text"; import Image from "components/image"; -export const StyledEmoji = styled.div` - position: absolute; - left: 61%; - transform: translateX(-50%); - font-size: 51px; - line-height: unset; - padding-top: 8px; - - @media screen and (min-width: 578px) { - font-size: 74px; - padding-top: 14px; - } - - @media screen and (min-width: 1096px) { - font-size: 97px; - padding-top: 18px; - } - - @media screen and (min-width: 1355px) { - font-size: 120px; - padding-top: 32px; - } - - @media screen and (min-width: 1614px) { - font-size: 143px; - } - - @media screen and (min-width: 1873px) { - font-size: 166px; - } -`; - -export const StyledPixelHeadingText = styled(Text)` - font-size: 26px; - - @media screen and (min-width: 578px) { - font-size: 37px; - } - - @media screen and (min-width: 1096px) { - font-size: 49px; - } - - @media screen and (min-width: 1355px) { - font-size: 60px; - } - - @media screen and (min-width: 1614px) { - font-size: 72px; - } - - @media screen and (min-width: 1873px) { - font-size: 83px; - } -`; - -export const StyledDisplayFontText = styled(Text)` - font-size: 38px; - line-height: unset; - font-family: ${({ theme }) => theme.fonts.formaM}; - margin-top: -12px; - margin-bottom: 7px; - - @media screen and (min-width: 578px) { - font-size: 55px; - margin-bottom: 5px; - margin-top: -4px; - } - - @media screen and (min-width: 1096px) { - font-size: 72px; - margin-bottom: 16px; - } - - @media screen and (min-width: 1355px) { - font-size: 89px; - margin-top: 12px; - margin-bottom: 24px; - } - - @media screen and (min-width: 1614px) { - font-size: 106px; - margin-bottom: 10px; - } - - @media screen and (min-width: 1873px) { - font-size: 124px; - margin-bottom: 8px; - } -`; - -export const SubheaderText = styled(Text)` - font-size: 11px; - line-height: unset; - margin-bottom: 7px; - - @media screen and (min-width: 578px) { - font-size: 16px; - margin-bottom: 9px; - } - - @media screen and (min-width: 1096px) { - font-size: 21px; - margin-bottom: 9px; - } - - @media screen and (min-width: 1355px) { - font-size: 26px; - margin-bottom: 14px; - } - - @media screen and (min-width: 1614px) { - font-size: 31px; - margin-bottom: 10px; - } - - @media screen and (min-width: 1873px) { - font-size: 37px; - margin-bottom: 8px; - } -`; - export const StyledImage = styled(Image)` width: 289px;