-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
136 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect } from "react"; | ||
import { useFormContext } from "react-hook-form"; | ||
|
||
import { Buildable, Field } from "@daohaus/ui"; | ||
|
||
import { useParams } from "react-router-dom"; | ||
|
||
export const ParamTag = (props: Buildable<Field>) => { | ||
const { setValue } = useFormContext(); | ||
// use params tag | ||
const { tag } = useParams(); | ||
useEffect(() => { | ||
if (tag == "personal" || tag == "topic") { | ||
setValue(props.id, tag); | ||
} | ||
}, [tag]); | ||
|
||
return null; | ||
}; |
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,89 @@ | ||
|
||
import { useDHConnect } from "@daohaus/connect"; | ||
import styled from "styled-components"; | ||
import { BiColumnLayout, Button, Link } from "@daohaus/ui"; | ||
import { Link as RouterLink } from "react-router-dom"; | ||
import { supportedNetorks } from "../main"; | ||
import { ADMIN_URL } from "../utils/constants"; | ||
|
||
const LinkButton = styled(RouterLink)` | ||
text-decoration: none; | ||
`; | ||
|
||
const ExternalLinkButton = styled(Link)` | ||
text-decoration: none; | ||
color: unset; | ||
&:hover { | ||
text-decoration: none; | ||
} | ||
`; | ||
|
||
|
||
const Landing = () => { | ||
const { chainId, isConnected } = useDHConnect(); | ||
|
||
return ( | ||
<> | ||
{chainId && chainId in supportedNetorks ? ( | ||
<BiColumnLayout left={( | ||
<div> | ||
<h1>Create Topic Hub</h1> | ||
<p> | ||
Create a topic hub to organize and fund projects, events, and more. | ||
</p> | ||
<LinkButton to="/summon/topic"> | ||
<Button variant="outline">Summon a Topic</Button> | ||
</LinkButton> | ||
</div> | ||
)} | ||
right={( | ||
<div> | ||
<h2>Create Personal Hub</h2> | ||
<p> | ||
The fun starts with your own personal hub. | ||
</p> | ||
<p>TODO: if a personal hub already exists display info and a link to it here, otherwise link to summon form. This may need to be queried through dao name or tag, and summoner</p> | ||
|
||
<LinkButton to={`/summon/personal`} > | ||
<Button variant="outline">Summon a Personal Hub</Button> | ||
</LinkButton> | ||
<ExternalLinkButton | ||
showExternalIcon={true} | ||
target="_blank" | ||
href={`${ADMIN_URL}`} | ||
> | ||
Continue To Topic List | ||
</ExternalLinkButton> | ||
</div> | ||
)} | ||
> | ||
|
||
</BiColumnLayout> | ||
) : | ||
( | ||
<div> | ||
{!isConnected && (<><h1>Not Connected</h1> | ||
<p> | ||
Please connect your wallet to continue. | ||
</p> | ||
</> | ||
)} | ||
{isConnected && ( | ||
<h1>Unsupported Network. Switch to sepolia</h1> | ||
)} | ||
<ExternalLinkButton | ||
showExternalIcon={true} | ||
target="_blank" | ||
href={`${ADMIN_URL}`} | ||
> | ||
Continue To Topic List | ||
</ExternalLinkButton> | ||
</div>) | ||
} | ||
|
||
</> | ||
|
||
); | ||
}; | ||
|
||
export default Landing; |
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