Skip to content

Commit

Permalink
fix code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
PiVortex committed Oct 11, 2024
1 parent b811852 commit fa8a786
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions docs/3.tutorials/auction/2.1-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We have a config file that specifies the contract name of the auction that the f

<Language value="javascript" language="javascript" showSingleFName={true}>
<Github fname="config.js"
url="https://github.com/near-examples/auctions-tutorial/tree/reorg-auction/frontends/01-frontends/01-frontend/src/config.js"
url="https://github.com/near-examples/auctions-tutorial/tree/reorg-auction/frontends/01-frontend/src/config.js"
/>
</Language>

Expand All @@ -53,16 +53,16 @@ We have a config file that specifies the contract name of the auction that the f

To be able to fully interact with the contract - send bids and claim the auction - you'll need a `wallet` to sign transactions. Wallets securely store your private keys and allow you to sign transactions without exposing your private key to the frontend. The wallet selector allows users to choose between a selection of wallets.

We abstract the wallet selector in our `near.js` file by exposing methods to complete various tasks. Feel free to [explore the file](https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/wallets/near.js) to understand fully how the wallet selector is implemented.
We abstract the wallet selector in our `near.js` file by exposing methods to complete various tasks. Feel free to [explore the file](https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/wallets/near.js) to understand fully how the wallet selector is implemented.

The wallet object is initiated in the `app.js` file and its added to the global context along with the account that is signed in to make it easier to access anywhere in the application.

<Language value="javascript" language="javascript">
<Github fname="_app.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/pages/_app.js#L13-L27"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/pages/_app.js#L13-L27"
start="13" end="27" />
<Github fname="context.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/context.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/context.js"
/>
</Language>

Expand All @@ -78,10 +78,10 @@ We add a sign-in and sign-out button in the `navigation` component to call the r

<Language value="javascript" language="javascript">
<Github fname="Navigation.jsx"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/components/Navigation.jsx"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/components/Navigation.jsx"
/>
<Github fname="near.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/wallets/near.js#L58-L72"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/wallets/near.js#L58-L72"
start="58" end="72" />
</Language>

Expand All @@ -93,10 +93,10 @@ To get the highest bid from the auction and who made it we call `get_highest_bid

<Language value="javascript" language="javascript">
<Github fname="index.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/pages/index.js#L24-L29"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/pages/index.js#L24-L29"
start="24" end="29" />
<Github fname="near.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/wallets/near.js#L82-L94"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/wallets/near.js#L82-L94"
start="82" end="94" />
</Language>

Expand All @@ -106,7 +106,7 @@ We then pass the information about the highest bidder into the `LastBid` compone

<Language value="javascript" language="javascript">
<Github fname="index.js"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontends/01-frontend/src/pages/index.js#L101"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/pages/index.js#L101"
start="101" end="101" />
<Github fname="LastBid.jsx"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/01-frontend/src/components/LastBid.jsx"
Expand Down
2 changes: 1 addition & 1 deletion docs/3.tutorials/auction/3.3-new-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ In a new component named `AuctionItem` we display the NFT image, name, and descr

<Language value="javascript" language="javascript" showSingleFName={true}>
<Github fname="AuctionItem.jsx"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontend/src/components/AuctionItem.jsx"
url="https://github.com/near-examples/auctions-tutorial/blob/reorg-auction/frontends/03-frontend/src/components/AuctionItem.jsx"
/>
</Language>

Expand Down

0 comments on commit fa8a786

Please sign in to comment.