Skip to content

Commit

Permalink
chore: adjust ui bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Jan 8, 2025
1 parent ece0f19 commit 80a0a13
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion packages/interface/src/components/BallotOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ export const BallotOverview = ({ title = undefined, pollId }: IBallotOverviewPro

const { asPath } = useRouter();

const showButton = useMemo(() => !asPath.includes("ballot"), [asPath]);
const showButton = useMemo(
() =>
!asPath.includes("ballot") &&
(roundState === ERoundState.VOTING ||
((roundState === ERoundState.TALLYING || roundState === ERoundState.RESULTS) && ballot.published)),
[asPath],
);

return (
<Link
Expand Down
7 changes: 5 additions & 2 deletions packages/interface/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ const Header = ({ navLinks, pollId = "" }: IHeaderProps) => {
}, [theme, setTheme]);

// the URI of round index page looks like: /rounds/:pollId, without anything else, which is the reason why the length is 3
const isRoundIndexPage = useMemo(() => asPath.includes("rounds") && asPath.split("/").length === 3, [asPath]);
const isRoundProjectPage = useMemo(
() => asPath.includes("rounds") && !asPath.includes("applications") && !asPath.includes("ballot"),
[asPath],
);

return (
<header className="dark:border-lighterBlack dark:bg-lightBlack relative z-[100] border-b border-gray-200 bg-white dark:text-white">
Expand All @@ -96,7 +99,7 @@ const Header = ({ navLinks, pollId = "" }: IHeaderProps) => {
<div className="hidden h-full items-center gap-4 overflow-x-auto uppercase md:flex">
{navLinks.map((link) => {
const isActive =
asPath.includes(link.children.toLowerCase()) || (link.children === "Projects" && isRoundIndexPage);
asPath.includes(link.children.toLowerCase()) || (link.children === "Projects" && isRoundProjectPage);

return (
<NavLink key={link.href} href={link.href} isActive={isActive}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const FAQItem = ({ title, description }: IFAQItemProps): JSX.Element => {
return (
<div className="flex w-4/5 flex-col gap-4 border-b border-b-black py-6 sm:w-3/5 dark:border-b-white dark:text-white">
<button className="flex cursor-pointer justify-between" type="button" onClick={openDescription}>
<p className="w-full font-mono text-2xl uppercase sm:w-auto">{title}</p>
<p className="w-full text-left font-mono text-2xl uppercase sm:w-auto">{title}</p>

<Image
alt="arrow-down"
Expand Down

0 comments on commit 80a0a13

Please sign in to comment.