-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from algorandfoundation/fix/cd-docs-improvement
fix: refining docs; tweaking usage of useWallet hook
- Loading branch information
Showing
31 changed files
with
414 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// src/components/Home.tsx | ||
import { useWallet } from '@txnlab/use-wallet' | ||
import React, { useState } from 'react' | ||
import ConnectWallet from './components/ConnectWallet' | ||
import Transact from './components/Transact' | ||
|
||
interface HomeProps {} | ||
|
||
const Home: React.FC<HomeProps> = () => { | ||
const [openWalletModal, setOpenWalletModal] = useState<boolean>(false) | ||
const [openDemoModal, setOpenDemoModal] = useState<boolean>(false) | ||
const { activeAddress } = useWallet() | ||
|
||
const toggleWalletModal = () => { | ||
setOpenWalletModal(!openWalletModal) | ||
} | ||
|
||
const toggleDemoModal = () => { | ||
setOpenDemoModal(!openDemoModal) | ||
} | ||
|
||
return ( | ||
<div className="hero min-h-screen bg-teal-400"> | ||
<div className="hero-content text-center rounded-lg p-6 max-w-md bg-white mx-auto"> | ||
<div className="max-w-md"> | ||
<h1 className="text-4xl"> | ||
Welcome to <div className="font-bold">AlgoKit 🙂</div> | ||
</h1> | ||
<p className="py-6"> | ||
This starter has been generated using official AlgoKit React template. Refer to the resource below for next steps. | ||
</p> | ||
|
||
<div className="grid"> | ||
<a | ||
data-test-id="getting-started" | ||
className="btn btn-primary m-2" | ||
target="_blank" | ||
href="https://github.com/algorandfoundation/algokit-cli" | ||
> | ||
Getting started | ||
</a> | ||
|
||
<div className="divider" /> | ||
<button data-test-id="connect-wallet" className="btn m-2" onClick={toggleWalletModal}> | ||
Wallet Connection | ||
</button> | ||
|
||
{activeAddress && ( | ||
<button data-test-id="transactions-demo" className="btn m-2" onClick={toggleDemoModal}> | ||
Transactions Demo | ||
</button> | ||
)} | ||
</div> | ||
|
||
<ConnectWallet openModal={openWalletModal} closeModal={toggleWalletModal} /> | ||
<Transact openModal={openDemoModal} setModalState={setOpenDemoModal} /> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.