File tree 2 files changed +799
-50
lines changed
2 files changed +799
-50
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ import {
7
7
8
8
import { Flex } from '@aws-amplify/ui-react' ;
9
9
import featureListData from '@/constants/feature-lists-data' ;
10
+ import { DEFAULT_PLATFORM } from '@/data/platforms' ;
10
11
import type { Platform } from '@/data/platforms' ;
11
12
import { PLATFORM_DISPLAY_NAMES } from '@/data/platforms' ;
13
+ import { usePathname } from 'next/navigation' ;
12
14
interface PlatformFeatureListProps {
13
- platform : Platform ;
15
+ platform : Platform | typeof DEFAULT_PLATFORM ;
14
16
}
15
17
const PlatformFeatureList : React . FC < PlatformFeatureListProps > = ( {
16
18
platform
17
19
} ) => {
20
+ const pathname = usePathname ( ) ;
18
21
const categories = featureListData [ platform ] . categories ;
19
22
20
23
return categories . length > 0 ? (
@@ -25,8 +28,14 @@ const PlatformFeatureList: React.FC<PlatformFeatureListProps> = ({
25
28
{ category . items . map ( ( categoryItem , index ) => (
26
29
< FeatureItem
27
30
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 }
30
39
key = { index }
31
40
>
32
41
{ categoryItem . content }
You can’t perform that action at this time.
0 commit comments