Merge pull request 'navigation' (#39) from navigation into master
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: ShopNCook/ShopNCook#39xaml/set-filter
commit
d3cf0662b7
@ -1,9 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class HomePage : ContentPage
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class LoginPage : ContentPage
|
||||
{
|
||||
public LoginPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?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.MorePage"
|
||||
BackgroundColor="{StaticResource BackgroundPrimary}"
|
||||
xmlns:views="clr-namespace:ShoopNCook.Views"
|
||||
Title="MorePage">
|
||||
<Grid
|
||||
RowDefinitions="Auto, *"
|
||||
Padding="20, 50, 20, 20">
|
||||
<!-- Profile picture and name -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="*, 2*"
|
||||
ColumnSpacing="30">
|
||||
|
||||
<Image
|
||||
x:Name="ProfileImage"/>
|
||||
|
||||
<Label
|
||||
x:Name="ProfileName"
|
||||
Grid.Column="1"
|
||||
FontSize="24"
|
||||
VerticalTextAlignment="Center"
|
||||
TextColor="{StaticResource TextColorPrimary}"
|
||||
FontFamily="Poppins"/>
|
||||
</Grid>
|
||||
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
VerticalOptions="Center"
|
||||
Margin="40, 0, 0, 0">
|
||||
<views:HeadedButton Text="My Recipes" HeadSource="cookie.svg" HeadColor="#FF5441"/>
|
||||
<views:HeadedButton Text="Edit Profile" HeadSource="user_fill.svg" HeadColor="#FF5441"/>
|
||||
<views:HeadedButton Text="Dark Mode" HeadSource="moon_white.svg" HeadColor="#FF5441"/>
|
||||
<views:HeadedButton Text="Share App" HeadSource="share.svg" HeadColor="#FF5441"/>
|
||||
<views:HeadedButton Text="Logout" HeadSource="logout_arrow.svg" HeadColor="#FF5441"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -1,15 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class MorePage : ContentPage
|
||||
{
|
||||
public MorePage(): this("Adom Shafi", ImageSource.FromFile("default_profile_picture.png"))
|
||||
{
|
||||
}
|
||||
|
||||
public MorePage(string userName, ImageSource userImage)
|
||||
{
|
||||
InitializeComponent();
|
||||
ProfileImage.Source = userImage;
|
||||
ProfileName.Text = userName;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class MyRecipesPage : ContentPage
|
||||
{
|
||||
public MyRecipesPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class RegisterPage : ContentPage
|
||||
{
|
||||
public RegisterPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class Splash : ContentPage
|
||||
{
|
||||
public Splash()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 825 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,26 @@
|
||||
namespace ShoopNCook.Views;
|
||||
using Microsoft.Maui.Graphics;
|
||||
|
||||
public partial class HeadedButton : ContentView
|
||||
{
|
||||
|
||||
public string Text
|
||||
{
|
||||
set => BtnLabel.Text = value;
|
||||
}
|
||||
|
||||
public string HeadColor
|
||||
{
|
||||
set => PrefixBorder.BackgroundColor = Color.FromArgb(value);
|
||||
}
|
||||
|
||||
public string HeadSource
|
||||
{
|
||||
set => PrefixImage.Source = ImageSource.FromFile(value);
|
||||
}
|
||||
|
||||
public HeadedButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
namespace ShoopNCook.Views;
|
||||
|
||||
public partial class HeadedButton : ContentView
|
||||
{
|
||||
|
||||
private readonly BindableProperty TextProperty =
|
||||
BindableProperty.Create(nameof(BtnLabel), typeof(string), typeof(HeadedButton), "No Text Defined.");
|
||||
|
||||
private readonly BindableProperty HeadColorProperty =
|
||||
BindableProperty.Create(nameof(PrefixBorder), typeof(string), typeof(HeadedButton), "#FFFFFF");
|
||||
|
||||
private readonly BindableProperty HeadSourceProperty =
|
||||
BindableProperty.Create(nameof(PrefixImage), typeof(string), typeof(HeadedButton), default(string));
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
public string HeadColor
|
||||
{
|
||||
get => (string)GetValue(HeadColorProperty);
|
||||
set => SetValue(HeadColorProperty, value);
|
||||
}
|
||||
|
||||
public string HeadSource
|
||||
{
|
||||
get => (string)GetValue(HeadSourceProperty);
|
||||
set => SetValue(HeadSourceProperty, value);
|
||||
}
|
||||
|
||||
public HeadedButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class HomePage : ContentPage
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private async void OnSyncButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.Navigation.PushAsync(new SearchPage());
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class LoginPage : ContentPage
|
||||
{
|
||||
public LoginPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private async void OnLoginButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
// Vérifiez les informations d'identification de l'utilisateur ici
|
||||
bool isValidUser = true;
|
||||
|
||||
if (isValidUser)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//HomePage");
|
||||
}
|
||||
}
|
||||
private async void ForgotPasswordTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.Navigation.PushAsync(new ForgotPassword());
|
||||
}
|
||||
private async void RegisterLabbelTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//RegisterPage");
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?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.MorePage"
|
||||
BackgroundColor="{StaticResource BackgroundPrimary}"
|
||||
xmlns:views="clr-namespace:ShoopNCook.Views"
|
||||
Title="MorePage">
|
||||
|
||||
<Grid
|
||||
RowDefinitions="Auto, *"
|
||||
Padding="20, 50, 20, 20">
|
||||
<!-- Profile picture and name -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="*, 2*"
|
||||
ColumnSpacing="30">
|
||||
|
||||
<Image
|
||||
x:Name="ProfileImage"/>
|
||||
|
||||
<Label
|
||||
x:Name="ProfileName"
|
||||
Grid.Column="1"
|
||||
FontSize="24"
|
||||
VerticalTextAlignment="Center"
|
||||
TextColor="{StaticResource TextColorPrimary}"
|
||||
FontFamily="Poppins"/>
|
||||
</Grid>
|
||||
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
VerticalOptions="Center"
|
||||
Margin="40, 0, 0, 0">
|
||||
<Grid>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnMyRecipesButtonTapped"/>
|
||||
</Grid.GestureRecognizers>
|
||||
<views:HeadedButton Text="My Recipes" HeadSource="cookie.svg" HeadColor="#FF5441"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnEditProfileButtonTapped"/>
|
||||
</Grid.GestureRecognizers>
|
||||
<views:HeadedButton Text="Edit Profile" HeadSource="user_fill.svg" HeadColor="#FF5441"/>
|
||||
</Grid>
|
||||
|
||||
<views:HeadedButton Text="Dark Mode" HeadSource="moon_white.svg" HeadColor="#FFFFFF"/>
|
||||
<Grid>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnShareButtonClicked"/>
|
||||
</Grid.GestureRecognizers>
|
||||
<views:HeadedButton Text="Share App" HeadSource="share.svg" HeadColor="#fe33bf"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnLogoutButtonTapped"/>
|
||||
</Grid.GestureRecognizers>
|
||||
<views:HeadedButton Text="Logout" HeadSource="logout_arrow.svg" HeadColor="#FF5441"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -0,0 +1,37 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class MorePage : ContentPage
|
||||
{
|
||||
public MorePage(): this("Adom Shafi", ImageSource.FromFile("default_profile_picture.png"))
|
||||
{
|
||||
}
|
||||
|
||||
public MorePage(string userName, ImageSource userImage)
|
||||
{
|
||||
InitializeComponent();
|
||||
ProfileImage.Source = userImage;
|
||||
ProfileName.Text = userName;
|
||||
}
|
||||
private async void OnMyRecipesButtonTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.Navigation.PushAsync(new MyRecipesPage());
|
||||
}
|
||||
|
||||
private async void OnEditProfileButtonTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.Navigation.PushAsync(new ProfilePage());
|
||||
}
|
||||
|
||||
private async void OnLogoutButtonTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//LoginPage");
|
||||
}
|
||||
private async void OnShareButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Share.RequestAsync(new ShareTextRequest
|
||||
{
|
||||
Text = "Voici le texte à partager (à changer)",
|
||||
Title = "Partagez ce texte : (à modifier)"
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class MyRecipesPage : ContentPage
|
||||
{
|
||||
public MyRecipesPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
private async void OnBackButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PopAsync();
|
||||
}
|
||||
private async void AddRecipeButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.Navigation.PushAsync(new CreateRecipePage());
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class RegisterPage : ContentPage
|
||||
{
|
||||
public RegisterPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private async void LoginTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//LoginPage");
|
||||
}
|
||||
private async void RegisterTapped(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//LoginPage");
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
namespace ShoopNCook.Pages;
|
||||
|
||||
public partial class Splash : ContentPage
|
||||
{
|
||||
public Splash()
|
||||
{
|
||||
InitializeComponent();
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
|
||||
}
|
||||
private async void OnGetStartedButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Shell.Current.GoToAsync("//LoginPage");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue