Fix link hrefs (#1761)
* Fix link hrefs * Remove createHref * Remove unused imports
This commit is contained in:
parent
41e80d71c0
commit
2aab5b80ff
3 changed files with 4 additions and 10 deletions
|
@ -2,12 +2,10 @@ import { ThemeType } from "@saleor/macaw-ui";
|
|||
import moment from "moment-timezone";
|
||||
import { MutationFunction, MutationResult } from "react-apollo";
|
||||
import { IntlShape } from "react-intl";
|
||||
import urlJoin from "url-join";
|
||||
|
||||
import { ConfirmButtonTransitionState } from "./components/ConfirmButton";
|
||||
import { StatusType } from "./components/StatusChip/types";
|
||||
import { StatusLabelProps } from "./components/StatusLabel";
|
||||
import { APP_MOUNT_URI } from "./config";
|
||||
import { AddressType, AddressTypeInput } from "./customers/types";
|
||||
import {
|
||||
commonStatusMessages,
|
||||
|
@ -292,10 +290,6 @@ export function getUserInitials(user?: User) {
|
|||
: undefined;
|
||||
}
|
||||
|
||||
export function createHref(url: string) {
|
||||
return urlJoin(APP_MOUNT_URI, url);
|
||||
}
|
||||
|
||||
interface AnyEvent {
|
||||
stopPropagation: () => void;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ import React from "react";
|
|||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
|
||||
import { customerUrl } from "../../../customers/urls";
|
||||
import { createHref, maybe } from "../../../misc";
|
||||
import { maybe } from "../../../misc";
|
||||
import { OrderDetails_order } from "../../types/OrderDetails";
|
||||
import { WarehouseClickAndCollectOptionEnum } from "./../../../types/globalTypes";
|
||||
import messages from "./messages";
|
||||
|
@ -216,7 +216,7 @@ const OrderCustomer: React.FC<OrderCustomerProps> = props => {
|
|||
<div>
|
||||
<Link
|
||||
underline={false}
|
||||
href={createHref(customerUrl(user.id))}
|
||||
href={customerUrl(user.id)}
|
||||
onClick={onProfileView}
|
||||
>
|
||||
<FormattedMessage
|
||||
|
|
|
@ -13,7 +13,7 @@ import SingleAutocompleteSelectField, {
|
|||
import { ProductErrorFragment } from "@saleor/fragments/types/ProductErrorFragment";
|
||||
import { ChangeEvent } from "@saleor/hooks/useForm";
|
||||
import { makeStyles } from "@saleor/macaw-ui";
|
||||
import { createHref, maybe } from "@saleor/misc";
|
||||
import { maybe } from "@saleor/misc";
|
||||
import { productTypeUrl } from "@saleor/productTypes/urls";
|
||||
import { FetchMoreProps } from "@saleor/types";
|
||||
import { getFormErrors, getProductErrorMessage } from "@saleor/utils/errors";
|
||||
|
@ -133,7 +133,7 @@ const ProductOrganization: React.FC<ProductOrganizationProps> = props => {
|
|||
<FormattedMessage defaultMessage="Product Type" />
|
||||
</Typography>
|
||||
<Link
|
||||
href={createHref(productTypeUrl(productType?.id) ?? "")}
|
||||
href={productTypeUrl(productType?.id) ?? ""}
|
||||
disabled={!productType?.id}
|
||||
>
|
||||
{productType?.name ?? "..."}
|
||||
|
|
Loading…
Reference in a new issue