Skip to content

Commit

Permalink
refactor(04-zkapp-ui-with-react.mdx):move download UI files section
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Oct 2, 2024
1 parent 031d6a1 commit bf39c6a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/zkapps/tutorials/04-zkapp-ui-with-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,15 @@ Because o1js code is computationally intensive, it's helpful to use web workers.

- `zkappWorker.ts` is the web worker code
- `zkappWorkerClient.ts` is the client code that is run from React to interact with the web worker


### Download the main browser UI logic file

The example project has a completed app. The `page.tsx` file is the entry file for your application and contains the main logic for the browser UI that is ready to deploy to GitHub Pages.

1. Download the [page.tsx](https://github.com/o1-labs/docs2/blob/main/examples/zkapps/04-zkapp-browser-ui/ui/app/page.tsx) example file.

1. Move the `page.tsx` file to your local `04-zkapp-browser-ui/ui/app` directory.

## Build the default contract

This tutorial uses the default contract `Add` that is always scaffolded with the `zk project` command.
Expand All @@ -169,14 +177,6 @@ Outside of this tutorial, the workflow for building your own zkApp is to edit fi

The UI application has several components: the React page itself and the code that uses o1js.

### Download the main browser UI logic file

The example project has a completed app. The `page.tsx` file is the entry file for your application and contains the main logic for the browser UI that is ready to deploy to GitHub Pages.

1. Download the [page.tsx](https://github.com/o1-labs/docs2/blob/main/examples/zkapps/04-zkapp-browser-ui/ui/app/page.tsx) example file.

1. Move the `page.tsx` file to your local `04-zkapp-browser-ui/ui/app` directory.

### Setup web workers

The web worker code resides in the `04-zkapp-browser-ui/ui/app/zkappWorker.ts` file. Here, you define the functions that will be executed in the worker thread.
Expand Down

0 comments on commit bf39c6a

Please sign in to comment.