Skip to content
Draft
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@chakra-ui/system": "1.11.2",
"@emotion/react": "11.8.2",
"@emotion/styled": "11.8.1",
"@google-pay/save-button-react": "^1.0.0",
"@happykit/analytics": "1.0.1",
"@sendgrid/mail": "7.6.2",
"@sentry/cli": "1.74.2",
Expand Down
17 changes: 17 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/components/Nav/SignedInMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ const SignedInMenu = () => {
<MenuList>
<NextLink href="/panel"><a><MenuItem>User Panel</MenuItem></a></NextLink>
{user.user_metadata.admin && (
<>
<NextLink href="/admin"><a><MenuItem>Admin Panel</MenuItem></a></NextLink>
<NextLink href="/admin/terminal"><a><MenuItem>Stripe Terminal</MenuItem></a></NextLink>
</>
<NextLink href="/admin"><a><MenuItem>Admin Panel</MenuItem></a></NextLink>
)}
{/* eslint-disable-next-line @next/next/no-html-link-for-pages */}
<a href="/api/auth/logout"><MenuItem onClick={signout}>Sign out</MenuItem></a>
Expand Down
25 changes: 25 additions & 0 deletions src/components/UserPanel/GooglePayBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import SaveToGooglePay from '@google-pay/save-button-react';

interface Props {
ticketJwt: string;
}

const GooglePayBtn = ({ ticketJwt }: Props) => {
const jwt = {
ticketHolderName: 'Nick',
ticketNumber: 'ticketIdHere',
id: 'prom.ticketIdHere',
classId: 'prom.classIdHere',
state: 'ACTIVE',
barcode: {
type: 'QR_CODE',
value: ticketJwt,
alternateText: 'Nick - ticketId',
},
} as const;
return (
<SaveToGooglePay jwt={jwt} />
);
};

export default GooglePayBtn;
2 changes: 2 additions & 0 deletions src/components/UserPanel/HasTicket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Flex, Heading } from '@chakra-ui/react';
import { useTicket } from 'util/ticketContext';
import MoreInfo from './MoreInfo';
import QR from './QR';
import GooglePayBtn from './GooglePayBtn';

const HasTicket: React.FC = () => {
const { ticket } = useTicket();
Expand All @@ -10,6 +11,7 @@ const HasTicket: React.FC = () => {
<Flex direction="column" align="center" justify="center" m={5}>
<Heading as="h2" my={3} textAlign="center">Your Ticket</Heading>
<QR jwt={ticket.jwt} />
<GooglePayBtn ticketJwt={ticket.jwt} />
</Flex>
<MoreInfo />
</>
Expand Down