saleor-dashboard/src/taxes/index.tsx

36 lines
1,002 B
TypeScript
Raw Normal View History

2019-08-09 10:26:22 +00:00
import React from "react";
import { useIntl } from "react-intl";
2019-06-19 14:40:52 +00:00
import { Route, RouteComponentProps, Switch } from "react-router-dom";
import { sectionNames } from "@saleor/intl";
2019-06-19 14:40:52 +00:00
import { WindowTitle } from "../components/WindowTitle";
import { countryListPath, countryTaxRatesPath } from "./urls";
import CountryList from "./views/CountryList";
import CountryTaxesComponent, {
CountryTaxesParams
} from "./views/CountryTaxes";
const CountryTaxes: React.StatelessComponent<
RouteComponentProps<CountryTaxesParams>
> = ({ match }) => <CountryTaxesComponent code={match.params.code} />;
const Component = () => {
const intl = useIntl();
return (
<>
<WindowTitle title={intl.formatMessage(sectionNames.taxes)} />
<Switch>
<Route exact path={countryListPath} component={CountryList} />
<Route
exact
path={countryTaxRatesPath(":code")}
component={CountryTaxes}
/>
</Switch>
</>
);
};
2019-06-19 14:40:52 +00:00
export default Component;