Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/scripts/run_accessibility_scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ module.exports = {

try {
console.log(`\nTesting light mode: http://localhost:3000${page}/`)
const results = await new AxePuppeteer(pageToVisit).analyze();
// Exclude AIConversation component demos from accessibility scan.
// These are rendered by @aws-amplify/ui-react-ai which has known
// accessibility issues (missing aria-labels on buttons, missing alt
// on avatar images). Tracked upstream in the Amplify UI repository.
// TODO: Remove this exclusion once upstream fixes are released.
const results = await new AxePuppeteer(pageToVisit)
.exclude('.amplify-ai-conversation')
.analyze();
if(results.violations.length > 0) {
results.violations.forEach(violation => {
logViolation(violation);
Expand All @@ -44,7 +51,7 @@ module.exports = {
} else {
console.log('No violations found. \n');
}

} catch (error) {
core.setFailed(`There was an error testing the page: ${error}`);
}
Expand All @@ -55,7 +62,9 @@ module.exports = {

try {
console.log(`\nTesting dark mode: http://localhost:3000${page}/`)
const results = await new AxePuppeteer(pageToVisit).analyze();
const results = await new AxePuppeteer(pageToVisit)
.exclude('.amplify-ai-conversation')
.analyze();
if(results.violations.length > 0) {
results.violations.forEach(violation => {
logViolation(violation);
Expand All @@ -64,7 +73,7 @@ module.exports = {
} else {
console.log('No violations found. \n');
}

} catch (error) {
core.setFailed(`There was an error testing the page: ${error}`);
}
Expand Down
14 changes: 6 additions & 8 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ export const Layout = ({
// Determine section from directory tree (page's actual section tag),
// fall back to sessionStorage only for ambiguous pages (tagged 'both').
const [activeSection, setActiveSection] = useState<SectionKey | undefined>(
() => getSectionFromPath(asPathWithNoHash)
() => {
if (isHome || asPathWithNoHash === '/') return 'quickstart';
return getSectionFromPath(asPathWithNoHash);
}
);

const handleSectionChange = (section: SectionKey) => {
Expand Down Expand Up @@ -212,7 +215,6 @@ export const Layout = ({
}
}, 20);


useEffect(() => {
const headings: HeadingInterface[] = [];

Expand Down Expand Up @@ -353,12 +355,8 @@ export const Layout = ({
platform={currentPlatform}
/>
) : null}
{isGen1 && (
<Gen1Banner currentPlatform={currentPlatform} />
)}
{crossLinkProps && (
<CrossLink {...crossLinkProps} />
)}
{isGen1 && <Gen1Banner currentPlatform={currentPlatform} />}
{crossLinkProps && <CrossLink {...crossLinkProps} />}
{useCustomTitle ? null : (
<Flex
justifyContent="space-between"
Expand Down
6 changes: 5 additions & 1 deletion src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const invalidChildren = [
'/gen1/[platform]/sdk'
];

export function Menu({ currentPlatform, path, activeSection }: MenuProps): ReactElement {
export function Menu({
currentPlatform,
path,
activeSection
}: MenuProps): ReactElement {
// Depending on the the page we're on, we could have the following keywords at these subpaths
// Split them out so we can figure out what kind of page it is
const pathSplit = path.split('/');
Expand Down
11 changes: 10 additions & 1 deletion src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ export function MenuItem({
}: MenuItemProps): ReactElement {
const { menuOpen, toggleMenuOpen } = useContext(LayoutContext);
const asPathWithoutHash = usePathWithoutHash();
const [open, setOpen] = useState(false);

// Initialize open state from URL so SSR HTML has correct accordions expanded,
// preventing layout shift during hydration.
const [open, setOpen] = useState(() => {
if (level <= Levels.Category) return false;
if (!pageNode.route) return false;
const itemPath = getPathname(pageNode.route, currentPlatform);
return asPathWithoutHash.startsWith(itemPath);
});
const children = useMemo(() => {
if (hideChildren) return [];
const allChildren = pageNode.children;
Expand Down Expand Up @@ -218,6 +226,7 @@ export function MenuItem({
className={`menu__list ${
!open && level > Levels.Category ? 'menu__list--hide' : ''
}`}
hidden={!open && level > Levels.Category ? true : undefined}
>
{children.map((child, index) => (
<MenuItem
Expand Down
29 changes: 29 additions & 0 deletions src/pages/[platform]/how-amplify-works/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getChildPageNodes } from '@/utils/getChildPageNodes';
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
import { Card } from '@aws-amplify/ui-react';

export const meta = {
title: 'How Amplify works',
Expand Down Expand Up @@ -27,10 +28,38 @@ export function getStaticProps(context) {
const childPageNodes = getChildPageNodes(meta.route);
return {
props: {
platform: context.params.platform,
meta,
childPageNodes
}
};
}

AWS Amplify is a complete toolkit for building fullstack apps. It consists of four independent pillars that can be used together or separately:

<Columns columns={2}>
<Card variation="outlined">
**[Backend](/[platform]/build-a-backend/)**

Define cloud resources like authentication, data, storage, and functions using TypeScript. Amplify provisions and manages the AWS infrastructure for you.
</Card>
<Card variation="outlined">
**[Frontend Libraries](/[platform]/frontend/)**

Libraries that connect your web or mobile app to backend services. Available for JavaScript, React, React Native, Swift, Android, and Flutter.
</Card>
<Card variation="outlined">
**[UI Libraries](/[platform]/build-ui/)**

Pre-built, themeable UI components like Authenticator, Storage Manager, and AI conversation interfaces. Drop-in components that handle complex workflows.
</Card>
<Card variation="outlined">
**[Hosting](/[platform]/deploy-and-host/)**

Deploy and host fullstack web apps with Git-based CI/CD, branch previews, custom domains, and server-side rendering support.
</Card>
</Columns>

Each pillar works independently — use just the frontend libraries with your own backend, or just hosting for a static site. Together, they provide an integrated fullstack development experience.

<Overview childPageNodes={props.childPageNodes} />
5 changes: 5 additions & 0 deletions src/styles/feature-links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

.feature-link {
list-style: none;

a {
font-weight: var(--amplify-font-weights-bold);
font-size: var(--amplify-font-sizes-medium);
}
}
.category-list {
flex-direction: column;
Expand Down
11 changes: 11 additions & 0 deletions src/styles/overview.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/* Style bold links inside cards to look like navigable pillar links */
.amplify-card strong a:not([class]) {
font-size: var(--amplify-font-sizes-large);
color: var(--amplify-colors-primary-80);
text-underline-offset: 2px;

&:hover {
color: var(--amplify-colors-primary-60);
}
}

.overview {
gap: var(--amplify-space-xxl);
&__link {
Expand Down
Loading