Skip to content

Commit 34253fc

Browse files
youssef.ibrahim3youssef.ibrahim3
authored andcommitted
Add QR code component and page templates
1 parent 324b597 commit 34253fc

File tree

6 files changed

+83
-2
lines changed

6 files changed

+83
-2
lines changed

shatter-web/package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shatter-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@tailwindcss/vite": "^4.1.16",
14+
"qrcode.react": "^4.2.0",
1415
"react": "^19.1.1",
1516
"react-dom": "^19.1.1",
1617
"tailwindcss": "^4.1.16"

shatter-web/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { useState } from "react";
2-
32
import TestComponent from "./components/TestComponent.tsx";
4-
3+
import QRCodeDisplay from "./components/QRCodeDisplay.tsx";
54
function App() {
65
return (
76
<>
87
<div className="bg-red-500">
98
<p>This is the first component</p>
109
<TestComponent />
10+
<QRCodeDisplay />
1111
</div>
1212
</>
1313
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { useState } from "react";
2+
import { QRCodeSVG } from 'qrcode.react';
3+
4+
function QRCodeDisplay() {
5+
return (
6+
<>
7+
<div className="bg-amber-200">
8+
<QRCodeSVG
9+
value={"ABCD1234"}
10+
title={"ABCD1234"}
11+
size={128}
12+
bgColor={"#ffffff"}
13+
fgColor={"#000000"}
14+
level={"L"}
15+
imageSettings={{
16+
src: "https://static.zpao.com/favicon.png",
17+
x: undefined,
18+
y: undefined,
19+
height: 24,
20+
width: 24,
21+
opacity: 1,
22+
excavate: true,
23+
}}
24+
/>
25+
</div>
26+
</>
27+
);
28+
}
29+
30+
export default QRCodeDisplay;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
3+
import './index.css'
4+
import App from '../App.tsx'
5+
6+
//this is just copypasted from main, changes will be made
7+
8+
createRoot(document.getElementById('root')!).render(
9+
<StrictMode>
10+
<App />
11+
</StrictMode>,
12+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { useState } from "react";
2+
3+
import TestComponent from "../components/TestComponent.tsx";
4+
5+
function Dashboard() {
6+
return (
7+
<>
8+
<div className="bg-blue-100">
9+
<p>Event Dashboard Coming Soon.</p>
10+
<TestComponent />
11+
</div>
12+
</>
13+
);
14+
}
15+
16+
export default Dashboard;

0 commit comments

Comments
 (0)