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

🌓 Dark mode fixes #599

Merged
merged 13 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
1 change: 1 addition & 0 deletions src/components/Forms/FormikInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const FormikInput: FC<
isInvalid={isError}
errorBorderColor="red.300"
placeholder={placeholder}
_placeholder={{ color: useColorModeValue("gray.400", "gray.500") }}
{...field}
value={meta.value}
/>
Expand Down
8 changes: 6 additions & 2 deletions src/components/OutlineListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { FC } from "react"
import { ListItem, ListItemProps } from "@threshold-network/components"
import {
ListItem,
ListItemProps,
useColorModeValue,
} from "@threshold-network/components"

export const OutlineListItem: FC<ListItemProps> = ({ ...props }) => {
return (
<ListItem
display="flex"
justifyContent="space-between"
alignItems="center"
borderColor="gray.100"
borderColor={useColorModeValue("gray.100", "gray.700")}
borderWidth="1px"
borderStyle="solid"
borderRadius="6px"
Expand Down
9 changes: 7 additions & 2 deletions src/components/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Badge,
ImageProps,
Image,
useColorModeValue,
} from "@threshold-network/components"

type Sizes = "sm" | "md" | "lg"
Expand Down Expand Up @@ -139,7 +140,11 @@ export const Step: FC<StepProps> = ({
w="full"
borderLeftWidth="4px"
borderLeftStyle="solid"
borderColor={isActive || isComplete ? "brand.500" : "gray.300"}
borderColor={
isActive || isComplete
? useColorModeValue("brand.500", "brand.300")
: "gray.300"
}
{...restProps}
>
{children}
Expand All @@ -157,7 +162,7 @@ export const StepIndicator: FC<ComponentProps<typeof LabelSm>> = ({
const Label = stepSizeMap[size].label.component

return (
<Label color="brand.500" {...restProps}>
<Label color={useColorModeValue("brand.500", "brand.300")} {...restProps}>
{children}
</Label>
)
Expand Down
17 changes: 14 additions & 3 deletions src/components/TransactionDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { ComponentProps, FC } from "react"
import { BodySm, ListItem, Skeleton } from "@threshold-network/components"
import {
BodySm,
ListItem,
Skeleton,
useColorModeValue,
} from "@threshold-network/components"
import { InlineTokenBalance } from "../TokenBalance"

type TransactionDetailsItemProps = {
Expand All @@ -15,7 +20,13 @@ export const TransactionDetailsItem: FC<TransactionDetailsItemProps> = ({
return (
<ListItem display="flex" justifyContent="space-between" alignItems="center">
<BodySm color="gray.500">{label}</BodySm>
{value ? <BodySm color="gray.700">{value}</BodySm> : children}
{value ? (
<BodySm color={useColorModeValue("gray.700", "gray.300")}>
{value}
</BodySm>
) : (
children
)}
</ListItem>
)
}
Expand All @@ -32,7 +43,7 @@ export const TransactionDetailsAmountItem: FC<
return (
<TransactionDetailsItem label={label}>
<Skeleton isLoaded={!!tokenAmount}>
<BodySm color="gray.700">
<BodySm color={useColorModeValue("gray.700", "gray.300")}>
<InlineTokenBalance
withSymbol
tokenAmount={tokenAmount || "0"}
Expand Down
3 changes: 2 additions & 1 deletion src/components/tBTC/RecentDeposits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
LinkBox,
LinkOverlay,
Link,
useColorModeValue,
} from "@threshold-network/components"
import shortenAddress from "../../utils/shortenAddress"
import Identicon from "../Identicon"
Expand Down Expand Up @@ -63,7 +64,7 @@ const RecentDepositItem: FC<RecentDeposit> = ({
tokenAmount={amount}
withSymbol
tokenSymbol="tBTC"
color="brand.500"
color={useColorModeValue("brand.500", "brand.300")}
/>
</BodySm>
</LinkOverlay>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/tBTC/Bridge/DepositDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ import {
LabelSm,
List,
ListItem,
Skeleton,
Stack,
StackDivider,
Icon,
Divider,
SkeletonText,
SkeletonCircle,
BodySm,
BodyXs,
Alert,
AlertDescription,
AlertIcon,
useColorModeValue,
} from "@threshold-network/components"
import { IoCheckmarkSharp, IoTime as TimeIcon } from "react-icons/all"
import { InlineTokenBalance } from "../../../components/TokenBalance"
Expand Down Expand Up @@ -208,7 +206,11 @@ export const DepositDetails: PageComponent = () => {
<BridgeProcessCardTitle />
<Flex mb="4" alignItems="center" textStyle="bodyLg">
<BodyLg>
<Box as="span" fontWeight="600" color="brand.500">
<Box
as="span"
fontWeight="600"
color={useColorModeValue("brand.500", "brand.300")}
>
{mintingProgressStep === "completed"
? "Minted"
: "Minting"}
Expand Down
8 changes: 6 additions & 2 deletions src/pages/tBTC/Bridge/Minting/ProvideData.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { FC, Ref, useRef, useState } from "react"
import { FormikErrors, FormikProps, withFormik } from "formik"
import { Button, BodyMd } from "@threshold-network/components"
import {
Button,
BodyMd,
useColorModeValue,
} from "@threshold-network/components"
import { useTbtcState } from "../../../../hooks/useTbtcState"
import { BridgeProcessCardTitle } from "../components/BridgeProcessCardTitle"
import { BridgeProcessCardSubTitle } from "../components/BridgeProcessCardSubTitle"
Expand Down Expand Up @@ -167,7 +171,7 @@ export const ProvideDataComponent: FC<{
stepText="Step 1"
subTitle="Generate a Deposit Address"
/>
<BodyMd color="gray.500" mb={12}>
<BodyMd color={useColorModeValue("gray.500", "gray.300")} mb={12}>
Based on these two addresses, the system will generate for you a unique
BTC deposit address. There is no minting limit.
</BodyMd>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentProps, FC } from "react"
import { BodyLg, Box } from "@threshold-network/components"
import { BodyLg, Box, useColorModeValue } from "@threshold-network/components"

export const BridgeProcessCardSubTitle: FC<
{
Expand All @@ -9,7 +9,11 @@ export const BridgeProcessCardSubTitle: FC<
> = ({ stepText, subTitle, children, ...restProps }) => {
return (
<BodyLg mb={4} {...restProps}>
<Box as="span" fontWeight="bold" color="brand.500">
<Box
as="span"
fontWeight="bold"
color={useColorModeValue("brand.500", "brand.300")}
>
{stepText}
</Box>
{subTitle ? ` - ${subTitle}` : children}
Expand Down
6 changes: 4 additions & 2 deletions src/pages/tBTC/Bridge/components/BridgeProcessEmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, useEffect } from "react"
import { H5 } from "@threshold-network/components"
import { H5, useColorModeValue } from "@threshold-network/components"
import { BridgeProcessCardTitle } from "./BridgeProcessCardTitle"
import SubmitTxButton from "../../../../components/SubmitTxButton"
import {
Expand Down Expand Up @@ -40,8 +40,10 @@ export const BridgeProcessEmptyState: FC<{
width: "100%",
height: "100px",
opacity: "0.9",
background:
background: useColorModeValue(
"linear-gradient(360deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 117.78%)",
"linear-gradient(360deg, #4A5568 0%, rgba(255, 255, 255, 0) 117.78%)"
),
}}
/>
<ProtocolHistoryViewMoreLink mt="7" />
Expand Down
3 changes: 2 additions & 1 deletion src/pages/tBTC/Bridge/components/BridgeProcessStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
CircularProgress,
CircularProgressLabel,
Flex,
useColorModeValue,
} from "@threshold-network/components"
import ViewInBlockExplorer, {
Chain as ViewInBlockExplorerChain,
Expand Down Expand Up @@ -51,7 +52,7 @@ export const BridgeProcessStep: FC<BridgeProcessStepProps> = ({
return (
<Flex flexDirection="column" alignItems="center" height="100%">
<BodyLg
color="gray.700"
color={useColorModeValue("gray.700", "gray.300")}
mt="8"
alignSelf="flex-start"
fontSize="20px"
Expand Down
7 changes: 4 additions & 3 deletions src/pages/tBTC/Explorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
Th,
Thead,
Tr,
useColorModeValue,
} from "@threshold-network/components"
import { PageComponent } from "../../../types"
import tBTCExplorerBg from "../../../static/images/tBTC-explorer-bg.svg"
Expand Down Expand Up @@ -155,7 +156,7 @@ const HistoryRow: FC<RecentDeposit> = ({ txHash, address, amount, date }) => {
<LinkBox
as={Tr}
key={`latest-mints-${txHash}`}
_odd={{ backgroundColor: "gray.50" }}
_odd={{ backgroundColor: useColorModeValue("gray.50", "gray.700") }}
sx={{ td: { borderBottom: "none" } }}
transform="scale(1)"
>
Expand Down Expand Up @@ -216,11 +217,11 @@ const MetricBox: FC = ({ children }) => {
border="1px solid"
borderColor="gray.100"
p="3.25rem"
bg="white"
bg={useColorModeValue("white", "gray.700")}
textAlign="center"
borderRadius="2"
minWidth="294px"
color="grat.700"
color="gray.700"
>
{children}
</Box>
Expand Down
Loading