Skip to content

Commit

Permalink
Different QR Code generator
Browse files Browse the repository at this point in the history
  • Loading branch information
michielpost committed May 25, 2024
1 parent a8c0410 commit a75b789
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/aoWebWallet/Pages/ReceivePage.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/receive/{address}"
@using Blazor.QrCodeGen
@using ZXing;
@using aoWebWallet.Models
@using MudExtensions
@inherits MvvmComponentBase<ReceiveViewModel>
@inject GatewayUrlHelper UrlHelper;
@inject IDialogService DialogService
Expand Down Expand Up @@ -43,7 +44,7 @@
</MudStack>

<MudText Typo="Typo.h4">Scan QR</MudText>
<QrCode CanvasId="@Address" Text="@BindingContext.QrCode" Options="_options" />
<MudBarcode Value="@BindingContext.QrCode" Width="200" Height="200" ForceHeight="1" BarcodeFormat="BarcodeFormat.QR_CODE" Clickable="false" />
</MudStack>
<br />
@if (BindingContext.Token != null)
Expand All @@ -69,8 +70,6 @@

public string detailUrl => $"/wallet/{Address}";

private QrCodeOptions _options = new QrCodeOptions() { ColorLight = System.Drawing.Color.White };


protected override async Task OnParametersSetAsync()
{
Expand Down
7 changes: 4 additions & 3 deletions src/aoWebWallet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
using aoww.Services.Models;
using aoWebWallet.Models;
using ArweaveAO.Models;
using Blazor.QrCodeGen;
using Microsoft.JSInterop;
using MudExtensions.Services;

namespace aoWebWallet
{
Expand Down Expand Up @@ -91,9 +90,11 @@ private static void ConfigureServices(IServiceCollection services, string baseAd
//Set Version
Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;

services.AddTransient(sp => new ModuleCreator(sp.GetRequiredService<IJSRuntime>()));
services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseAddress) });

services.AddMudExtensions();


//Services
services.AddScoped<TokenDataService>();
services.AddScoped<StorageService>();
Expand Down
2 changes: 1 addition & 1 deletion src/aoWebWallet/ViewModels/ReceiveViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public string QrCode
{
get
{
return $"{Address}";
//return $"{Address}";

if (string.IsNullOrEmpty(TokenId))
return $"ao:{Address}";
Expand Down
2 changes: 1 addition & 1 deletion src/aoWebWallet/aoWebWallet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<ItemGroup>
<PackageReference Include="ArweaveAO" Version="0.0.3" />
<PackageReference Include="ArweaveBlazor" Version="0.0.8" />
<PackageReference Include="Blazor.QrCodeGen" Version="1.1.3" />
<PackageReference Include="ClipLazor" Version="2.1.1" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="6.9.2" />
<PackageReference Include="MudBlazor" Version="6.19.1" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="BlazorWasmPreRendering.Build" Version="4.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/aoWebWallet/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<meta name="twitter:title" content="aoWebWallet. track your AO Arweave tokens" />
<meta name="twitter:description" content="Manage your digital assets securely with the AO Web Wallet. Easily send, receive, and track your AO Arweave tokens holdings." />
<meta name="twitter:image" content="https://aoww.net/images/social.jpg" />
<link href="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet" />
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// MIT License
Expand Down Expand Up @@ -110,8 +111,7 @@ <h4 style="color:white;opacity: 0.55; margin-top:20px;">loading...</h4>
<script type="module">
import { minidenticonSvg } from 'https://cdn.jsdelivr.net/npm/[email protected]/minidenticons.min.js'
</script>
<script src="./_content/Blazor.QrCodeGen/qrcode.min.js"></script>
<script type="module" src="./_content/Blazor.QrCodeGen/qrcodeInterop.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
</body>

</html>

0 comments on commit a75b789

Please sign in to comment.