|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | + |
| 3 | +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 5 | + xmlns:vm="clr-namespace:TrashMobMobile.ViewModels" |
| 6 | + x:DataType="vm:DependentWaiverViewModel" |
| 7 | + x:Class="TrashMobMobile.Pages.DependentWaiverPage" |
| 8 | + Title="Sign Waivers"> |
| 9 | + <ScrollView> |
| 10 | + <VerticalStackLayout Style="{StaticResource OuterVerticalStack}" Spacing="16"> |
| 11 | + |
| 12 | + <ActivityIndicator IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}" /> |
| 13 | + |
| 14 | + <!-- List state: show waivers to sign --> |
| 15 | + <VerticalStackLayout Spacing="12" IsVisible="{Binding IsListVisible}"> |
| 16 | + |
| 17 | + <Label FontFamily="LexendSemibold" FontSize="Large" |
| 18 | + HorizontalTextAlignment="Center"> |
| 19 | + <Label.FormattedText> |
| 20 | + <FormattedString> |
| 21 | + <Span Text="Waivers for " /> |
| 22 | + <Span Text="{Binding DependentName}" FontAttributes="Bold" /> |
| 23 | + </FormattedString> |
| 24 | + </Label.FormattedText> |
| 25 | + </Label> |
| 26 | + |
| 27 | + <Label Text="{Binding EventName}" |
| 28 | + FontSize="Body" |
| 29 | + HorizontalTextAlignment="Center" |
| 30 | + TextColor="{AppThemeBinding Light={StaticResource MutedForegroundLight}, Dark={StaticResource MutedForegroundDark}}" /> |
| 31 | + |
| 32 | + <Label Text="{Binding ProgressText}" |
| 33 | + FontSize="Caption" |
| 34 | + HorizontalTextAlignment="Center" |
| 35 | + TextColor="{AppThemeBinding Light={StaticResource MutedForegroundLight}, Dark={StaticResource MutedForegroundDark}}" /> |
| 36 | + |
| 37 | + <CollectionView ItemsSource="{Binding Waivers}" SelectionMode="None"> |
| 38 | + <CollectionView.ItemTemplate> |
| 39 | + <DataTemplate x:DataType="vm:DependentWaiverItem"> |
| 40 | + <Border Padding="16" Margin="0,0,0,8" |
| 41 | + BackgroundColor="{AppThemeBinding Light={StaticResource CardLight}, Dark={StaticResource CardDark}}" |
| 42 | + StrokeShape="RoundRectangle 12" |
| 43 | + Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}" |
| 44 | + StrokeThickness="1"> |
| 45 | + <Grid ColumnDefinitions="*, Auto"> |
| 46 | + <VerticalStackLayout Grid.Column="0" Spacing="4"> |
| 47 | + <Label Text="{Binding Name}" |
| 48 | + FontFamily="LexendSemibold" FontSize="14" /> |
| 49 | + <Label Text="{Binding StatusText}" FontSize="12" |
| 50 | + TextColor="{AppThemeBinding Light={StaticResource MutedForegroundLight}, Dark={StaticResource MutedForegroundDark}}" /> |
| 51 | + </VerticalStackLayout> |
| 52 | + <Button Grid.Column="1" Text="Sign" |
| 53 | + Style="{StaticResource PrimaryLargeButton}" |
| 54 | + HeightRequest="36" Padding="12,0" FontSize="Small" |
| 55 | + IsVisible="{Binding IsSigned, Converter={StaticResource InvertedBoolConverter}}" |
| 56 | + Command="{Binding Source={RelativeSource AncestorType={x:Type vm:DependentWaiverViewModel}}, Path=SelectWaiverCommand}" |
| 57 | + CommandParameter="{Binding .}" /> |
| 58 | + <Label Grid.Column="1" Text="✓" FontSize="24" TextColor="#16a34a" |
| 59 | + VerticalOptions="Center" HorizontalOptions="Center" |
| 60 | + IsVisible="{Binding IsSigned}" /> |
| 61 | + </Grid> |
| 62 | + </Border> |
| 63 | + </DataTemplate> |
| 64 | + </CollectionView.ItemTemplate> |
| 65 | + </CollectionView> |
| 66 | + |
| 67 | + <Button Text="Done" MaximumWidthRequest="200" |
| 68 | + Command="{Binding DoneCommand}" |
| 69 | + IsVisible="{Binding AllWaiversSigned}" /> |
| 70 | + </VerticalStackLayout> |
| 71 | + |
| 72 | + <!-- Signing state: show waiver text and sign form --> |
| 73 | + <VerticalStackLayout Spacing="12" IsVisible="{Binding IsSigningWaiver}"> |
| 74 | + |
| 75 | + <Label Text="{Binding WaiverName}" |
| 76 | + FontFamily="LexendSemibold" FontSize="Large" |
| 77 | + HorizontalTextAlignment="Center" /> |
| 78 | + |
| 79 | + <Border Padding="12" |
| 80 | + BackgroundColor="{AppThemeBinding Light={StaticResource CardLight}, Dark={StaticResource CardDark}}" |
| 81 | + StrokeShape="RoundRectangle 8" |
| 82 | + Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}" |
| 83 | + StrokeThickness="1"> |
| 84 | + <Label Text="{Binding WaiverText}" TextType="Html" FontSize="Small" /> |
| 85 | + </Border> |
| 86 | + |
| 87 | + <HorizontalStackLayout Spacing="8" Margin="0,8,0,0"> |
| 88 | + <CheckBox IsChecked="{Binding HasAgreed}" /> |
| 89 | + <Label Text="I have read and agree to the waiver above." |
| 90 | + VerticalOptions="Center" FontSize="Small" /> |
| 91 | + </HorizontalStackLayout> |
| 92 | + |
| 93 | + <VerticalStackLayout Spacing="4"> |
| 94 | + <Label Text="Type your full legal name to sign:" FontSize="Small" |
| 95 | + FontFamily="LexendSemibold" /> |
| 96 | + <Entry Text="{Binding TypedLegalName}" Placeholder="Full Legal Name" /> |
| 97 | + </VerticalStackLayout> |
| 98 | + |
| 99 | + <HorizontalStackLayout HorizontalOptions="Center" Spacing="12"> |
| 100 | + <Button Text="Back" |
| 101 | + MaximumWidthRequest="140" |
| 102 | + BackgroundColor="Transparent" |
| 103 | + TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" |
| 104 | + BorderColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" |
| 105 | + BorderWidth="1" |
| 106 | + Command="{Binding BackToListCommand}" /> |
| 107 | + |
| 108 | + <Button Text="Sign Waiver" |
| 109 | + MaximumWidthRequest="200" |
| 110 | + Command="{Binding SignWaiverCommand}" /> |
| 111 | + </HorizontalStackLayout> |
| 112 | + </VerticalStackLayout> |
| 113 | + |
| 114 | + </VerticalStackLayout> |
| 115 | + </ScrollView> |
| 116 | +</ContentPage> |
0 commit comments