Skip to content

Commit eab0c41

Browse files
authored
Merge pull request #541 from NMFS-RADFish/540-polish-network-status
540 - Polish network status
2 parents 11ed96c + b6e0e22 commit eab0c41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/network-status/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22

33
[Official Documentation](https://nmfs-radfish.github.io/radfish/)
44

5-
This example shows you how to detect if a user has network connectivity. If the user is offline a toast alert will be displayed at the top of the app.
5+
This example demonstrates how to detect if a user has network connectivity. If the user is offline a toast alert will be displayed at the top of the app.
66

77
The `useOfflineStatus` hook provides a `isOffline` utility that detects whether or not a user has network connectivity. It uses the `navigator` browser API. Please see the [MDN Navigator Docs](https://developer.mozilla.org/en-US/docs/Web/API/Navigator) for limitations.
88

9-
Learn more about RADFish examples at the official [documentation](https://nmfs-radfish.github.io/radfish/developer-documentation/examples-and-templates#examples)
9+
Learn more about RADFish examples at the official [documentation](https://nmfs-radfish.github.io/radfish/developer-documentation/examples-and-templates#examples).
1010

1111
## Steps
1212

13-
1. Import the following in the `App.jsx` file:
13+
### 1. Import Required Dependencies
14+
Import the following in the `App.jsx` file:
1415
```jsx
1516
import React, { useEffect } from "react";
1617
import { TOAST_CONFIG, TOAST_LIFESPAN, useToast } from "./hooks/useToast";
1718
import { useOfflineStatus } from "@nmfs-radfish/react-radfish";
1819
import { Alert } from "@trussworks/react-uswds";
1920
```
20-
2. Within the `App` component create a `useEffect` to handle displaying the toast:
21+
### 2. Add useEffect for Toast Notifications
22+
Within the `App` component create a `useEffect` to handle displaying the toast:
2123
```jsx
2224
useEffect(() => {
2325
if (isOffline) {

0 commit comments

Comments
 (0)