diff --git a/package-lock.json b/package-lock.json
index d69fe4a..f6834cd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,9 @@
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
+ },
+ "devDependencies": {
+ "tailwindcss": "^3.3.3"
}
},
"node_modules/@aashutoshrathi/word-wrap": {
diff --git a/package.json b/package.json
index 97b5d58..3ff8e32 100644
--- a/package.json
+++ b/package.json
@@ -34,5 +34,8 @@
"last 1 firefox version",
"last 1 safari version"
]
+ },
+ "devDependencies": {
+ "tailwindcss": "^3.3.3"
}
}
diff --git a/src/App.js b/src/App.js
index 3784575..5f72364 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,23 +1,10 @@
-import logo from './logo.svg';
import './App.css';
+import QrFrontend from './components/QrFrontend';
function App() {
return (
-
-
+
+
);
}
diff --git a/src/components/QrFrontend.js b/src/components/QrFrontend.js
new file mode 100644
index 0000000..05e4867
--- /dev/null
+++ b/src/components/QrFrontend.js
@@ -0,0 +1,74 @@
+import React, { useState } from 'react';
+
+const QrFrontend = () => {
+ const [showText, setShowText] = useState(false);
+ const [qrImage, setQrImage] = useState('');
+ const [inputText, setInputText] = useState('');
+
+ const generateQR = async () => {
+ try {
+ const response = await fetch('http://143.110.177.177:5000/', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({ inputtext: inputText }),
+ });
+
+ if (response.ok) {
+ const data = await response.json();
+ setQrImage(data.qr_image);
+ setShowText(true);
+ } else {
+ console.error('Failed to generate QR code');
+ }
+ } catch (error) {
+ console.error('Error:', error);
+ }
+ };
+
+ return (
+ <>
+
+
QR Code Generator 🔥
+
+ Insert a link below to generate a QR Code
+
+
+
+
+ {showText && (
+ <>
+

+
+ Here is the QR code we generated for you 🚀
+
+ >
+ )}
+
+ >
+ );
+};
+
+export default QrFrontend;
diff --git a/src/index.css b/src/index.css
index ec2585e..3ec2e08 100644
--- a/src/index.css
+++ b/src/index.css
@@ -11,3 +11,6 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
\ No newline at end of file
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..c0958ec
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,11 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: [
+ "./src/**/*.{js,jsx,ts,tsx}",
+ ],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+}
+