mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-23 12:08:32 +00:00
Rename Data property in many pages
This commit is contained in:
parent
409892b802
commit
afd18e0d19
@ -14,6 +14,6 @@
|
||||
<RadzenButton Text="Deploy New" Icon="add_circle_outline" ButtonStyle="ButtonStyle.Secondary"
|
||||
Click="@(() => NotificationService.Notify(NotificationSeverity.Warning, "NOT IMPLEMENTED", "Will be implemented later"))" />
|
||||
</div>
|
||||
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedContracts" />
|
||||
<CardList Data="@ContractCards" @bind-SelectedItems="@AppState.Storage.SelectedContracts" />
|
||||
}
|
||||
</RadzenContent>
|
||||
|
@ -28,15 +28,15 @@ public partial class ContractsPage : BasicComponent
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Contracts = AppState.SelectedNetwork?.DeployedContracts?.ToArray() ?? Array.Empty<IContract>();
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
}
|
||||
|
||||
private IContract[] Contracts { get; set; }
|
||||
private CardListItem[] Data { get; set; }
|
||||
private CardListItem[] ContractCards { get; set; }
|
||||
|
||||
private void RefreshData()
|
||||
private void RefreshCards()
|
||||
{
|
||||
Data = Contracts.Select(MapCardListItem).ToArray();
|
||||
ContractCards = Contracts.Select(MapCardListItem).ToArray();
|
||||
}
|
||||
|
||||
private CardListItem MapCardListItem(IContract contract)
|
||||
|
@ -6,7 +6,7 @@
|
||||
<RadzenSteps Change="@(async x => await OnChange(x))" ShowStepsButtons="false">
|
||||
<Steps>
|
||||
<RadzenStepsItem Text="Select uploader">
|
||||
<CardList Data="@Data" @bind-SelectedItems="@SelectedUploaderIds"/>
|
||||
<CardList Data="@UploaderCards" @bind-SelectedItems="@SelectedUploaderIds"/>
|
||||
</RadzenStepsItem>
|
||||
<RadzenStepsItem Text="Configure uploader" Disabled="@(SelectedUploader == null)">
|
||||
@if (ConfigurationItems != null)
|
||||
|
@ -34,10 +34,10 @@ public partial class CreateUploadPage : BasicComponent
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Data = AppState.Storage.Uploaders.Select(MapCardListItem).ToArray();
|
||||
UploaderCards = AppState.Storage.Uploaders.Select(MapCardListItem).ToArray();
|
||||
}
|
||||
|
||||
private CardListItem[] Data { get; set; }
|
||||
private CardListItem[] UploaderCards { get; set; }
|
||||
private Guid[] SelectedUploaderIds { get; set; }
|
||||
private IUploader SelectedUploader => AppState?.Storage?.Uploaders?.FirstOrDefault(x => x.Id == SelectedUploaderIds?.FirstOrDefault());
|
||||
private IReadOnlyCollection<ConfigurationItem> ConfigurationItems { get; set; } = Array.Empty<ConfigurationItem>();
|
||||
|
@ -10,6 +10,6 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedProviders" />
|
||||
<CardList Data="@ProviderCards" @bind-SelectedItems="@AppState.Storage.SelectedProviders" />
|
||||
}
|
||||
</RadzenContent>
|
||||
|
@ -27,15 +27,15 @@ public partial class ProvidersPage : BasicComponent
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Providers = AppState.Storage.Providers.Where(x => AppState.SelectedNetwork != null && x.IsNetworkSupported(AppState.SelectedNetwork)).ToArray();
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
}
|
||||
|
||||
private IProvider[] Providers { get; set; }
|
||||
private CardListItem[] Data { get; set; }
|
||||
private CardListItem[] ProviderCards { get; set; }
|
||||
|
||||
private void RefreshData()
|
||||
private void RefreshCards()
|
||||
{
|
||||
Data = Providers.Select(MapCardListItem).ToArray();
|
||||
ProviderCards = Providers.Select(MapCardListItem).ToArray();
|
||||
}
|
||||
|
||||
private CardListItem MapCardListItem(IProvider provider)
|
||||
@ -65,7 +65,7 @@ public partial class ProvidersPage : BasicComponent
|
||||
? new CardListItemButton { Name = "Initialize", Style = ButtonStyle.Secondary, Action = () =>
|
||||
{
|
||||
provider.Initialize();
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
}}
|
||||
: null,
|
||||
}.Where(x => x != null).ToArray()
|
||||
|
@ -8,5 +8,5 @@
|
||||
<RadzenButton Text="Create New" Icon="add_circle_outline" ButtonStyle="ButtonStyle.Secondary"
|
||||
Click="@OpenCreateTokenDialog" />
|
||||
</div>
|
||||
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedTokens" />
|
||||
<CardList Data="@TokenCards" @bind-SelectedItems="@AppState.Storage.SelectedTokens" />
|
||||
</RadzenContent>
|
||||
|
@ -28,14 +28,14 @@ public partial class TokensPage : BasicComponent
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// ToDo: Add loading from IndexedDB
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
}
|
||||
|
||||
private CardListItem[] Data { get; set; }
|
||||
private CardListItem[] TokenCards { get; set; }
|
||||
|
||||
private void RefreshData()
|
||||
private void RefreshCards()
|
||||
{
|
||||
Data = AppState?.Storage?.Tokens?.Select(MapCardListItem).ToArray() ?? Array.Empty<CardListItem>();
|
||||
TokenCards = AppState?.Storage?.Tokens?.Select(MapCardListItem).ToArray() ?? Array.Empty<CardListItem>();
|
||||
}
|
||||
|
||||
private CardListItem MapCardListItem(IToken token)
|
||||
@ -67,7 +67,7 @@ public partial class TokensPage : BasicComponent
|
||||
|
||||
AppState.Storage.Tokens ??= new List<IToken>();
|
||||
AppState.Storage.Tokens.Add(token);
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
StateHasChangedSafe();
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,6 @@
|
||||
<RadzenButton Text="Create New" Icon="add_circle_outline" ButtonStyle="ButtonStyle.Secondary"
|
||||
Click="@OpenCreateUploadDialog"/>
|
||||
</div>
|
||||
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedUploadLocations"/>
|
||||
<CardList Data="@UploadCards" @bind-SelectedItems="@AppState.Storage.SelectedUploadLocations"/>
|
||||
}
|
||||
</RadzenContent>
|
||||
|
@ -28,14 +28,14 @@ public partial class UploadLocationsPage : BasicComponent
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// ToDo: Add loading from IndexedDB
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
}
|
||||
|
||||
private CardListItem[] Data { get; set; }
|
||||
private CardListItem[] UploadCards { get; set; }
|
||||
|
||||
private void RefreshData()
|
||||
private void RefreshCards()
|
||||
{
|
||||
Data = AppState?.Storage?.UploadLocations?.Select(MapCardListItem).ToArray() ?? Array.Empty<CardListItem>();
|
||||
UploadCards = AppState?.Storage?.UploadLocations?.Select(MapCardListItem).ToArray() ?? Array.Empty<CardListItem>();
|
||||
}
|
||||
|
||||
private CardListItem MapCardListItem(ITokenUploadLocation uploadLocation)
|
||||
@ -91,7 +91,7 @@ public partial class UploadLocationsPage : BasicComponent
|
||||
|
||||
AppState.Storage.UploadLocations ??= new List<ITokenUploadLocation>();
|
||||
AppState.Storage.UploadLocations.Add(uploadLocation);
|
||||
RefreshData();
|
||||
RefreshCards();
|
||||
StateHasChangedSafe();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user