add bases of create-recipe page

pull/37/head
maxime.BATISTA@etu.uca.fr 2 years ago
parent bb33e695d6
commit b506f1ee3d

@ -73,5 +73,10 @@
Title="My Recipes Page" Title="My Recipes Page"
ContentTemplate="{DataTemplate pages:MyRecipesPage}" ContentTemplate="{DataTemplate pages:MyRecipesPage}"
Route="MyRecipes" /> Route="MyRecipes" />
<ShellContent
Title="Create Recipe Page"
ContentTemplate="{DataTemplate pages:CreateRecipePage}"
Route="CreateRecipe" />
</TabBar> </TabBar>
</Shell> </Shell>

@ -0,0 +1,66 @@
<?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"
x:Class="ShoopNCook.Pages.CreateRecipePage"
Title="CreateRecipePage"
BackgroundColor="{StaticResource BackgroundPrimary}">
<Grid
RowDefinitions="Auto, Auto, *"
Padding="20, 30, 20, 0">
<!-- Header label and return button -->
<HorizontalStackLayout
Grid.Row="0"
MaximumHeightRequest="60">
<ImageButton
HeightRequest="50"
WidthRequest="50"
Source="arrow_back.svg"
HorizontalOptions="Start"/>
<Label
Text="Create new recipe"
Style="{StaticResource h3}"
FontSize="20"
VerticalTextAlignment="Center"/>
</HorizontalStackLayout>
<!--Image display and upload button-->
<Grid
Grid.Row="1"
RowDefinitions="Auto">
<Border
Grid.Row="0"
BackgroundColor="{StaticResource ImageBackground}"
Stroke="White"
StrokeThickness="2"
StrokeShape="RoundRectangle 25">
<Image
x:Name="RecipeImage"
HeightRequest="250"/>
</Border>
<Border
Grid.Row="0"
BackgroundColor="{StaticResource Selected}"
Stroke="White"
StrokeThickness="2"
StrokeShape="RoundRectangle 200"
WidthRequest="50"
HeightRequest="50"
HorizontalOptions="End"
VerticalOptions="End"
TranslationY="20"
TranslationX="-20">
<ImageButton
Source="edit.svg"
WidthRequest="30"
/>
</Border>
</Grid>
<Entry
Style="{StaticResource UserInput}"
Placeholder="Specify your recipe name"/>
</Grid>
</ContentPage>

@ -0,0 +1,9 @@
namespace ShoopNCook.Pages;
public partial class CreateRecipePage : ContentPage
{
public CreateRecipePage()
{
InitializeComponent();
}
}

@ -15,14 +15,17 @@
<ScrollView> <ScrollView>
<Grid <Grid
RowDefinitions="*, Auto, Auto, 0.5*"> RowDefinitions="*, Auto, Auto, 0.5*">
<!--Header-->
<FlexLayout <FlexLayout
Grid.Row="0" Grid.Row="0"
Direction="Row" Direction="Row"
JustifyContent="SpaceBetween" JustifyContent="SpaceBetween"
AlignContent="Center" AlignContent="Center"
AlignItems="Center"> AlignItems="Center">
<ImageButton <ImageButton
Source="arrow_back.svg"/> Source="arrow_back.svg"/>
<Label <Label
Style="{StaticResource h1}" Style="{StaticResource h1}"
x:Name="RecipeName" x:Name="RecipeName"
@ -42,7 +45,7 @@
Margin="10" Margin="10"
Stroke="Transparent" Stroke="Transparent"
StrokeShape="RoundRectangle 20" StrokeShape="RoundRectangle 20"
BackgroundColor="AliceBlue"> BackgroundColor="{StaticResource ImageBackground}">
<Image <Image
HeightRequest="250"/> HeightRequest="250"/>
</Border> </Border>

