Skip to content

Commit

Permalink
add vote history banner (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 authored Feb 7, 2025
1 parent 048f61e commit 3dc1756
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
9 changes: 3 additions & 6 deletions components/AnnouncementBanners/AnnouncementBannerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function AnnouncementBannerWrapper({

const OuterWrapper = styled.div`
--height: 60px;
height: var(--height);
min-height: var(--height);
background: var(--black);
display: grid;
align-items: center;
Expand All @@ -56,7 +56,7 @@ const InnerWrapper = styled.div`
align-items: center;
width: 100%;
max-width: var(--page-width);
padding-inline: var(--page-padding);
padding: 8px var(--page-padding);
margin-inline: auto;
gap: var(--page-padding);
Expand All @@ -75,10 +75,7 @@ const CloseButton = styled.button`
--icon-height: 15px;
--icon-offset: 12px;
--icon-start-right: var(--page-padding);
--right: calc(var(--icon-start-right) + var(--icon-offset));
position: absolute;
top: calc(var(--height) - var(--icon-height) / 2px);
right: var(--right);
margin-left: auto;
fill: var(--white);
background: transparent;
Expand Down
4 changes: 0 additions & 4 deletions components/AnnouncementBanners/GasRebateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ const Text = styled.p`
font: var(--text-md);
font-size: clamp(0.75rem, calc(0.45rem + 1.6vw), 1rem);
color: var(--white);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
`;

const Link = styled(NextLink)`
Expand Down
35 changes: 35 additions & 0 deletions components/AnnouncementBanners/VoteHistoryBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { mobileAndUnder } from "constant";
import Info from "public/assets/icons/information.svg";
import styled from "styled-components";
import { AnnouncementBannerWrapper } from "./AnnouncementBannerWrapper";

export function VoteHistoryBanner() {
return (
<AnnouncementBannerWrapper localStorageKey="show-vote-history-banner">
<InfoIcon />
<Text>
<strong>Voter history</strong> and interim <strong>vote results</strong>{" "}
during the reveal phase are temporarily not displaying correctly due to
data provider errors from increased activity.
</Text>
</AnnouncementBannerWrapper>
);
}

const InfoIcon = styled(Info)`
--size: 24px;
height: var(--size);
width: var(--size);
color: red;
flex-shrink: 0;
@media ${mobileAndUnder} {
display: none;
}
`;

const Text = styled.p`
font: var(--text-md);
font-size: clamp(0.75rem, calc(0.45rem + 1.6vw), 1rem);
color: var(--white);
`;
2 changes: 2 additions & 0 deletions components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useInitializeVoteTiming } from "hooks";
import { ReactNode } from "react";
import styled from "styled-components";
import { Meta } from "./Meta";
import { VoteHistoryBanner } from "components/AnnouncementBanners/VoteHistoryBanner";

interface Props {
children: ReactNode;
Expand All @@ -21,6 +22,7 @@ export function Layout({ children, title }: Props) {
<Meta title={title} />
<Main>
<GasRebateBanner />
<VoteHistoryBanner />
<ErrorBanner />
<OldDesignatedVotingAccountWarningBanner />
<Header />
Expand Down

0 comments on commit 3dc1756

Please sign in to comment.