Skip to content

Commit

Permalink
Impove QR code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
gorbatiukcom committed Jan 24, 2024
1 parent 2236635 commit 568ffed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Binary file added public/images/logo_sm_x4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions src/app/qr/qr.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
"use client";

import { Box, Flex, Input, Switch } from "@chakra-ui/react";
import styled from "@emotion/styled";
import QRCodeStyling from "qr-code-styling";
import { useEffect, useRef, useState } from "react";

const StyledContainer = styled(Flex)`
canvas {
max-width: 400px;
margin: 0 auto;
}
`;

export const QR = () => {
const ref = useRef(null as any);
const [link, setLink] = useState("https://admiralinterior.com");
const [logoUrl, setLogoUrl] = useState("https://admiralinterior.com/images/logo_sm.svg");
const [size, setSize] = useState(400);
const [qrSize, setQrSize] = useState(400);
const [size, setSize] = useState(1600);
const [qrSize, setQrSize] = useState(1600);
const [withLogo, setWithLogo] = useState(false);
const changeSize = (newSize: number) => {
if (typeof newSize === "number") {
Expand Down Expand Up @@ -40,7 +48,7 @@ export const QR = () => {
}, [link, withLogo, qrSize, logoUrl]);

return (
<Flex
<StyledContainer
flexDirection="column"
justifyContent="flex-start"
px={5}
Expand Down Expand Up @@ -79,7 +87,7 @@ export const QR = () => {
/>
) : null}
<Box id="test" ref={ref} />
</Flex>
</StyledContainer>
);
};

Expand Down

0 comments on commit 568ffed

Please sign in to comment.