Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow to retract escalated dispute #611

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
ENV_NAME: "production"
UPDATE_COVERAGE: false
REACT_APP_ENABLE_CURATION_LISTS: true
REACT_APP_SELLER_CURATION_LIST: "2,4,5,6,7,8,9,11,12,13,14,16,27,129,171,172,180,181,182,183,184,190,191"
REACT_APP_SELLER_CURATION_LIST: "2,4,5,6,7,8,9,11,12,13,14,16,27,129,171,172,180,181,182,183,184,190,191,195,196,197,202,207"
REACT_APP_CREATE_PROFILE_CONFIGURATION: "LENS"
REACT_APP_IPFS_GATEWAY: "https://bosonprotocol.infura-ipfs.io/ipfs"
REACT_APP_IPFS_IMAGE_GATEWAY: "https://gray-permanent-fly-490.mypinata.cloud/ipfs"
Expand Down
38 changes: 13 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@bosonprotocol/chat-sdk": "^1.3.0",
"@bosonprotocol/react-kit": "^0.16.2-alpha.16",
"@bosonprotocol/react-kit": "0.16.2-alpha.16",
"@davatar/react": "^1.10.4",
"@ethersproject/address": "^5.6.1",
"@ethersproject/units": "^5.6.1",
Expand Down
Binary file added src/assets/fonts/neuropolitical_rg.ttf
Binary file not shown.
49 changes: 0 additions & 49 deletions src/components/banner/Banner.tsx

This file was deleted.

