Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #14 List role titles in a DAO #24

Merged
merged 11 commits into from
Mar 23, 2024
2 changes: 1 addition & 1 deletion frontend_v2/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Footer() {
return (
<>
<footer className="flex items-center justify-center w-full h-24 border-t mt-10">
<footer className="flex items-center justify-center w-full h-24 border-t-2 border-green-300 mt-10">
Made by <span className="animate-bounce">🐸🐸🐸</span>
</footer>
</>
Expand Down
2 changes: 1 addition & 1 deletion frontend_v2/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Header() {
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:[email protected]&display=swap" rel="stylesheet"></link>
</Head>
<header className="flex items-center justify-center w-full h-22 border-b mb-10 p-4">
<header className="flex items-center justify-center w-full h-22 border-b-2 border-green-300 mb-10 p-4">
<ConnectButton />
</header>
</>
Expand Down
37 changes: 37 additions & 0 deletions frontend_v2/components/Roles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useReadContract } from "wagmi";
import { abi } from "../../smart-contracts/ignition/deployments/chain-11155420/artifacts/DaoModule#Dao.json";
import { useIsMounted } from "../hooks/useIsMounted";

export default function Roles({ orgAddress }: any) {
console.log('Roles')

const { data, isLoading } = useReadContract({
abi,
address: orgAddress,
functionName: 'getRolesCount'
})
console.log('data:', data )

if (!useIsMounted || isLoading) {
jo-elimu marked this conversation as resolved.
Show resolved Hide resolved
return (
<>
Loading DAO roles...
<div className="mt-4 animate-spin text-6xl">🐸</div>
</>
)
}

return (
<>
<div className="bg-white rounded-2xl p-4">
Role title 1
</div>
<div className="mt-4 bg-white rounded-2xl p-4">
Role title 2
</div>
<div className="mt-4 bg-white rounded-2xl p-4">
Role title 3
</div>
jo-elimu marked this conversation as resolved.
Show resolved Hide resolved
</>
)
}
22 changes: 19 additions & 3 deletions frontend_v2/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,25 @@ export default function Home() {
Radical DAO Transparency 🐸
</h1>

<Link href={`/orgs/${orgAddress}`} className="hover:text-purple-600 focus:text-purple-600">
<Image alt='Frog DAO' src={'/transparent.png'} width={400} height={400}
className='mt-8 rounded-2xl' />
<Link href={`/orgs/${orgAddress}`} className="mt-8 rounded-2xl shadow-2xl">
<Image alt='Frog DAO' src={'/transparent.png'} width={400} height={400} className='rounded-t-2xl' />
<div className='bg-white rounded-b-2xl p-4 text-4xl'>
Hacker DAO
</div>
</Link>

<Link href={`/orgs/${orgAddress}`} className="mt-8 rounded-2xl shadow-2xl">
<Image alt='Frog DAO' src={'/transparent.png'} width={400} height={400} className='rounded-t-2xl' />
<div className='bg-white rounded-b-2xl p-4 text-4xl'>
Cracker DAO
</div>
</Link>

<Link href={`/orgs/${orgAddress}`} className="mt-8 rounded-2xl shadow-2xl">
<Image alt='Frog DAO' src={'/transparent.png'} width={400} height={400} className='rounded-t-2xl' />
<div className='bg-white rounded-b-2xl p-4 text-4xl'>
Snacker DAO
</div>
Comment on lines +23 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All DAO links currently point to the same orgAddress. If each DAO is supposed to have a unique address, consider updating the links to reflect the correct addresses for "Hacker DAO," "Cracker DAO," and "Snacker DAO."

</Link>
</main>

Expand Down
23 changes: 7 additions & 16 deletions frontend_v2/pages/orgs/[orgAddress].tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

import Head from "next/head";
import Image from "next/image";
import { useRouter } from "next/router";
import Header from "../../components/Header";
// import Header from '@/components/Header';
import Footer from "../../components/Footer";
import Link from "next/link";
import Roles from "../../components/Roles";

export default function Organization() {
console.log('Organization')

const router = useRouter()
const orgAddress = router.query.orgAddress
const orgAddress: any = router.query.orgAddress
console.log('orgAddress:', orgAddress)

return (
Expand All @@ -20,22 +18,15 @@ export default function Organization() {

<main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center">
<h1 className="text-6xl font-bold">
Frog DAO
Hacker DAO
</h1>

<Link className="mt-4" href={`https://sepolia-optimism.etherscan.io/address/${orgAddress}`} target="_blank">
<code>{orgAddress}</code> ↗️
<code className="bg-green-100 rounded-2xl p-2 px-4">{orgAddress} ↗️</code>
</Link>

<div id="daoRoles" className="mt-4">
<div>
Role title 1
</div>
<div>
Role title 2
</div>
<div>
Role title 3
</div>
<div id="orgRoles" className="mt-8">
<Roles orgAddress={orgAddress} />
</div>
</main>

Expand Down
Loading