@ -0,0 +1,3 @@
<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.1839 4.11825L5.4851 11.3456C5.13123 11.6774 4.55507 11.6774 4.20121 11.3456C3.84735 11.0138 3.84735 10.4736 4.20121 10.1418L11.9 2.9144C12.2539 2.5826 12.83 2.5826 13.1839 2.9144C13.3608 3.0803 13.4515 3.29725 13.4515 3.5142C13.4515 3.7354 13.3608 3.95235 13.1839 4.11825ZM16.0728 3.21679L14.1447 1.41315C13.26 0.583639 11.8219 0.583639 10.9373 1.41315L2.67138 9.17649C2.41279 9.41471 2.22225 9.71248 2.10883 10.04L0.448394 15.0001C0.226096 15.6552 0.883918 16.272 1.58257 16.0678L6.88144 14.5066C7.22623 14.4045 7.5438 14.2259 7.80239 13.9834L16.0728 6.22004C16.9575 5.39053 16.9575 4.0463 16.0728 3.21679Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 780 B

@ -51,5 +51,6 @@
<Color x:Key="TextColorSecondary">#6d6d6d</Color> <Color x:Key="TextColorSecondary">#6d6d6d</Color>
<Color x:Key="ActionButton">#ff8988</Color> <Color x:Key="ActionButton">#ff8988</Color>
<Color x:Key="Selected">#ff8988</Color> <Color x:Key="Selected">#ff8988</Color>
<Color x:Key="ImageBackground">AliceBlue</Color>
</ResourceDictionary> </ResourceDictionary>

@ -65,6 +65,14 @@
<Setter Property="FontAttributes" Value="Bold"/> <Setter Property="FontAttributes" Value="Bold"/>
</Style> </Style>
<Style
TargetType="Label"
x:Key="h3">
<Setter Property="FontFamily" Value="PoppinsRegular"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="TextColor" Value="{StaticResource TextColorSecondary}"/>
</Style>
<Style <Style
TargetType="Label" TargetType="Label"
x:Key="Small"> x:Key="Small">

@ -52,6 +52,7 @@
<None Remove="Resources\Fonts\Poppins-Medium.ttf" /> <None Remove="Resources\Fonts\Poppins-Medium.ttf" />
<None Remove="Resources\Fonts\Poppins-Regular.ttf" /> <None Remove="Resources\Fonts\Poppins-Regular.ttf" />
<None Remove="Resources\Images\cookie.svg" /> <None Remove="Resources\Images\cookie.svg" />
<None Remove="Resources\Images\edit.svg" />
<None Remove="Resources\Images\email_icon.svg" /> <None Remove="Resources\Images\email_icon.svg" />
<None Remove="Resources\Images\facebook_logo.svg" /> <None Remove="Resources\Images\facebook_logo.svg" />
<None Remove="Resources\Images\hearth_off.svg" /> <None Remove="Resources\Images\hearth_off.svg" />
@ -92,6 +93,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="Pages\CreateRecipePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\CounterView.xaml"> <MauiXaml Update="Views\CounterView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

@ -16,7 +16,7 @@
Grid.Row="0" Grid.Row="0"
Stroke="Transparent" Stroke="Transparent"
StrokeShape="RoundRectangle 20" StrokeShape="RoundRectangle 20"
BackgroundColor="AliceBlue"> BackgroundColor="{StaticResource ImageBackground}">
<Grid> <Grid>
<Image /> <Image />
<HorizontalStackLayout <HorizontalStackLayout

@ -18,7 +18,7 @@
Grid.Row="0" Grid.Row="0"
Stroke="Transparent" Stroke="Transparent"
StrokeShape="RoundRectangle 20" StrokeShape="RoundRectangle 20"
BackgroundColor="AliceBlue"> BackgroundColor="{StaticResource ImageBackground}">
<Grid> <Grid>
<Image /> <Image />
<HorizontalStackLayout <HorizontalStackLayout

@ -18,7 +18,7 @@
Grid.Row="0" Grid.Row="0"
Stroke="Transparent" Stroke="Transparent"
StrokeShape="RoundRectangle 20" StrokeShape="RoundRectangle 20"
BackgroundColor="AliceBlue"> BackgroundColor="{StaticResource ImageBackground}">
<Grid> <Grid>
<Image /> <Image />
<HorizontalStackLayout <HorizontalStackLayout

Loading…
Cancel
Save