Skip to content

Commit 753bf78

Browse files
authored
visual fixes (#58)
1 parent effb92e commit 753bf78

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

src/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import axios from 'axios';
33
const instance = axios.create({
44
baseURL: import.meta.env.VITE_BASE_URL
55
? import.meta.env.VITE_BASE_URL
6-
: // : 'http://127.0.0.1:3000',
7-
'https://points-api.illinoiswcs.org',
6+
: 'http://127.0.0.1:3000',
7+
// 'https://points-api.illinoiswcs.org',
88
withCredentials: true
99
});
1010

src/pages/Events/EventQRCode.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* eslint-disable @typescript-eslint/restrict-template-expressions */
22
import React, { useRef } from 'react';
33
import { QRCodeSVG } from 'qrcode.react';
4-
import { Button } from '@chakra-ui/react';
4+
import { Button, HStack } from '@chakra-ui/react';
5+
import { FiDownload } from 'react-icons/fi';
56

67
interface EventQRCodeProps {
78
eventKey: string;
@@ -37,8 +38,8 @@ const EventQRCode: React.FC<EventQRCodeProps> = ({
3738
// set attributes on the cloned SVG
3839
clonedSvg.setAttribute('viewBox', `0 0 ${size} ${size}`);
3940
clonedSvg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
40-
clonedSvg.setAttribute('width', `${size}px`); // Add px unit
41-
clonedSvg.setAttribute('height', `${size}px`); // Add px unit
41+
clonedSvg.setAttribute('width', `${size}px`);
42+
clonedSvg.setAttribute('height', `${size}px`);
4243

4344
// add style to force size
4445
clonedSvg.style.width = `${size}px`;
@@ -136,17 +137,19 @@ const EventQRCode: React.FC<EventQRCodeProps> = ({
136137
fgColor={color}
137138
bgColor={inNotification ? '#d1fae5' : '#ffffff'}
138139
level="H"
139-
title={`QR Code for event ${eventKey}`}
140+
title={`QR code for event key ${eventKey}`}
140141
/>
141142
</div>
142-
<div style={{ marginTop: '10px' }}>
143-
<Button onClick={downloadPNG} mr={3} mt={5}>
144-
Download as PNG
143+
<HStack justifyContent={'space-between'} mt={8}>
144+
<Button onClick={downloadPNG}>
145+
<FiDownload />
146+
&nbsp;Save as PNG
145147
</Button>
146-
<Button onClick={downloadSVG} mt={5}>
147-
Download as SVG
148+
<Button onClick={downloadSVG}>
149+
<FiDownload />
150+
&nbsp;Save as SVG
148151
</Button>
149-
</div>
152+
</HStack>
150153
</div>
151154
);
152155
};

src/pages/Events/QRCodeModal/index.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ const QRCodeModal = (props: QRCodeModalProps): React.ReactElement => {
2828
return (
2929
<Modal isOpen={open} onClose={clearAndToggle} isCentered>
3030
<ModalOverlay />
31-
<ModalContent p="10" minW="30%">
31+
<ModalContent p="10">
3232
<ModalCloseButton />
3333
<ModalHeader>
34-
<HStack>
35-
<Box>
36-
{event?.name} QR Code | {event?.key}
37-
</Box>
34+
<Box>{event?.name} QR Code</Box>
35+
</ModalHeader>
36+
<ModalBody>
37+
<HStack justifyContent="space-between" mb={4}>
38+
<Box>Event Key: {event?.key}</Box>
3839
<Box>
3940
<Switch
40-
size="lg"
41+
size="md"
4142
onChange={() => {
4243
handleToggleColor();
4344
}}
@@ -50,13 +51,11 @@ const QRCodeModal = (props: QRCodeModalProps): React.ReactElement => {
5051
/>
5152
</Box>
5253
</HStack>
53-
</ModalHeader>
54-
<ModalBody>
5554
{event?.key ? (
5655
<Box>
5756
<EventQRCode
5857
eventKey={event?.key}
59-
size={256}
58+
size={320}
6059
color={isToggled ? '#d4696a' : '#000000'}
6160
/>
6261
</Box>

src/pages/Events/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const Events = (): React.ReactElement => {
156156
}}
157157
mb="5"
158158
>
159-
Show QR code
159+
Show QR Code
160160
</Button>
161161
</Box>
162162
)}

0 commit comments

Comments
 (0)