Skip to content

Commit b7ed01e

Browse files
authored
Merge branch 'main' into a11y-mobile-toc
2 parents cec18c7 + 63616a6 commit b7ed01e

File tree

54 files changed

+259
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+259
-215
lines changed

src/components/Layout/Layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,15 @@ export const Layout = ({
152152

153153
pageHeadings.forEach((node) => {
154154
const { innerText, id, localName } = node as HTMLElement;
155-
if (innerText && id && (localName == 'h2' || localName == 'h3')) {
155+
if (innerText && id && localName == 'h2') {
156156
headings.push({
157+
linkText: innerText,
158+
hash: id,
159+
level: localName,
160+
subheadings: []
161+
});
162+
} else if (innerText && id && localName == 'h3') {
163+
headings[headings.length - 1].subheadings.push({
157164
linkText: innerText,
158165
hash: id,
159166
level: localName

src/components/TableOfContents/TableOfContents.tsx

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface HeadingInterface {
66
linkText: string;
77
hash: string;
88
level: string;
9+
subheadings: Array<object>;
910
}
1011
interface TableOfContents {
1112
headers?: HeadingInterface[];
@@ -39,21 +40,57 @@ export const TableOfContents = ({ headers, forDesktop }) => {
3940
)}
4041
<View as="ul" className="toc-list">
4142
{headers.map(({ linkText, hash, level }, index) => {
42-
return (
43-
<View
44-
as="li"
45-
className={`toc-item toc-item--${level}`}
46-
key={`toc-${index}`}
47-
>
48-
<Link
49-
href={`#${hash}`}
50-
className={`toc-item__link toc-item__link--${level}`}
51-
onClick={onLinkClick}
43+
if (headers[index].subheadings?.length === 0) {
44+
return (
45+
<View
46+
as="li"
47+
className={`toc-item toc-item--${level}`}
48+
key={`toc-${index}`}
5249
>
53-
{linkText}
54-
</Link>
55-
</View>
56-
);
50+
<Link
51+
href={`#${hash}`}
52+
className={`toc-item__link toc-item__link--${level}`}
53+
>
54+
{linkText}
55+
</Link>
56+
</View>
57+
);
58+
} else {
59+
return (
60+
<View
61+
as="li"
62+
className={`toc-item toc-item--${level}`}
63+
key={`toc-${index}`}
64+
>
65+
<Link
66+
href={`#${hash}`}
67+
className={`toc-item__link toc-item__link--${level}`}
68+
>
69+
{linkText}
70+
</Link>
71+
<View as="ul" className="toc-list">
72+
{headers[index].subheadings?.map(
73+
({ linkText, hash, level }, index) => {
74+
return (
75+
<View
76+
as="li"
77+
className={`toc-item toc-item--${level}`}
78+
key={`toc-${index}`}
79+
>
80+
<Link
81+
href={`#${hash}`}
82+
className={`toc-item__link toc-item__link--${level}`}
83+
>
84+
{linkText}
85+
</Link>
86+
</View>
87+
);
88+
}
89+
)}
90+
</View>
91+
</View>
92+
);
93+
}
5794
})}
5895
</View>
5996
</Flex>

src/fragments/lib-v1/analytics/js/personalize.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To record event data, you need the following:
77

88
For more information, see [Record Events](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html).
99

10-
### Installation and Configuration
10+
## Installation and Configuration
1111

1212
Register the *AmazonPersonalizeProvider* with the Analytics category:
1313
You need the tracking ID of your event tracker. For more information, see [Get a Tracking ID](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html#event-get-tracker).
@@ -38,7 +38,7 @@ Analytics.configure({
3838
}
3939
});
4040
```
41-
### Working with the API
41+
## Working with the API
4242

4343
You can use the `Identify` event type to track a user identity. This lets you connect a user to their actions and record traits about them. To identify a user, specify a unique identifier for the userId property.
4444
Consider the following user interactions when choosing when and how often to call record with the Identify eventType:

src/fragments/lib-v1/auth/native_common/signin_next_steps/common.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import flutter0 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/10_si
1010

1111
<Fragments fragments={{ swift: ios0, flutter: flutter0 }} />
1212

13-
### Confirm signin with SMS MFA
13+
## Confirm signin with SMS MFA
1414

1515
import ios1 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/20_confirm_sms_mfa.mdx';
1616

@@ -19,62 +19,62 @@ import flutter1 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/20_co
1919
<Fragments fragments={{ swift: ios1, flutter: flutter1 }} />
2020

2121
<InlineFilter filters={["flutter"]}>
22-
### Confirm signin with TOTP MFA
22+
## Confirm signin with TOTP MFA
2323
</InlineFilter>
2424

2525
import flutter7 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/80_totp.mdx';
2626

2727
<Fragments fragments={{ flutter: flutter7 }} />
2828

2929
<InlineFilter filters={["flutter"]}>
30-
### Continue signin with MFA Selection
30+
## Continue signin with MFA Selection
3131
</InlineFilter>
3232

3333
import flutter8 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/90_mfa_selection.mdx';
3434

3535
<Fragments fragments={{ flutter: flutter8 }} />
3636

3737
<InlineFilter filters={["flutter"]}>
38-
### Continue signin with TOTP Setup
38+
## Continue signin with TOTP Setup
3939
</InlineFilter>
4040

4141
import flutter9 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/100_totp_setup.mdx';
4242

4343
<Fragments fragments={{ flutter: flutter9 }} />
4444

45-
### Confirm signin with custom challenge
45+
## Confirm signin with custom challenge
4646

4747
import ios2 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/30_confirm_custom_challenge.mdx';
4848

4949
import flutter2 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/30_confirm_custom_challenge.mdx';
5050

5151
<Fragments fragments={{ swift: ios2, flutter: flutter2 }} />
5252

53-
### Confirm signin with new password
53+
## Confirm signin with new password
5454

5555
import ios3 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/40_confirm_new_password.mdx';
5656

5757
import flutter3 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/40_confirm_new_password.mdx';
5858

5959
<Fragments fragments={{ swift: ios3, flutter: flutter3 }} />
6060

61-
### Reset password
61+
## Reset password
6262

6363
import ios4 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/50_reset_password.mdx';
6464

6565
import flutter4 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/50_reset_password.mdx';
6666

6767
<Fragments fragments={{ swift: ios4, flutter: flutter4 }} />
6868

69-
### Confirm Signup
69+
## Confirm Signup
7070

7171
import ios5 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/60_confirm_signup.mdx';
7272

7373
import flutter5 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/60_confirm_signup.mdx';
7474

7575
<Fragments fragments={{ swift: ios5, flutter: flutter5 }} />
7676

77-
### Done
77+
## Done
7878

7979
import ios6 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/70_done.mdx';
8080

src/fragments/lib-v1/geo/android/escapehatch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Log.i("MyAmplifyApp", response.entries.toString())
5151
</Block>
5252
</BlockSwitcher>
5353

54-
### Documentation Resources
54+
## Documentation Resources
5555

5656
* [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html)
5757

src/fragments/lib-v1/geo/ios/escapehatch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ do {
4747
}
4848
```
4949

50-
### Documentation Resources
50+
## Documentation Resources
5151

5252
* [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html)
5353

src/fragments/lib-v1/in-app-messaging/integrate-your-application/integrate-your-application.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import js1 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-applicati
1616

1717
<Fragments fragments={{ javascript: js1 , angular: js1, nextjs: js1, react: js1, vue: js1 }} />
1818

19-
### Integrate In-App Messaging
19+
## Integrate In-App Messaging
2020

2121
Amplify UI provides a Higher-Order Component for ease of integrating the In-App Messaging UI with your application. Simply wrap your application root component in, for example, `App.js`.
2222

src/fragments/lib-v1/in-app-messaging/integrate-your-application/js/install-dependencies.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{/* TODO What should be done with this page for non-react frameworks */}
22

3-
### Install Amplify UI for React
3+
## Install Amplify UI for React
44

55
import js0 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-application/ui-integration.mdx';
66

src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/configure-amplify.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Configure Amplify
1+
## Configure Amplify
22

33
import rn1 from '/src/fragments/lib-v1/common/react-native/import_configuration.mdx';
44

src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import reactnative0 from '/src/fragments/lib-v1/react-native-polyfills.mdx';
22

33
<Fragments fragments={{ 'react-native': reactnative0 }} />
44

5-
### Install Amplify UI for React Native and its dependencies
5+
## Install Amplify UI for React Native and its dependencies
66

77
import reactnative1 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-application/ui-integration.mdx';
88

0 commit comments

Comments
 (0)