refactor(register): Switch to showing qr code
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build latest image / build-container (push) Successful in 45s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build latest image / build-container (push) Successful in 45s
				
			This commit is contained in:
		@@ -62,12 +62,18 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	function textToBase64Barcode(text: string, is_qrcode: boolean) {
 | 
						function textToBase64Barcode(text: string, is_qrcode: boolean) {
 | 
				
			||||||
		const canvas = document.createElement('canvas');
 | 
							const canvas = document.createElement('canvas');
 | 
				
			||||||
		let bcid = 'code128';
 | 
					 | 
				
			||||||
		if (is_qrcode) {
 | 
							if (is_qrcode) {
 | 
				
			||||||
			bcid = 'qrcode';
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
			bwipjs.toCanvas(canvas, {
 | 
								bwipjs.toCanvas(canvas, {
 | 
				
			||||||
			bcid,
 | 
									bcid: "qrcode",
 | 
				
			||||||
 | 
									text: `${text}`,
 | 
				
			||||||
 | 
									scale: 10,
 | 
				
			||||||
 | 
									includetext: false,
 | 
				
			||||||
 | 
									textxalign: 'center',
 | 
				
			||||||
 | 
									backgroundcolor: 'ffffff',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								bwipjs.toCanvas(canvas, {
 | 
				
			||||||
 | 
									bcid: "code128",
 | 
				
			||||||
				text: `${text}`,
 | 
									text: `${text}`,
 | 
				
			||||||
				scale: 10,
 | 
									scale: 10,
 | 
				
			||||||
				includetext: true,
 | 
									includetext: true,
 | 
				
			||||||
@@ -75,6 +81,7 @@
 | 
				
			|||||||
				backgroundcolor: 'ffffff',
 | 
									backgroundcolor: 'ffffff',
 | 
				
			||||||
				height: 10
 | 
									height: 10
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return canvas.toDataURL('image/png');
 | 
							return canvas.toDataURL('image/png');
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -306,10 +313,13 @@
 | 
				
			|||||||
					</div>
 | 
										</div>
 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
					<div class="mb-2 text-center">
 | 
										<div class="mb-2 text-center">
 | 
				
			||||||
 | 
											<h3 class="text-2xl font-semibold dark:text-white">
 | 
				
			||||||
 | 
												Hier direkt den Selfservice öffnen und deine Rundenzeiten anzeigen:
 | 
				
			||||||
 | 
											</h3>
 | 
				
			||||||
						<img
 | 
											<img
 | 
				
			||||||
							class="w-full md:w-auto mb-2 mx-auto bg-white p-4"
 | 
												class="w-full md:w-auto mb-2 mx-auto bg-white p-4"
 | 
				
			||||||
							alt="runner id"
 | 
												alt="runner id"
 | 
				
			||||||
							src={textToBase64Barcode(response.id.toString(), false)}
 | 
												src={textToBase64Barcode(response.selfserviceLink.toString(), true)}
 | 
				
			||||||
						/>
 | 
											/>
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user