Skip to content

Commit 7aad493

Browse files
Merge pull request aws-amplify#6350 from aws-amplify/featurte-list-urls
feat: added required urls for feature lists
2 parents e40f072 + 55bfe5e commit 7aad493

File tree

2 files changed

+799
-50
lines changed

2 files changed

+799
-50
lines changed

src/components/FeatureLists/PlatformFeatureList.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ import {
77

88
import { Flex } from '@aws-amplify/ui-react';
99
import featureListData from '@/constants/feature-lists-data';
10+
import { DEFAULT_PLATFORM } from '@/data/platforms';
1011
import type { Platform } from '@/data/platforms';
1112
import { PLATFORM_DISPLAY_NAMES } from '@/data/platforms';
13+
import { usePathname } from 'next/navigation';
1214
interface PlatformFeatureListProps {
13-
platform: Platform;
15+
platform: Platform | typeof DEFAULT_PLATFORM;
1416
}
1517
const PlatformFeatureList: React.FC<PlatformFeatureListProps> = ({
1618
platform
1719
}) => {
20+
const pathname = usePathname();
1821
const categories = featureListData[platform].categories;
1922

2023
return categories.length > 0 ? (
@@ -25,8 +28,14 @@ const PlatformFeatureList: React.FC<PlatformFeatureListProps> = ({
2528
{category.items.map((categoryItem, index) => (
2629
<FeatureItem
2730
linkText={categoryItem.linkText}
28-
href={categoryItem.link}
29-
isExternal={true}
31+
href={
32+
platform === DEFAULT_PLATFORM &&
33+
pathname === '/' &&
34+
!categoryItem.isExternal
35+
? `${platform}/${categoryItem.link}`
36+
: categoryItem.link
37+
}
38+
isExternal={categoryItem.isExternal}
3039
key={index}
3140
>
3241
{categoryItem.content}

0 commit comments

Comments
 (0)