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

switch ticket qr to scotts app #14

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
2 changes: 1 addition & 1 deletion front-end/src/components/Tickets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default observer(() => {

{tickets.map(t =>
<React.Fragment key={t.purchase_id}>
<Ticket name={undefined} ticketType='adult' purchaseId={t.purchase_id} />
<Ticket name={undefined} ticketType='adult' ownedByAccountId={t.owned_by_account_id} />
<Spacer size={24} />
</React.Fragment>)}

Expand Down
7 changes: 3 additions & 4 deletions front-end/src/components/tickets/Ticket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { QRCodeSVG } from 'qrcode.react'
import React from 'react'

import { Tables } from '../../../../back-end/types/db-types'
import env from '../../env'
import { useObservableClass } from '../../mobx/hooks'
import { observer } from '../../mobx/misc'

type Props = {
name: string | undefined,
ticketType: 'adult' | 'child' | undefined,
purchaseId: Tables['purchase']['purchase_id']
ownedByAccountId: Tables['purchase']['owned_by_account_id']
}

const TICKET_WIDTH = 750
Expand Down Expand Up @@ -84,7 +83,7 @@ export default observer((props: Props) => {

<div onClick={state.toggleQRCodeZoom} style={state.qrCodeZoom ? QR_CODE_CONTAINER_ZOOMED_STYLE : QR_CODE_CONTAINER_STYLE}>
<QRCodeSVG
value={`${env.BACK_END_ORIGIN}/purchase/check-in/${props.purchaseId}`}
value={`${props.ownedByAccountId}`}
style={{ width: '100%', height: '100%', maxWidth: '80vw', maxHeight: '80vh' }}
/>
</div>
Expand Down Expand Up @@ -113,4 +112,4 @@ const QR_CODE_CONTAINER_ZOOMED_STYLE = {
height: '100vh',
background: 'white',
zIndex: 1000
} as const
} as const
Loading