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

Fix some console warnings that appear in the browser #440

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions components/global/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ interface ButtonAnchorProps
size?: Size
}

export const ButtonAnchor = ({ children, kind = 'secondary', size = 'normal', ...props }: ButtonAnchorProps) => (
<StyledButtonAnchor kind={kind} size={size} {...props}>
{children}
</StyledButtonAnchor>
export const ButtonAnchor = React.forwardRef<HTMLAnchorElement, ButtonAnchorProps>(
({ children, kind = 'secondary', size = 'normal', ...props }, ref) => (
<StyledButtonAnchor ref={ref} kind={kind} size={size} {...props}>
{children}
</StyledButtonAnchor>
),
)
3 changes: 1 addition & 2 deletions components/global/Nav/Nav.context.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useContext } from 'react'
import { v4 as uuid } from 'uuid'

type State = { expanded: boolean; id: string }
type NavigationAction = 'toggle' | 'open' | 'close'
Expand All @@ -20,7 +19,7 @@ function navigationReducer(state: State, action: NavigationAction) {
}

const NavigationProvider = ({ children }) => {
const componentId = React.useRef(`nav-${uuid()}`)
const componentId = React.useRef(`nav-component-id`)
const [state, dispatch] = React.useReducer(navigationReducer, { expanded: false, id: componentId.current })

return (
Expand Down
14 changes: 9 additions & 5 deletions pages/vote/landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PRIVACY_ACCEPTED } from '../../components/Voting/VoteConst'
import Cookies from 'js-cookie'
import { StyledButton, StyledHeader, StyledIntro, StyledLandingContainer } from '../../components/Voting/landing.styled'
import { format } from 'date-fns'
import Link from 'next/link'

type VoteLandingProps = {
instance: string
Expand Down Expand Up @@ -36,18 +37,21 @@ export default function VoteLanding({ instance, votingFinished }: VoteLandingPro
"It's a draw!".
</Text>
<Text>
Once you've made your selection, two new options will appear. You can continue to vote on the options presented
for as long as you like - every vote will count towards formulating the best agenda possible for this year.
Once you've made your selection, two new options will appear. You can continue to vote on the options
presented for as long as you like - every vote will count towards formulating the best agenda possible for
this year.
</Text>
<Text>
Voting closes on {votingFinished}, so you have between now and then to have your say. You can leave and come back
any time until the closing day to get your votes in.
Voting closes on {votingFinished}, so you have between now and then to have your say. You can leave and come
back any time until the closing day to get your votes in.
</Text>
<Text>Happy Voting!</Text>

<Text>
By selecting <em>'{BUTTON_LABEL}'</em> I have read and accepted the{' '}
<a href="/privacy">DDDPerth Privacy statement</a>.
<Link href="/privacy">
<a>DDDPerth Privacy statement</a>.
</Link>
</Text>

<StyledButton kind="primary" onClick={onClickHandler}>
Expand Down