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

+8-1
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

+52-25
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

+2-2
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

+9-9
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

src/fragments/lib-v1/push-notifications/common/receive-device-token.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Push notifications are delivered to your user's devices through a device token which uniquely identifies your app. Although Amplify will automatically register this token with Amazon Pinpoint, it can still be useful to have access to this token for your app's use cases (e.g. to send direct notifications to a specific device).
22

3-
### onTokenReceived
3+
## onTokenReceived
44

55
Add `onTokenReceived` listeners to respond to a token being received by your app.
66

src/fragments/lib-v1/react-native-polyfills.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Install Amplify and its dependencies
1+
## Install Amplify and its dependencies
22

33
```bash
44
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill

src/fragments/lib-v1/storage/android/download.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Download to file
1+
## Download to file
22

33
If you uploaded the data using the key `ExampleKey`, you can retrieve the data using `Amplify.Storage.downloadFile`.
44

src/fragments/lib-v1/storage/ios/download.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
There are three ways of getting data that was previously uploaded:
22

3-
### Download data
3+
## Download data
44

55
You can download to in-memory buffer [Data](https://developer.apple.com/documentation/foundation/data) object with `Amplify.Storage.downloadData`:
66

@@ -46,7 +46,7 @@ receiveValue: { data in
4646

4747
</BlockSwitcher>
4848

49-
### Download to file
49+
## Download to file
5050

5151
You can download to a file [URL](https://developer.apple.com/documentation/foundation/url) with `Amplify.Storage.downloadFile`:
5252

src/fragments/lib-v1/storage/js/autotrack.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ You can enable automatic tracking of Storage Events such as uploads and download
88
the event, e.g. *Storage {'>'} Method {'>'} Put*.
99
</Callout>
1010

11-
### Track all the Storage events
11+
## Track all the Storage events
1212

1313
```javascript
1414
Storage.configure({ track: true });
1515
```
1616

17-
### Track a specific storage action
17+
## Track a specific storage action
1818

1919
```javascript
2020
Storage.get('welcome.png', { track: true });

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

+2-2
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
After creating the Amazon Personalize dataset group, you need to add the `personalize:PutEvents` permission to your Amplify IAM user roles.
1313

@@ -49,7 +49,7 @@ Amplify.configure({
4949
}
5050
});
5151
```
52-
### Working with the API
52+
## Working with the API
5353

5454
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.
5555
Consider the following user interactions when choosing when and how often to call record with the Identify eventType:

src/fragments/lib/auth/android/signin_next_steps/80_current_user.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Get Current User
1+
## Get Current User
22

33
This call fetches the current logged in user and should be used after a user has been successfully signed in.
44
If the user is signed in, it will return the current userId and username.

src/fragments/lib/auth/flutter/access_credentials/10_fetchAuthSession.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Future<void> fetchAuthSession() async {
1111
}
1212
```
1313

14-
### Retrieving AWS credentials
14+
## Retrieving AWS credentials
1515

1616
Sometimes it can be helpful to retrieve the instance of the underlying plugin
1717
which has more specific typing. In the case of Cognito, calling `fetchAuthSession`

0 commit comments

Comments
 (0)