Skip to content

Commit 4a1b94b

Browse files
author
katiegoines
committed
fix merge conflict
2 parents cec18c7 + 63616a6 commit 4a1b94b

File tree

54 files changed

+260
-226
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

+260
-226
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: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
import { Flex, View, Link, Heading } from '@aws-amplify/ui-react';
22
import { IconTOC } from '@/components/Icons';
3-
import { useContext } from 'react';
4-
import { LayoutContext } from '../Layout';
3+
54
export interface HeadingInterface {
65
linkText: string;
76
hash: string;
87
level: string;
8+
subheadings: Array<object>;
99
}
1010
interface TableOfContents {
1111
headers?: HeadingInterface[];
1212
forDesktop?: boolean;
1313
}
1414

1515
export const TableOfContents = ({ headers, forDesktop }) => {
16-
const { tocOpen, toggleTocOpen } = useContext(LayoutContext);
17-
18-
const onLinkClick = () => {
19-
if (tocOpen) {
20-
// Close the menu after clicking a link (applies to the mobile menu)
21-
toggleTocOpen(false);
22-
}
23-
};
24-
2516
const hideOnMobile = forDesktop ? 'desktop-toc' : '';
2617

2718
return (
@@ -39,21 +30,57 @@ export const TableOfContents = ({ headers, forDesktop }) => {
3930
)}
4031
<View as="ul" className="toc-list">
4132
{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}
33+
if (headers[index].subheadings?.length === 0) {
34+
return (
35+
<View
36+
as="li"
37+
className={`toc-item toc-item--${level}`}
38+
key={`toc-${index}`}
39+
>
40+
<Link
41+
href={`#${hash}`}
42+
className={`toc-item__link toc-item__link--${level}`}
43+
>
44+
{linkText}
45+
</Link>
46+
</View>
47+
);
48+
} else {
49+
return (
50+
<View
51+
as="li"
52+
className={`toc-item toc-item--${level}`}
53+
key={`toc-${index}`}
5254
>
53-
{linkText}
54-
</Link>
55-
</View>
56-
);
55+
<Link
56+
href={`#${hash}`}
57+
className={`toc-item__link toc-item__link--${level}`}
58+
>
59+
{linkText}
60+
</Link>
61+
<View as="ul" className="toc-list">
62+
{headers[index].subheadings?.map(
63+
({ linkText, hash, level }, index) => {
64+
return (
65+
<View
66+
as="li"
67+
className={`toc-item toc-item--${level}`}
68+
key={`toc-${index}`}
69+
>
70+
<Link
71+
href={`#${hash}`}
72+
className={`toc-item__link toc-item__link--${level}`}
73+
>
74+
{linkText}
75+
</Link>
76+
</View>
77+
);
78+
}
79+
)}
80+
</View>
81+
</View>
82+
);
83+
}
5784
})}
5885
</View>
5986
</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)