Skip to content

Commit

Permalink
Merge pull request #7 from michielpost/feature/milestone2
Browse files Browse the repository at this point in the history
Show and read QR code
  • Loading branch information
michielpost authored May 31, 2024
2 parents 58cbd58 + e56def7 commit 0c655f9
Show file tree
Hide file tree
Showing 48 changed files with 856 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
env:
APP_VERSION: ${{ env.GITHUB_REF_SLUG }}-$(git rev-parse --short "$GITHUB_SHA")
- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build with dotnet
Expand Down
Binary file added assets/aoww-logo-3840.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/aowwdotnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/spiral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/spiral2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/aoWebWallet.Tests/aoWebWallet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/aoWebWallet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{89AC47DF
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aoww.Services.Tests", "aoww.Services.Tests\aoww.Services.Tests.csproj", "{322F4807-05CF-431D-B400-7420E1B29936}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aoWebWallet.Tests", "aoWebWallet.Tests\aoWebWallet.Tests.csproj", "{12E9E40E-96D1-4501-A9A4-EBE4D4F43D8D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aoWebWallet.Tests", "aoWebWallet.Tests\aoWebWallet.Tests.csproj", "{12E9E40E-96D1-4501-A9A4-EBE4D4F43D8D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
15 changes: 15 additions & 0 deletions src/aoWebWallet/Models/ActionParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@ public static AoAction CreateFromQueryString(string qstring)
return action;
}

public static AoAction CreateForTokenTransaction(string recipient, string tokenId)
{
return new AoAction
{
Params = new List<ActionParam>
{
new ActionParam { Key= "Target", ParamType = ActionParamType.Target, Value= tokenId },
new ActionParam { Key= "Action", ParamType = ActionParamType.Filled, Value= "Transfer" },
new ActionParam { Key= "Recipient", ParamType = ActionParamType.Filled, Value = recipient },
new ActionParam { Key= "Quantity", ParamType = ActionParamType.Balance, Args = new List<string> { tokenId } }
}

};
}

public static AoAction CreateForTokenTransaction(string tokenId)
{
return new AoAction
Expand Down
32 changes: 14 additions & 18 deletions src/aoWebWallet/Pages/About.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

<PageTitle>About - @Program.PageTitlePostFix</PageTitle>

<MudContainer Class="mt-16 px-8" MaxWidth="MaxWidth.ExtraExtraLarge">
<MudText Typo="Typo.h5">ao Web Wallet</MudText>
<MudContainer Class="mt-2 px-8" MaxWidth="MaxWidth.ExtraExtraLarge">
<MudBreadcrumbs Class="breadcrumbs-aoww" Items="_items"></MudBreadcrumbs>

<MudPaper Elevation="2" Class="pa-4">
<MudText Typo="Typo.h5">ao Web Wallet</MudText>
</MudPaper>

<MudStack>
<MudItem xs="12" md="6">
Expand All @@ -13,22 +17,7 @@
<MudText Align="Align.Left">Created for the Hack the Weave hackathon by <a href="https://twitter.com/michielpostnl" target="_blank" style="text-decoration-line:underline">Michiel Post</a> and <a href="https://twitter.com/2n1u0" target="_blank" style="text-decoration-line:underline">Nuno Lopes</a></MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" md="6">
<MudText Typo="Typo.h6" GutterBottom="true">Features</MudText>
<MudPaper Width="100%">
<MudList>
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Open Source" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Add ArConnect Wallets" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Create new wallets or import a wallet.json file" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="View balances of a wallet" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="View all transactions for a wallet" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Send tokens" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Add custom tokens" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="View all transactions for a token" />
<MudListItem Icon="@Icons.Material.Filled.Star" Text="Dark and Light theme" />
</MudList>
</MudPaper>
</MudItem>

<MudItem xs="12" md="6">
<MudPaper Elevation="2" Class="pa-4">
<MudText Align="MudBlazor.Align.Left">
Expand Down Expand Up @@ -56,6 +45,13 @@
</MudContainer>

@code {

private List<BreadcrumbItem> _items = new List<BreadcrumbItem>
{
new BreadcrumbItem("Home", href: "/"),
new BreadcrumbItem("About", href: null, disabled: true)
};

string? versionHash = Program.GetVersionHash();
private string result = DateTimeOffset.UtcNow.ToString();

Expand Down
12 changes: 9 additions & 3 deletions src/aoWebWallet/Pages/ActionPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<PageTitle>@Program.PageTitlePostFix</PageTitle>


<MudContainer Class="mt-16 px-8" MaxWidth="MaxWidth.False">
<MudText Typo="Typo.h5">New transaction</MudText>
<MudContainer Class="mt-2 px-8" MaxWidth="MaxWidth.False">
<MudBreadcrumbs Class="breadcrumbs-aoww mb-4" Items="_items"></MudBreadcrumbs>

<MudStack>
@if (BindingContext.WalletList.Data != null)
Expand Down Expand Up @@ -59,7 +59,7 @@

@if (!readOnly && !string.IsNullOrEmpty(selectedWallet))
{
<MudButton Color="Color.Primary" Variant="Variant.Filled" FullWidth="true" OnClick="Preview" Class="mt-8">Preview</MudButton>
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="Preview" Class="mt-8">Preview</MudButton>
<MudText Color="Color.Error">@validation</MudText>
}
else if (!started && !string.IsNullOrEmpty(selectedWallet) && string.IsNullOrEmpty(transactionService.LastTransaction.Data?.Id))
Expand Down Expand Up @@ -119,6 +119,12 @@
private bool readOnly = false;
private bool started = false;

private List<BreadcrumbItem> _items = new List<BreadcrumbItem>
{
new BreadcrumbItem("Home", href: "/"),
new BreadcrumbItem("New transaction", href: null, disabled: true)
};


private async void Preview()
{
Expand Down
54 changes: 33 additions & 21 deletions src/aoWebWallet/Pages/AddressBook.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
<PageTitle>Address Book - @Program.PageTitlePostFix</PageTitle>


<MudContainer Class="mt-16 px-8" MaxWidth="MaxWidth.False">
<MudContainer Class="mt-2 px-8" MaxWidth="MaxWidth.False">
<MudBreadcrumbs Class="breadcrumbs-aoww" Items="_items"></MudBreadcrumbs>


<MudText Typo="Typo.h5">Address Book</MudText>

<MudContainer Width="100%" Class="d-flex justify-end mb-4 pr-3 d-max-w-100">
@if (BindingContext.WalletList.Data != null)
{
<MudTooltip Text="Add contact" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add contact" Size="Size.Large" OnClick="OpenDialog"></MudIconButton>
</MudTooltip>
}
<MudContainer style="width:100%; min-width: 100%; max-width: 100%;" Class="d-flex justify-end mb-4 pr-3">
@if (BindingContext.WalletList.Data != null)
{
<MudTooltip Text="Add contact" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add contact" Size="Size.Large" OnClick="OpenDialog"></MudIconButton>
</MudTooltip>
}
</MudContainer>

<MudStack>
Expand All @@ -29,11 +27,16 @@
{
foreach (var wallet in BindingContext.WalletList.Data.Where(x => x.IsReadOnly))
{
string detailUrl = $"wallet/{wallet.Address}";
string detailUrl = $"/wallet/{wallet.Address}";
<MudPaper Class="pa-4">
<MudStack Row="true">
<WalletAvatar Address="@wallet.Address" />

<div Class="relative">
<WalletAvatar Address="@wallet.Address" />
@if(BindingContext.ProcessesDataList?.Data?.Where(x => x.Data?.Address == wallet.Address && (x.Data?.Processes?.Any() ?? false)).Any() ?? false)
{
<MudChip Class="aos-chip" Variant="Variant.Outlined" Color="Color.Dark">AOS</MudChip>
}
</div>
<MudStack Class="d-overflow-hidden" Justify="Justify.Center" Spacing="0">
<div Class="d-custom-2">
<MudLink Class="KodeMono tx-wrap" Href="@detailUrl" Typo="Typo.h6">
Expand All @@ -45,14 +48,17 @@
<MudText Typo="Typo.body2">@wallet.Name</MudText>
</div>
</MudStack>

<MudSpacer />
@if(BindingContext.ProcessesDataList?.Data?.Where(x => x.Data?.Address == wallet.Address && (x.Data?.Processes?.Any() ?? false)).Any() ?? false)
{
<MudChip>AOS</MudChip>
}

<MudIconButton Class="delete-address" Icon="@Icons.Material.Filled.Edit" aria-label="edit" OnClick="() => { EditWallet(wallet); }"></MudIconButton>
<MudIconButton Class="delete-address" Icon="@Icons.Material.Filled.Delete" aria-label="delete" OnClick="() => { DeleteWallet(wallet); }"></MudIconButton>
<MudMenu Icon="@Icons.Material.Filled.MoreVert">
<MudMenuItem>
<MudButton Class="delete-address" StartIcon="@Icons.Material.Filled.Edit" aria-label="edit" OnClick="() => { EditWallet(wallet); }">Edit</MudButton>
</MudMenuItem>
<MudMenuItem>
<MudButton Class="delete-address" StartIcon="@Icons.Material.Filled.Delete" aria-label="delete" OnClick="() => { DeleteWallet(wallet); }">Delete</MudButton>
</MudMenuItem>
</MudMenu>
</MudStack>
</MudPaper>
}
Expand Down Expand Up @@ -81,6 +87,12 @@

@code
{
private List<BreadcrumbItem> _items = new List<BreadcrumbItem>
{
new BreadcrumbItem("Home", href: "/"),
new BreadcrumbItem("Address book", href: null, disabled: true)
};

private void OpenDialog()
{
var tempWallet = new Wallet()
Expand Down Expand Up @@ -123,5 +135,5 @@
StateHasChanged();
}


}
19 changes: 14 additions & 5 deletions src/aoWebWallet/Pages/Apps.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@

<PageTitle>Friends of aoWebWallet - @Program.PageTitlePostFix</PageTitle>

<MudContainer Class="mt-16 px-8" MaxWidth="MaxWidth.ExtraExtraLarge">
<MudText Typo="Typo.h5">Apps</MudText>
<MudText Class="mb-8">A list of friends of aoWebWallet. Use your tokens and explore the ao ecosystem.</MudText>
<MudContainer Class="mt-2 px-8" MaxWidth="MaxWidth.ExtraExtraLarge">
<MudBreadcrumbs Class="breadcrumbs-aoww" Items="_items"></MudBreadcrumbs>

<MudGrid>
<MudPaper Elevation="2" Class="pa-6">
<MudText Class="mb-8">A list of friends of aoWebWallet. Use your tokens and explore the ao ecosystem.</MudText>
</MudPaper>

<MudGrid Class="mt-2">
<AppListItem Name="ArSwap"
Link="https://arswap.org"
Logo="https://pbs.twimg.com/profile_images/1778816003259985920/HpnZQDK6_400x400.jpg"
Expand Down Expand Up @@ -37,4 +40,10 @@
</MudGrid>
</MudContainer>


@code{
private List<BreadcrumbItem> _items = new List<BreadcrumbItem>
{
new BreadcrumbItem("Home", href: "/"),
new BreadcrumbItem("Apps", href: null, disabled: true)
};
}
14 changes: 12 additions & 2 deletions src/aoWebWallet/Pages/MvvmComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public abstract class MvvmComponentBase<T> : ComponentBase, IDisposable where T

protected override void OnInitialized()
{
foreach(var obj in ObjWatch)
//BindingContext.PropertyChanged += BindingContext_PropertyChanged;

foreach (var obj in ObjWatch)
{
obj.PropertyChanged += ObjWatch_PropertyChanged;
}
Expand All @@ -27,7 +29,13 @@ protected override void OnInitialized()

base.OnInitialized();
}


//private void BindingContext_PropertyChanged(object? sender, PropertyChangedEventArgs e)
//{
// Console.WriteLine("Changed! " + e.PropertyName);
// this.StateHasChanged();
//}

protected override async Task OnInitializedAsync()
{
await LoadDataAsync();
Expand Down Expand Up @@ -75,6 +83,8 @@ protected void WatchDataLoaderVM<D>(DataLoaderViewModel<D> vm) where D : class

public virtual void Dispose()
{
//BindingContext.PropertyChanged -= BindingContext_PropertyChanged;

foreach (var obj in ObjWatch)
{
obj.PropertyChanged -= ObjWatch_PropertyChanged;
Expand Down
Loading

0 comments on commit 0c655f9

Please sign in to comment.