6 changes: 5 additions & 1 deletion src/components/datepicker/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ export default function Calendar({
</CalendarHeader>
<CalendarRow>
{rows.map(({ text, value, current }: ICalendarCell, i: number) => {
const disabled: boolean = period
const isBeforeMinDate = minDate
? value?.isBefore(minDate, "day")
: false;
const isAfterMaxDate = maxDate
? value?.isAfter(maxDate, "day")
: false;
const disabled: boolean = isBeforeMinDate || isAfterMaxDate;

return (
<CalendarDay
Expand Down
17 changes: 13 additions & 4 deletions src/components/datepicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dayjs.extend(timezone);

import { useCallback, useEffect, useRef, useState } from "react";

import { useDidMountEffect } from "../../lib/utils/hooks/useDidMountEffect";
import { FieldInput } from "../form/Field.styles";
import Calendar from "./Calendar";
import { DatePickerWrapper, Picker, PickerGrid } from "./DatePicker.style";
Expand All @@ -16,7 +17,7 @@ import SelectTime from "./SelectTime";

interface Props {
initialValue?: Dayjs | Array<Dayjs> | null;
onChange?: (selected: Dayjs | Array<Dayjs | null>) => void;
onChange?: (selected: Dayjs | Array<Dayjs | null> | null) => void;
error?: string;
period: boolean;
selectTime: boolean;
Expand All @@ -37,8 +38,10 @@ const handleInitialDates = (
let endDate: Dayjs | null = null;

if (Array.isArray(initialValue)) {
startDate = dayjs(initialValue[0]);
endDate = dayjs(initialValue[1]);
if (initialValue.length) {
startDate = dayjs(initialValue[0]);
endDate = dayjs(initialValue[1]);
}
} else {
startDate = dayjs(initialValue);
}
Expand Down Expand Up @@ -109,7 +112,7 @@ export default function DatePicker({
}
};

useEffect(() => {
useDidMountEffect(() => {
if (
(!period && date !== null) ||
(period && date !== null && secondDate !== null)
Expand All @@ -122,7 +125,13 @@ export default function DatePicker({
(period && date === null && secondDate === null)
) {
setShownDate("Choose dates...");
if (period) {
onChange?.([]);
} else {
onChange?.(null);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [date, secondDate, period]);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/detail/DetailWidget/DetailWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ const DetailWidget: React.FC<IDetailWidget> = ({
"code" in error &&
(error as unknown as { code: string }).code === "ACTION_REJECTED";
if (hasUserRejectedTx) {
showModal("CONFIRMATION_FAILED");
showModal("TRANSACTION_FAILED");
} else {
showModal(modalTypes.DETAIL_WIDGET, {
title: "An error occurred",
Expand Down
4 changes: 3 additions & 1 deletion src/components/detail/DetailWidget/TokenGated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CONFIG } from "../../../lib/config";
import { colors } from "../../../lib/styles/colors";
import { Offer } from "../../../lib/types/offer";
import { IPrice } from "../../../lib/utils/convertPrice";
import { sanitizeUrl } from "../../../lib/utils/url";
import { useCoreSDK } from "../../../lib/utils/useCoreSdk";
import { useConvertedPrice } from "../../price/useConvertedPrice";
import Grid from "../../ui/Grid";
Expand Down Expand Up @@ -176,8 +177,9 @@ const TokenGated = ({
</LockInfoDesc>
<LockInfoDesc>
<a
href={openseaLinkToOriginalMainnetCollection}
href={sanitizeUrl(openseaLinkToOriginalMainnetCollection)}
target="_blank"
rel="noopener noreferrer"
>
{openseaLinkToOriginalMainnetCollection}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import copyToClipboard from "../../../lib/utils/copyToClipboard";
import { getDateTimestamp } from "../../../lib/utils/getDateTimestamp";
import { Disputes } from "../../../lib/utils/hooks/useExchanges";
import { useKeepQueryParamsNavigate } from "../../../lib/utils/hooks/useKeepQueryParamsNavigate";
import { sanitizeUrl } from "../../../lib/utils/url";
import { useModal } from "../../modal/useModal";
import Price from "../../price";
import PaginationPages from "../../seller/common/PaginationPages";
Expand Down Expand Up @@ -175,7 +176,7 @@ export default function DisputesTable({ disputes }: Props) {
whiteSpace: "pre"
}}
onClick={() => {
copyToClipboard(emailAddress).then(() => {
copyToClipboard(sanitizeUrl(emailAddress)).then(() => {
toast(() => "Seller e-mail has been copied to clipboard");
});
}}
Expand Down
8 changes: 5 additions & 3 deletions src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import logo from "../../../src/assets/logo-white.svg";
import { BosonRoutes } from "../../lib/routing/routes";
import { breakpoint } from "../../lib/styles/breakpoint";
import { useBreakpoints } from "../../lib/utils/hooks/useBreakpoints";
import { sanitizeUrl } from "../../lib/utils/url";
import SocialLogo, {
SocialLogoValues
} from "../../pages/custom-store/SocialLogo";
Expand Down Expand Up @@ -112,9 +113,9 @@ function Socials() {
return socialMediaLinks.map(({ url, value }) => {
return (
<a
href={url}
href={sanitizeUrl(url)}
target="_blank"
rel="noopener"
rel="noopener noreferrer"
key={`social_nav_${value}_${url}`}
>
<SocialLogo logo={value} />
Expand Down Expand Up @@ -241,9 +242,10 @@ export default function FooterComponent() {
return (
<a
key={`${footerLink.label}-${footerLink.value}-${index}`}
href={footerLink.value}
href={sanitizeUrl(footerLink.value)}
target="_blank"
style={{ textAlign: "center" }}
rel="noopener noreferrer"
>
{footerLink.label}
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/Datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DatePicker from "../datepicker/DatePicker";
import Error from "./Error";
import type { DatepickerProps } from "./types";

export default function DatepickerComponent({
export default function Datepicker({
name,
period = false,
selectTime = false,
Expand All @@ -17,7 +17,7 @@ export default function DatepickerComponent({
const displayError =
typeof errorMessage === typeof "string" && errorMessage !== "";

const handleChange = (date: Dayjs | Array<Dayjs | null>) => {
const handleChange = (date: Dayjs | Array<Dayjs | null> | null) => {
if (!meta.touched) {
helpers.setTouched(true);
}
Expand Down
Loading