Skip to content
Merged
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
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
3 changes: 2 additions & 1 deletion src/components/toasts/SuccessTransactionToast.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Toast } from "react-hot-toast";

import { colors } from "../../lib/styles/colors";
import { sanitizeUrl } from "../../lib/utils/url";
import Grid from "../ui/Grid";
import Typography from "../ui/Typography";
import SuccessToast from "./common/SuccessToast";
Expand Down Expand Up @@ -33,7 +34,7 @@ export default function SuccessTransactionToast({
View details
</Typography>
) : url ? (
<a href={url} target="_blank">
<a href={sanitizeUrl(url)} target="_blank" rel="noopener noreferrer">
<Typography color={colors.secondary}>View details</Typography>
</a>
) : null}
Expand Down
10 changes: 8 additions & 2 deletions src/pages/profile/seller/SellerSocial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Profile,
ProfileFieldsFragment
} from "../../../lib/utils/hooks/lens/graphql/generated";
import { sanitizeUrl } from "../../../lib/utils/url";
import { preAppendHttps } from "../../../lib/validation/regex/url";
import {
DetailShareWrapper,
Expand All @@ -26,7 +27,12 @@ function RenderSocial({
icon: Icon
}: RenderSocialProps) {
return (
<SocialIcon href={href} $isDisabled={disabled} target="_blank">
<SocialIcon
href={href}
$isDisabled={disabled}
target="_blank"
rel="noopener noreferrer"
>
{Icon ? Icon : <Globe size={24} />}
</SocialIcon>
);
Expand Down Expand Up @@ -60,7 +66,7 @@ export default function SellerSocial({
{/* TODO: Removed as we don't have discord in lens profile */}
{/* <RenderSocial icon={DiscordLogo} href={""} /> */}
{lensUrl !== false && (
<RenderSocial icon={<Globe size={24} />} href={lensUrl} />
<RenderSocial icon={<Globe size={24} />} href={sanitizeUrl(lensUrl)} />
)}
<DetailShareWrapper>
<DetailShare />
Expand Down