Skip to content

Commit

Permalink
(#57) udpate the radzen layout for the footer flex and column
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Apr 20, 2024
1 parent 7184bd9 commit fe6a3d1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 7 deletions.
4 changes: 4 additions & 0 deletions MiniSpace.Web/src/MiniSpace.Web/Pages/AboutApp.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1>About MiniSpace</h1>
<p>MiniSpace is a dynamic social platform designed to connect people and communities. Discover, share, and interact with content that drives innovation and engagement.</p>
</div>
6 changes: 6 additions & 0 deletions MiniSpace.Web/src/MiniSpace.Web/Pages/Connect.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div>
<h1>Connect</h1>
<p>Contact Us:</p>
<p>Email: support@minispace.com</p>
<p>Phone: +123 456 7890</p>
</div>
11 changes: 10 additions & 1 deletion MiniSpace.Web/src/MiniSpace.Web/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@using MudBlazor

<MudLayout Class="landing-page container">
<MudContainer MaxWidth="MaxWidth.False" Class="split-screen" Style="display: flex; align-items: center; justify-content: center; height: 80vh; margin-left: auto; margin-right: auto;">
<MudContainer MaxWidth="MaxWidth.False" Class="split-screen" Style="display: flex; align-items: center; justify-content: center; height: 80vh; margin-left: auto; margin-right: auto;" id="home">
<MudGrid Style="width: 100%;">
<MudItem xs="12" md="6" Class="carousel-section">
<MudCarousel @bind-SelectedIndex="@activeIndex" Class="mud-width-full" Style="height: 50vh;" ShowArrows="@arrows" ShowBullets="@bullets" EnableSwipeGesture="@enableSwipeGesture" AutoCycle="@autocycle" TData="object">
Expand Down Expand Up @@ -37,6 +37,15 @@
</MudGrid>
</MudContainer>


<div id="about">
<AboutApp />
</div>

<div id="connect">
<Connect />
</div>

</MudLayout>

@code {
Expand Down
9 changes: 9 additions & 0 deletions MiniSpace.Web/src/MiniSpace.Web/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@
<script src="_framework/blazor.server.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script>
window.scrollToSection = function(sectionId) {
var element = document.getElementById(sectionId);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
};
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using Radzen
@inherits LayoutComponentBase

<RadzenFooter style="background-color: #333; color: white; padding: 20px; text-align: center; bottom:0;">
<RadzenFooter style="background-color: #333; color: white; padding: 20px; text-align: center; ">
<div style="max-width: 1200px; width: 100%; margin: auto !important; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; text-align: center;">
<div style="flex: 1; min-width: 250px; padding: 10px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;">
<h5>About MiniSpace</h5>
Expand Down
15 changes: 11 additions & 4 deletions MiniSpace.Web/src/MiniSpace.Web/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
@inherits LayoutComponentBase
@inject IIdentityService IdentityService
@inject NavigationManager NavigationManager
@inject Microsoft.JSInterop.IJSRuntime JSRuntime


<RadzenLayout style="margin: -8.0px; width: 100%; text-align: center;">
<RadzenLayout style="margin: -8.0px; width: 100%; text-align: center;" id="radzen-layout" >
<RadzenHeader>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween"
Style="width: 98.5%;">
Expand All @@ -17,6 +18,9 @@
</RadzenStack>
<RadzenMenu>
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5em">
<RadzenMenuItem Text="Home" Click="@(() => ScrollToSection("home"))" />
<RadzenMenuItem Text="About App" Click="@(() => ScrollToSection("about"))" />
<RadzenMenuItem Text="Connect" Click="@(() => ScrollToSection("connect"))" />
@if (IdentityService.IsAuthenticated)
{
<RadzenMenuItem Text="Sign Out" Click=@SignOut Icon="exit_to_app"/>
Expand All @@ -43,23 +47,26 @@
</RadzenSidebar>
}

<RadzenBody style="margin: -12.0px;">
<RadzenBody style="margin: -12.0px;" class="radzen-body">
<div class="rz-p-4">
@Body
</div>
</RadzenBody>
<CustomRadzenFooter />
</RadzenLayout>

@code{

@code{
bool _sidebarExpanded = true;

void SignOut()
{
// Implement your sign-out logic here, e.g., redirect to sign-out path, clear authentication state
IdentityService.Logout();
NavigationManager.NavigateTo("");
}

void ScrollToSection(string sectionId)
{
JSRuntime.InvokeVoidAsync("scrollToSection", sectionId);
}
}
17 changes: 16 additions & 1 deletion MiniSpace.Web/src/MiniSpace.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,19 @@ main {
.landing-page {
padding: 2rem 10rem;
}
}
}

html, body {
height: 100%;
margin: 0;
}

#radzen-layout {
display: flex;
flex-direction: column;
height: 100%;
}

.radzen-body {
flex: 1;
}

0 comments on commit fe6a3d1

Please sign in to comment.