forked from forbole/xion-staking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: - add governance and staking routes - add basic header nav - add governance page component * wip: - add nav - connect nav state to path - prep gov client * wip: - break govclient into actions - create proposal page - definte/format prop data * wip: mock voting * wip: clean up formatting * wip: add other gov query hooks, create combo query * wip: move staking pool endpoint to api config * wip: update vote progress bar to include other type of votes. Update card and tally components * wip: tweak progress bars. * wip: switch back to xion (using kava for test data) * wip: update file names to follow industry standard best practices. add transaction lifecycle methods. * wip: fix tally status bars. add end date. * feat: add in proposal details. restore network info * chore: clean up loose comment stubs * chore: linting round 1 * chore: linting * feat: add pagination and filtering of props * chore: fix lint build error * feat: voting widget empty state * feat: lift proposal normalize util * feat: complete tallying widget * feat: switch to treasury contract * feat: restore legacy config * fix: remove governance flag in config * fix: remove treasury contract for txs * fix: remove treasury contract from submitVote action * fix: remove all traces of treasury contract * fix: redelgate message --------- Co-authored-by: Justin <[email protected]>
- Loading branch information
1 parent
50d0bb1
commit 6837815
Showing
39 changed files
with
4,280 additions
and
2,699 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 @@ | ||
import type { Metadata } from "next"; | ||
import { Suspense } from "react"; | ||
|
||
import GovernancePage from "@/features/governance/components/GovernancePage"; | ||
|
||
export const metadata: Metadata = { | ||
title: "XION Governance", | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<Suspense> | ||
<GovernancePage /> | ||
</Suspense> | ||
); | ||
} |
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,16 @@ | ||
import type { Metadata } from "next"; | ||
import { Suspense } from "react"; | ||
|
||
import ProposalPage from "@/features/governance/components/ProposalPage"; | ||
|
||
export const metadata: Metadata = { | ||
title: "XION Governance Proposal", | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<Suspense> | ||
<ProposalPage /> | ||
</Suspense> | ||
); | ||
} |
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 @@ | ||
export { default } from "../page"; |
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,51 @@ | ||
import React, { useEffect, useRef, useState } from "react"; | ||
|
||
import InfoIcon from "../../governance/components/InfoIcon"; | ||
|
||
interface TooltipPopoverProps { | ||
content: string; | ||
icon?: React.ReactNode; | ||
} | ||
|
||
export const TooltipPopover: React.FC<TooltipPopoverProps> = ({ | ||
content, | ||
icon = <InfoIcon className="h-4 w-4 cursor-help" />, | ||
}) => { | ||
const [showTooltip, setShowTooltip] = useState(false); | ||
const tooltipRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
const handleClickOutside = (event: MouseEvent) => { | ||
if ( | ||
tooltipRef.current && | ||
!tooltipRef.current.contains(event.target as Node) | ||
) { | ||
setShowTooltip(false); | ||
} | ||
}; | ||
|
||
document.addEventListener("mousedown", handleClickOutside); | ||
|
||
return () => { | ||
document.removeEventListener("mousedown", handleClickOutside); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="relative" ref={tooltipRef}> | ||
<div | ||
onMouseEnter={() => setShowTooltip(true)} | ||
onMouseLeave={() => setShowTooltip(false)} | ||
> | ||
{icon} | ||
</div> | ||
{showTooltip && ( | ||
<div className="absolute bottom-full left-0 mb-2 w-[200px] rounded-2xl bg-[#1a1a1a] shadow"> | ||
<div className="p-4"> | ||
<p className="text-sm text-white">{content}</p> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
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,36 @@ | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
|
||
import type { NavItem } from "@/config"; | ||
|
||
type NavLinkProps = NavItem & { | ||
className?: string; | ||
onClick?: () => void; | ||
}; | ||
|
||
const NavLink: React.FC<NavLinkProps> = ({ | ||
className = "", | ||
href, | ||
isRootLink, | ||
label, | ||
onClick, | ||
}) => { | ||
const pathname = usePathname(); | ||
|
||
const isActive = | ||
pathname.startsWith(href) || (isRootLink && pathname === "/"); | ||
|
||
return ( | ||
<Link | ||
className={`mx-4 text-[16px] text-lg font-bold font-semibold uppercase text-white ${ | ||
isActive ? "border-b-2 border-white" : "" | ||
} ${className}`} | ||
href={href} | ||
onClick={onClick} | ||
> | ||
{label} | ||
</Link> | ||
); | ||
}; | ||
|
||
export default NavLink; |
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,24 @@ | ||
import Link from "next/link"; | ||
|
||
interface BreadCrumbProps { | ||
proposalId: string; | ||
} | ||
|
||
export function BreadCrumbNav({ proposalId }: BreadCrumbProps) { | ||
return ( | ||
<div className="flex flex-row justify-between text-left"> | ||
<div> | ||
<Link | ||
className="font-['Akkurat LL'] text-sm font-normal uppercase leading-tight text-white underline" | ||
href="/governance/" | ||
> | ||
Governance | ||
</Link> | ||
<span className="font-['Akkurat LL'] text-sm font-normal uppercase leading-tight text-white"> | ||
{" "} | ||
> Proposal {proposalId} | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
} |
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,28 @@ | ||
import React from "react"; | ||
|
||
interface ChevronIconProps { | ||
className?: string; | ||
} | ||
|
||
const ChevronIcon: React.FC<ChevronIconProps> = ({ className = "" }) => ( | ||
<svg | ||
className={className} | ||
fill="none" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g id="icon"> | ||
<path | ||
d="M14 8L10 12L14 16" | ||
id="Arrow" | ||
stroke="white" | ||
strokeOpacity="0.4" | ||
strokeWidth="2" | ||
/> | ||
</g> | ||
</svg> | ||
); | ||
|
||
export default ChevronIcon; |
Oops, something went wrong.