From 621c6f6fa18b899da461f878e3d204301d0e3719 Mon Sep 17 00:00:00 2001 From: Erik Hanchett Date: Tue, 10 Dec 2024 15:50:16 -0800 Subject: [PATCH] Updated names based on code review --- mdx-components.tsx | 4 ++-- .../{Banner/Banner.tsx => AIBanner/AIBanner.tsx} | 12 +++--------- .../__tests__/AIBanner.test.tsx} | 8 ++++---- src/components/AIBanner/index.tsx | 1 + src/components/Banner/index.tsx | 1 - src/components/Layout/Layout.tsx | 6 +++--- 6 files changed, 13 insertions(+), 19 deletions(-) rename src/components/{Banner/Banner.tsx => AIBanner/AIBanner.tsx} (87%) rename src/components/{Banner/__tests__/Banner.test.tsx => AIBanner/__tests__/AIBanner.test.tsx} (64%) create mode 100644 src/components/AIBanner/index.tsx delete mode 100644 src/components/Banner/index.tsx diff --git a/mdx-components.tsx b/mdx-components.tsx index c5e14e2528e..7ce3e403259 100644 --- a/mdx-components.tsx +++ b/mdx-components.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import type { MDXComponents } from 'mdx/types'; import ExportedImage from 'next-image-export-optimizer'; -import { Banner } from './src/components/Banner'; +import { AIBanner } from './src/components/AIBanner'; import InlineFilter from './src/components/InlineFilter'; import { YoutubeEmbed } from './src/components/YoutubeEmbed'; import { Accordion } from './src/components/Accordion'; @@ -65,7 +65,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents { InlineFilter, MigrationAlert, YoutubeEmbed, - Banner, + AIBanner, Overview, ExternalLink, ExternalLinkButton, diff --git a/src/components/Banner/Banner.tsx b/src/components/AIBanner/AIBanner.tsx similarity index 87% rename from src/components/Banner/Banner.tsx rename to src/components/AIBanner/AIBanner.tsx index c1367cac40a..fd4db18e93a 100644 --- a/src/components/Banner/Banner.tsx +++ b/src/components/AIBanner/AIBanner.tsx @@ -2,13 +2,8 @@ import { Flex, Message, IconsProvider, Text } from '@aws-amplify/ui-react'; import { IconStar, IconChevron } from '../Icons'; import { Button } from '@aws-amplify/ui-react'; -interface BannerProps { - url?: string; -} - -export const Banner: React.FC = ({ - url = '/react/ai/set-up-ai/' -}) => { +export const AIBanner: React.FC = () => { + const URL = '/react/ai/set-up-ai/'; return ( = ({