Skip to content

Commit

Permalink
style: align charts styling for light color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
RabeeAbuBaker committed Jun 24, 2024
1 parent 6a33de3 commit 246d9d7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/components/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const BarChart = ({ data, xAxisDataKey, yAxisDataKey }: BarChartProps) => {
<Box
p="sm"
style={{
backgroundColor: theme.colors.dark[9],
border: `1px solid ${theme.colors.dark[4]}`,
backgroundColor: "var(--mantine-color-body)",
border: "1px solid var(--app-shell-border-color)",
}}
>
<Text className="label">Date: {label}</Text>
Expand Down
5 changes: 5 additions & 0 deletions app/components/Sparkline/Sparkline.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.stop {stop-opacity: 0.01}

@mixin dark-root {
.stop {stop-opacity: 0.1;}
}
7 changes: 4 additions & 3 deletions app/components/Sparkline/Sparkline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Line,
} from "recharts"
import { type AxisDomain } from "recharts/types/util/types"
import classes from "./Sparkline.module.css"
import { ChartData } from "~/types/global"
import { commify, formatNumberToSICompact } from "~/utils/formattingUtils"

Expand Down Expand Up @@ -41,8 +42,8 @@ const Sparkline = ({
<Box
p="sm"
style={{
backgroundColor: theme.colors.dark[9],
border: `1px solid ${theme.colors.dark[4]}`,
backgroundColor: "var(--mantine-color-body)",
border: "1px solid var(--app-shell-border-color)",
}}
>
<Text className="label">Date: {label}</Text>
Expand Down Expand Up @@ -76,7 +77,7 @@ const Sparkline = ({
<defs>
<linearGradient id="colorUv" x1="0" x2="0" y1="0" y2="1">
<stop offset="5%" stopColor="#389F58" stopOpacity={0.1} />
<stop offset="95%" stopColor="#27292F" stopOpacity={0.1} />
<stop className={classes.stop} offset="95%" stopColor="#27292F" />
</linearGradient>
</defs>
<CartesianGrid strokeDasharray="3 3" strokeWidth={0.2} vertical={false} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Stack,
Text,
Title,
useMantineTheme,
} from "@mantine/core"
import { NavLink, useParams } from "@remix-run/react"
import React from "react"
Expand All @@ -19,7 +18,6 @@ type InvoiceHeaderProps = {
charge?: Stripe.Charge
}
const InvoiceHeader = ({ invoice, charge }: InvoiceHeaderProps) => {
const theme = useMantineTheme()
const { accountId } = useParams()

return (
Expand Down Expand Up @@ -47,7 +45,7 @@ const InvoiceHeader = ({ invoice, charge }: InvoiceHeaderProps) => {
<Group
gap={0}
style={{
border: `1px solid ${theme.colors.gray[8]}`,
border: "1px solid var(--app-shell-border-color)",
borderRadius: 4,
}}
>
Expand Down
6 changes: 2 additions & 4 deletions app/routes/account.$accountId.billing._index/view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NumberFormatter, Stack, Text, Title, useMantineTheme } from "@mantine/core"
import { NumberFormatter, Stack, Text, Title } from "@mantine/core"
import React from "react"
import { AccountBillingOutletContext } from "~/routes/account.$accountId.billing/route"
import InvoicesDataTable from "~/routes/account.$accountId.billing._index/components/InvoicesDataTable"
Expand All @@ -16,8 +16,6 @@ export const AccountBillingView = ({
invoices,
upcomingInvoice,
}: AccountBillingViewProps) => {
const theme = useMantineTheme()

return (
<Stack gap={32}>
<Title order={2}>Billing</Title>
Expand All @@ -27,7 +25,7 @@ export const AccountBillingView = ({
gap={4}
p={20}
style={{
border: `1px solid ${theme.colors.gray[8]}`,
border: "1px solid var(--app-shell-border-color)",
borderRadius: 4,
}}
>
Expand Down

0 comments on commit 246d9d7

Please sign in to comment.