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

This commit is contained in:
Kasper Fabricius Kristensen
2024-10-14 11:34:15 +02:00
committed by GitHub
parent 11120a8b7e
commit 1b82f7a814
4 changed files with 20 additions and 3 deletions
-1
View File
@@ -30,7 +30,6 @@
:root {
@apply bg-ui-bg-subtle text-ui-fg-base antialiased;
text-rendering: optimizeLegibility;
color-scheme: light dark;
}
}
@@ -1347,6 +1347,20 @@ export const RouteMap: RouteObject[] = [
"../../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.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,
@@ -4,9 +4,11 @@ import { useTaxRegion } from "../../../hooks/api/tax-regions"
import { TaxRegionCreateTaxOverrideForm } from "./components/tax-region-override-create-form"
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