fix(dashboard): Adds routes for handling tax overrides for provinces (#9549)

This commit is contained in:
Kasper Fabricius Kristensen authored and GitHub committed 2024-10-14 11:34:15 +02:00
1 parent 11120a8b7e
commit 1b82f7a814
4 files changed
+20 -3

No files matched your search

-1
View File
@@ -30,7 +30,6 @@
:root { :root {
@apply bg-ui-bg-subtle text-ui-fg-base antialiased; @apply bg-ui-bg-subtle text-ui-fg-base antialiased;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
color-scheme: light dark;
} }
} }
@@ -1347,6 +1347,20 @@ export const RouteMap: RouteObject[] = [
"../../routes/tax-regions/tax-region-tax-rate-edit" "../../routes/tax-regions/tax-region-tax-rate-edit"
), ),
}, },
{
path: "overrides/create",
lazy: () =>
import(
"../../routes/tax-regions/tax-region-tax-override-create"
),
},
{
path: "overrides/:tax_rate_id/edit",
lazy: () =>
import(
"../../routes/tax-regions/tax-region-tax-override-edit"
),
},
], ],
}, },
], ],
@@ -64,6 +64,8 @@ export const ThemeProvider = ({ children }: PropsWithChildren) => {
html.classList.remove(value === "light" ? "dark" : "light") html.classList.remove(value === "light" ? "dark" : "light")
html.classList.add(value) html.classList.add(value)
// Ensures that native elements respect the theme, e.g. the scrollbar.
html.style.colorScheme = value
/** /**
* Re-enable transitions after the theme has been set, * Re-enable transitions after the theme has been set,
@@ -4,9 +4,11 @@ import { useTaxRegion } from "../../../hooks/api/tax-regions"
import { TaxRegionCreateTaxOverrideForm } from "./components/tax-region-override-create-form" import { TaxRegionCreateTaxOverrideForm } from "./components/tax-region-override-create-form"
export const TaxRegionCreateTaxOverride = () => { export const TaxRegionCreateTaxOverride = () => {
const { id } = useParams() const { id, province_id } = useParams()
const { tax_region, isPending, isError, error } = useTaxRegion(id!) const { tax_region, isPending, isError, error } = useTaxRegion(
province_id || id!
)
const ready = !isPending && !!tax_region const ready = !isPending && !!tax_region