feat: guest login qr code

This commit is contained in:
Tristan Yang
2023-02-15 09:56:12 +08:00
parent 99c14d1bac
commit e5c14e9234
4 changed files with 14 additions and 9 deletions
+7 -6
View File
@@ -3,15 +3,16 @@ import { QRCodeCanvas } from 'qrcode.react';
import { useAppSelector } from '../../app/store';
type Props = {
link: string
link: string,
size?: number
}
const QRCode = ({ link }: Props) => {
const QRCode = ({ link, size = 512 }: Props) => {
const logo = useAppSelector(store => store.server.logo);
return (
<QRCodeCanvas value={link}
className="rounded border border-solid border-gray-200 dark:border-gray-100 p-1 !w-full !h-full"
size={512}
className="rounded border border-solid border-gray-200 dark:border-gray-500 p-1 !w-full !h-full"
size={size}
bgColor={"#fff"}
fgColor={"#22ccee"}
level={"L"}
@@ -20,8 +21,8 @@ const QRCode = ({ link }: Props) => {
src: logo,
x: undefined,
y: undefined,
height: 80,
width: 80,
height: size / 6,
width: size / 6,
excavate: true,
}} />
);