Skip to content

Commit

Permalink
fix oqtane#4606 - allow logo to show site name as fallback (credit @J…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwalker committed Sep 13, 2024
1 parent d954e3f commit 1c1c269
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Oqtane.Client/Themes/BlazorTheme/Themes/Default.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="row flex-xl-nowrap gx-0">
<div class="sidebar">
<nav class="navbar">
<Logo />
<Logo ShowName="true" />
<Menu Orientation="Vertical" />
</nav>
</div>
Expand Down
17 changes: 16 additions & 1 deletion Oqtane.Client/Themes/Controls/Theme/Logo.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,19 @@
<img class="img-fluid" src="@Utilities.FileUrl(PageState.Alias, PageState.Site.LogoFileId.Value)" alt="@PageState.Site.Name" />
</a>
</span>
}
}
else
{
if (ShowName)
{
<span class="app-logo">
<a class="site-name" href="@PageState.Alias.Path">@PageState.Site.Name</a>
</span>
}
}

@code {
[Parameter]
public bool ShowName { get; set; } = false;
}

2 changes: 1 addition & 1 deletion Oqtane.Client/Themes/OqtaneTheme/Themes/Default.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<main role="main">
<nav class="navbar navbar-dark bg-primary fixed-top">
<Logo /><Menu Orientation="Horizontal" />
<Logo ShowName="true" /><Menu Orientation="Horizontal" />
<div class="controls ms-auto">
<div class="controls-group">
<Search CssClass="me-3 text-center bg-primary" />
Expand Down
6 changes: 6 additions & 0 deletions Oqtane.Server/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,10 @@ app {
.text-area-editor > textarea {
width: 100%;
min-height: 250px;
}

.app-logo .site-name {
padding: 0 20px 0 20px;
font-size: x-large;
color: white;
}

1 comment on commit 1c1c269

@JanOlsmar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will not work as expected. The site name will in several cases be incorrectly white. Since Bootstrap is used, you should keep the class name navbar-brand to set the correct color for example dark and light. The CSS change I suggested would of course be changed for the repective standard theme not app.css.

Please sign in to comment.