Merge pull request 'Vue : Avis des recettes' (#34) from feature/10-recipe-reviews into dev-views

Reviewed-on: #34
pull/27/head
Alexandre AGOSTINHO 2 years ago
commit 5c87a63f49

@ -30,7 +30,8 @@ namespace Views
/* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */
MainPage = new MyProfil();
UserAppTheme = AppTheme.Light;
MainPage = new RecipeReviews();
//MainPage = new MyPosts();
}
}

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Views"
x:Class="Views.RecipeReviews"
Title="RecipeReviews">
<VerticalStackLayout>
<local:MiniHeader
TitleMini="Liste des avis de la recette n°5616548"
NeedReturn="True"
HeightRequest="100"/>
<VerticalStackLayout>
<ScrollView MaximumHeightRequest="500">
<VerticalStackLayout>
<local:UserReview>
<local:UserReview.Comment>
Recette facile, non prise de tête et agréable à réaliser avec ses grand-parents. Le résultat est délicieux, ma famille a adorée.
</local:UserReview.Comment>
</local:UserReview>
<local:UserReview>
<local:UserReview.Comment>
Très bonne recette à lexeption près quil est compliqué doffrir ces cookies à des enfants. En effet, ils ne sont pas très friant de fruit ou de légumes... Mais ils ont eu beaucoup de succès auprès de mes vieux !
</local:UserReview.Comment>
</local:UserReview>
<local:UserReview>
<local:UserReview.Comment>
Je suis plutôt vin blanc.
</local:UserReview.Comment>
</local:UserReview>
<local:UserReview>
<local:UserReview.Comment>
Très bonne recette à lexeption près quil est compliqué doffrir ces cookies à des enfants. En effet, ils ne sont pas très friant de fruit ou de légumes... Mais ils ont eu beaucoup de succès auprès de mes vieux !
Très bonne recette à lexeption près quil est compliqué doffrir ces cookies à des enfants. En effet, ils ne sont pas très friant de fruit ou de légumes... Mais ils ont eu beaucoup de succès auprès de mes vieux !
Très bonne recette à lexeption près quil est compliqué doffrir ces cookies à des enfants. En effet, ils ne sont pas très friant de fruit ou de légumes... Mais ils ont eu beaucoup de succès auprès de mes vieux !
Très bonne recette à lexeption près quil est compliqué doffrir ces cookies à des enfants. En effet, ils ne sont pas très friant de fruit ou de légumes... Mais ils ont eu beaucoup de succès auprès de mes vieux !
</local:UserReview.Comment>
</local:UserReview>
</VerticalStackLayout>
</ScrollView>
<Border>
<AbsoluteLayout>
<Grid AbsoluteLayout.LayoutBounds="0, 0.5" AbsoluteLayout.LayoutFlags="PositionProportional"
Margin="20"
ColumnDefinitions="50, 50, 50, 50"
RowDefinitions="50, 50">
<Image Source="person_default.png" Grid.Row="0"/>
<Label Text="Charles Jacob"
Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0"
HorizontalOptions="StartAndExpand" VerticalOptions="Center"
HorizontalTextAlignment="Center"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Row="1" Grid.Column="0"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Row="1" Grid.Column="1"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Row="1" Grid.Column="2"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Row="1" Grid.Column="3"/>
</Grid>
<Editor AbsoluteLayout.LayoutBounds="0.5, 0.5, 700, 150" AbsoluteLayout.LayoutFlags="PositionProportional"
Margin="20"
Placeholder="Laisser un commentaire..." PlaceholderColor="Black" FontSize="16"
BackgroundColor="{StaticResource Gray100}" Keyboard="Text"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="True"/>
<Button AbsoluteLayout.LayoutBounds="1, 6, 270, 150" AbsoluteLayout.LayoutFlags="PositionProportional"
Margin="50"
Text="Valider" VerticalOptions="Center" TextColor="Black"
BackgroundColor="LightGreen"/>
</AbsoluteLayout>
</Border>
</VerticalStackLayout>
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace Views;
public partial class RecipeReviews : ContentPage
{
public RecipeReviews()
{
InitializeComponent();
}
}

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
<defs>
</defs>
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)" >
<path d="M 89.95 34.92 c -0.135 -0.411 -0.519 -0.688 -0.95 -0.688 H 56.508 L 45.948 2.814 C 45.811 2.408 45.43 2.133 45 2.133 s -0.811 0.274 -0.948 0.681 l -10.56 31.417 H 1 c -0.432 0 -0.815 0.277 -0.95 0.688 s 0.009 0.861 0.357 1.117 l 26.246 19.314 l -10 31.21 c -0.131 0.409 0.014 0.856 0.36 1.11 c 0.348 0.257 0.817 0.261 1.168 0.012 L 45 68.795 l 26.818 18.889 c 0.173 0.122 0.375 0.183 0.576 0.183 c 0.208 0 0.416 -0.064 0.592 -0.194 c 0.347 -0.254 0.491 -0.701 0.36 -1.11 l -10 -31.21 l 26.246 -19.314 C 89.94 35.781 90.085 35.331 89.95 34.92 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,212,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -14,6 +14,15 @@
<Setter Property="Margin" Value="10"/>
</Style>
<Style x:Key="commentSecton" TargetType="Border">
<Setter Property="Margin" Value="10"/>
</Style>
<Style x:Key="starCommentImage" TargetType="Image">
<Setter Property="Source" Value="star_icon.png"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style x:Key="button1" TargetType="Button">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Tertiary}, Dark={StaticResource Gray500}}"/>

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Views"
x:Class="Views.UserReview"
x:Name="nUserRef">
<Grid
ColumnDefinitions="250, *">
<!-- Stars, user profile picture and name -->
<Grid Grid.Column="0"
ColumnDefinitions="50, 50, 50, 50"
RowDefinitions="50, 50"
Margin="20">
<Image Style="{StaticResource Key=starCommentImage}" Grid.Column="0"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Column="1"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Column="2"/>
<Image Style="{StaticResource Key=starCommentImage}" Grid.Column="3"/>
<Image Source="person_default.png" Grid.Row="1"/>
<Label Text="Charles Jacob"
Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"
HorizontalOptions="StartAndExpand" VerticalOptions="Center"
HorizontalTextAlignment="Center"/>
</Grid>
<!-- Comment content -->
<Border Grid.Column="2" Margin="20"
BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray400}}">
<Label Text="{Binding Comment, Source={x:Reference nUserRef}}"
BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray400}}"
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
Margin="20" FontSize="16"/>
</Border>
</Grid>
</ContentView>

@ -0,0 +1,18 @@
namespace Views;
public partial class UserReview : ContentView
{
public UserReview()
{
InitializeComponent();
}
public static readonly BindableProperty CommentProperty =
BindableProperty.Create("Comment", typeof(string), typeof(Label), "");
public string Comment
{
get => (string)GetValue(CommentProperty);
set => SetValue(CommentProperty, value);
}
}

@ -80,9 +80,15 @@
<MauiXaml Update="RecipeCase.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="RecipeReviews.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ReturnButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="UserReview.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ViewRecette.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

Loading…
Cancel
Save