Skip to content

Commit

Permalink
switch ticket qr to scotts app
Browse files Browse the repository at this point in the history
  • Loading branch information
lyoshenka committed Apr 2, 2024
1 parent 62d5d2a commit 159ae84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit 159ae84

Please sign in to comment.