Skip to content

Commit

Permalink
Fix - UX page is broken (#1992)
Browse files Browse the repository at this point in the history
Fixed #1985
Affected Route: `/consulting/ui-ux-design`

Added some guards on CustomLink component and on the prop
  • Loading branch information
amankumarrr authored Jan 3, 2024
1 parent b392c12 commit 821aadc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/blocks/internalCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const renderBody = ({ header, paragraph, website, technologies }) => {
<div className="mt-2 flex justify-between text-left font-semibold text-sswRed prose-p:py-0">
<h4>{header}</h4>
<span className={website ? "" : "hidden"}>
<CustomLink href={website}>Visit Website</CustomLink>
{website && <CustomLink href={website}>Visit Website</CustomLink>}
</span>
</div>
<div className="text-left prose-p:py-2">
Expand Down
3 changes: 2 additions & 1 deletion components/customLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const isExternalLink = (href: string): boolean => {
// i.e. href = https://anydomain.com.au => true | href = https://ssw.com.au/rule/* => true for SSW External Site | href = /company => false for relative path
return (
isExternalSSWSite(href) ||
(href.startsWith("https://") && !href.includes("ssw.com.au")) // checking relative path and external domains i.e. /company
(href?.startsWith("https://") && !href.includes("ssw.com.au")) // checking relative path and external domains i.e. /company
);
};

Expand All @@ -37,6 +37,7 @@ export const CustomLink: React.FC<CustomLinkProps> = ({
const rel =
isExternal && !href.includes("ssw") ? "noopener noreferrer nofollow" : "";

if (!href) return <></>;
return (
<>
{isExternal ? (
Expand Down

0 comments on commit 821aadc

Please sign in to comment.