Skip to content

Commit 2cefaad

Browse files
committed
docs(react): upate your first app page
1 parent e3410a2 commit 2cefaad

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

docs/react/your-first-app.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ We'll create a Photo Gallery app that offers the ability to take photos with you
3030

3131
Highlights include:
3232

33-
- One React-based codebase that runs on the web, iOS, and Android using Ionic Framework [UI components](https://ionicframework.com/docs/components).
33+
- One React-based codebase that runs on the web, iOS, and Android using Ionic Framework [UI components](../components.md).
3434
- Deployed as a native iOS and Android mobile app using [Capacitor](https://capacitorjs.com), Ionic's official native app runtime.
35-
- Photo Gallery functionality powered by the Capacitor [Camera](https://capacitorjs.com/docs/apis/camera), [Filesystem](https://capacitorjs.com/docs/apis/filesystem), and [Preferences](https://capacitorjs.com/docs/apis/preferences) APIs.
35+
- Photo Gallery functionality powered by the Capacitor [Camera](../native/camera.md), [Filesystem](../native/filesystem.md), and [Preferences](../native/preferences.md) APIs.
3636

37-
Find the complete app code referenced in this guide [on GitHub](https://github.com/ionic-team/photo-gallery-capacitor-react).
37+
Find the complete app code referenced in this guide [on GitHub](https://github.com/ionic-team/tutorial-photo-gallery-react).
3838

3939
## Download Required Tools
4040

@@ -88,7 +88,7 @@ npm install @capacitor/camera @capacitor/preferences @capacitor/filesystem
8888

8989
### PWA Elements
9090

91-
Some Capacitor plugins, including the Camera API, provide the web-based functionality and UI via the Ionic [PWA Elements library](https://github.com/ionic-team/pwa-elements).
91+
Some Capacitor plugins, including the [Camera API](../native/camera.md), provide the web-based functionality and UI via the Ionic [PWA Elements library](https://github.com/ionic-team/pwa-elements).
9292

9393
It's a separate dependency, so install it next:
9494

@@ -131,7 +131,7 @@ And voilà! Your Ionic app is now running in a web browser. Most of your app can
131131

132132
## Photo Gallery!!!
133133

134-
There are three tabs. Click on the Tab2 tab. It’s a blank canvas, aka the perfect spot to transform into a Photo Gallery. The Ionic CLI features Live Reload, so when you make changes and save them, the app is updated immediately!
134+
There are three tabs. Click on the "Tab2" tab. It’s a blank canvas, aka the perfect spot to transform into a Photo Gallery. The Ionic CLI features Live Reload, so when you make changes and save them, the app is updated immediately!
135135

136136
![Animated GIF showing the live reload feature in an Ionic app, with changes in code immediately updating the app in a web browser.](/img/guides/react/first-app/live-reload.gif 'Live Reload Feature in Ionic App')
137137

@@ -226,18 +226,28 @@ const Tab2: React.FC = () => {
226226
export default Tab2;
227227
```
228228

229-
Next, open `src/App.tsx` and replace the imported `ellipse` icon with the `images` icon.
229+
Next, open `src/App.tsx`. Change the label to “Photos” and the `ellipse` icon to `images` for the middle tab button.
230230

231231
```tsx
232-
import { images, square, triangle } from 'ionicons/icons';
233-
```
234-
235-
Within the tab bar (`<IonTabBar>`), change the label to “Photos” and the `ellipse` icon to `images` for the middle tab button:
236-
237-
```tsx
238-
// Keep other imports
232+
import { Redirect, Route } from 'react-router-dom';
233+
import {
234+
IonApp,
235+
IonIcon,
236+
IonLabel,
237+
IonRouterOutlet,
238+
IonTabBar,
239+
IonTabButton,
240+
IonTabs,
241+
setupIonicReact,
242+
} from '@ionic/react';
243+
import { IonReactRouter } from '@ionic/react-router';
239244
// CHANGE: Update the following import.
240245
import { images, square, triangle } from 'ionicons/icons';
246+
import Tab1 from './pages/Tab1';
247+
import Tab2 from './pages/Tab2';
248+
import Tab3 from './pages/Tab3';
249+
250+
/* Ionic styles are not shown in this example to keep it brief but will be included in the Ionic package downloaded for your app. Do not remove them. */
241251

242252
const App: React.FC = () => (
243253
<IonApp>
@@ -279,8 +289,4 @@ const App: React.FC = () => (
279289
);
280290
```
281291

282-
:::note
283-
In Ionic React, icons are imported individually from `ionicons/icons` and set to the icon prop.
284-
:::
285-
286292
That’s just the start of all the cool things we can do with Ionic. Up next, implement camera taking functionality on the web, then build it for iOS and Android.

0 commit comments

Comments
 (0)