-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new badge and message for AI kit #8110
Conversation
src/components/Banner/Banner.tsx
Outdated
} | ||
|
||
export const Banner: React.FC<BannerProps> = ({ | ||
url = '/react/ai/set-up-ai/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably don't need this prop since the rest of the banner content is hardcoded, right? Might as well just put it directly on the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I'll make it a constant variable URL
src/components/Banner/Banner.tsx
Outdated
href={url} | ||
size="small" | ||
gap="small" | ||
target="_blank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why open a new window on the same site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/components/Layout/Layout.tsx
Outdated
@@ -71,6 +72,7 @@ export const Layout = ({ | |||
const basePath = 'docs.amplify.aws'; | |||
const metaUrl = url ? url : basePath + asPathWithNoHash; | |||
const pathname = router.pathname; | |||
const shouldShowGen2Banner = asPathWithNoHash === '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really related to gen2, this is an ai banner.
const shouldShowGen2Banner = asPathWithNoHash === '/'; | |
const shouldShowAIBanner = asPathWithNoHash === '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
src/components/Banner/Banner.tsx
Outdated
url?: string; | ||
} | ||
|
||
export const Banner: React.FC<BannerProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be called AIBanner since the content is hardcoded.
Description of changes:
This creates a new badge and message about AI kit. This will only appear on the homepage.
And a new New badge:
Dark mode
Related GitHub issue #, if available:
Instructions
If this PR should not be merged upon approval for any reason, please submit as a DRAFT
Which platform(s) are affected by this PR (if applicable)?
Please add the product(s)/platform(s) affected to the PR title
Checks
Does this PR conform to the styleguide?
Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.
Are any files being deleted with this PR? If so, have the needed redirects been created?
Are all links in MDX files using the MDX link syntax rather than HTML link syntax?
ref: MDX:
[link](https://docs.amplify.aws/)
HTML:
<a href="https://docs.amplify.aws/">link</a>
When this PR is ready to merge, please check the box below
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.