-
Notifications
You must be signed in to change notification settings - Fork 7
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
support a large top margin on bmd_paper_ballot #3936
Conversation
759e1b3
to
b072678
Compare
b072678
to
ec0f083
Compare
libs/ui/src/bmd_paper_ballot.tsx
Outdated
@@ -275,7 +281,10 @@ export function BmdPaperBallot({ | |||
|
|||
return withPrintTheme( | |||
<Ballot aria-hidden> | |||
<Header> | |||
<Header | |||
className={largeTopMargin ? 'large-top-margin' : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to use a class here vs just passing a prop to the Header
styled component? (that's the pattern I usually see in our code for parameterized styling)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about conditional styling with the styled-components
lib!
id: 'printBallot', | ||
src: (context, event) => { | ||
// Need to hint to Typescript that we want the 'VOTER_INITIATED_PRINT' event in our union type of events | ||
if ('pdfData' in event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do assert(event.type === 'VOTER_INITIATED_PRINT')
to make this a bit more concise. Our assert
function will hint the type checker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
border-bottom: 0.2em solid #000; | ||
margin-top: ${(p) => (p.largeTopMargin ? '1.75in' : undefined)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the right way to fallback, but I explicitly don't want to overwrite margin with 0
in the case where largeTopMargin
is falsy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works, then seems fine to me!
95485da
to
d0be2c1
Compare
target: 'scanning', | ||
}, | ||
}, | ||
pollPaperStatus(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nb. pollPaperStatus() is still needed here to inform the top-level handler for jammed
.
d0be2c1
to
19d6b35
Compare
19d6b35
to
46c286e
Compare
Overview
#3872
paperInOutput
would return true in the middle of a print, causing the paper to be pulled into the scanner before printing was done.Demo Video or Screenshot
Before
After
Testing Plan
Checklist