Popup free generatoren

This commit is contained in:
Timo Knuth
2026-04-16 19:34:26 +02:00
parent 673eaf7fd3
commit 231a85ffa4
22 changed files with 225 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import { showToast } from '@/components/ui/Toast';
import { cn } from '@/lib/utils';
import { toPng, toSvg, toBlob } from 'html-to-image';
import { trackEvent } from '@/components/PostHogProvider';
import PostDownloadPopup, { shouldShowDownloadPopup } from '@/components/marketing/PostDownloadPopup';
// Brand Colors
const BRAND = {
@@ -54,6 +55,7 @@ export default function BarcodeGeneratorClient() {
const [lineColor, setLineColor] = useState('#000000');
const [frameType, setFrameType] = useState('none');
const [error, setError] = useState<string | null>(null);
const [showPopup, setShowPopup] = useState(false);
const barcodeRef = useRef<HTMLDivElement>(null);
@@ -109,6 +111,7 @@ export default function BarcodeGeneratorClient() {
document.body.removeChild(link);
showToast(`Barcode downloaded as ${extension.toUpperCase()}`, 'success');
if (shouldShowDownloadPopup()) setShowPopup(true);
trackEvent('barcode_downloaded', {
format: format,
extension: extension,
@@ -118,7 +121,6 @@ export default function BarcodeGeneratorClient() {
console.error('Download failed', err);
showToast('Download failed', 'error');
}
};
const copyBarcode = async () => {
if (!barcodeRef.current) return;
@@ -160,6 +162,8 @@ export default function BarcodeGeneratorClient() {
];
return (
<>
<PostDownloadPopup open={showPopup} onClose={() => setShowPopup(false)} />
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
@@ -453,5 +457,6 @@ export default function BarcodeGeneratorClient() {
</Link>
</div>
</div>
</>
);
}