Skip to content

Commit

Permalink
Numerous changes based on review
Browse files Browse the repository at this point in the history
- Made logo visible all the time
- Project short name is shown on mobile
- Project name area is clickable
  • Loading branch information
josephmyers committed Dec 19, 2024
1 parent 86708f9 commit 6aaa027
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
31 changes: 16 additions & 15 deletions src/SIL.XForge.Scripture/ClientApp/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@
<mat-icon>menu</mat-icon>
</button>
}
@if (!isScreenTiny || (isExpanded && !closeDrawerRequested)) {
@if (isLoggedIn | async) {
<a id="sf-logo-button" mat-icon-button [routerLink]="appIconLink">
<mat-icon><img src="/assets/images/sf.svg" height="38" /></mat-icon>
</a>
} @else {
<a id="sf-logo-button" mat-icon-button href="/">
<mat-icon><img src="/assets/images/sf.svg" height="38" /></mat-icon>
</a>
}
@if (!isScreenTiny && isProjectSelected) {
<span class="project-name-wrapper">
@if (isLoggedIn | async) {
<a id="sf-logo-button" mat-icon-button [routerLink]="appIconLink">
<mat-icon><img src="/assets/images/sf.svg" height="38" /></mat-icon>
</a>
} @else {
<a id="sf-logo-button" mat-icon-button href="/">
<mat-icon><img src="/assets/images/sf.svg" height="38" /></mat-icon>
</a>
}
@if (isProjectSelected) {
<span class="project-name-wrapper" [routerLink]="appIconLink">
@if (isScreenTiny) {
<span class="project-name">{{ selectedProjectDoc?.data?.shortName }}</span>
} @else {
<span class="project-name">{{ selectedProjectDoc?.data?.name }}</span>
<span class="project-short-name">{{ selectedProjectDoc?.data?.shortName }}</span>
</span>
}
}
</span>
}
<span class="toolbar-spacer"></span>
@if (isAppOnline) {
Expand Down Expand Up @@ -191,7 +193,6 @@
[mode]="isDrawerPermanent ? 'side' : 'over'"
[opened]="isExpanded || isDrawerPermanent"
(closed)="drawerCollapsed()"
(closedStart)="closeDrawerRequested = true"
autoFocus="false"
>
<app-navigation></app-navigation>
Expand Down
13 changes: 1 addition & 12 deletions src/SIL.XForge.Scripture/ClientApp/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,10 @@ header {
z-index: 10;
}

@keyframes expandIcon {
from {
width: 0;
}
to {
width: var(--mdc-icon-button-state-layer-size);
}
}

#sf-logo-button {
display: flex;
align-items: center;
justify-content: center;

transform-origin: left;
animation: expandIcon 0.3s ease forwards;
}

.project-name-wrapper {
Expand All @@ -265,6 +253,7 @@ header {
max-width: 20em;
min-width: 0;
margin-inline-start: 4px;
cursor: pointer;

.project-name {
font-size: 0.8em;
Expand Down
5 changes: 0 additions & 5 deletions src/SIL.XForge.Scripture/ClientApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
protected isAppOnline: boolean = false;
protected isExpanded: boolean = false;
protected isScreenTiny = false;
protected closeDrawerRequested = false;

private currentUserDoc?: UserDoc;
private projectUserConfigDoc?: SFProjectUserConfigDoc;
Expand Down Expand Up @@ -399,22 +398,18 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest

collapseDrawer(): void {
this.isExpanded = false;
this.closeDrawerRequested = true;
}

openDrawer(): void {
this.isExpanded = true;
this.closeDrawerRequested = false;
}

toggleDrawer(): void {
this.isExpanded = !this.isExpanded;
this.closeDrawerRequested = !this.isExpanded;
}

drawerCollapsed(): void {
this.isExpanded = false;
this.closeDrawerRequested = false;
}

reloadWithUpdates(): void {
Expand Down

0 comments on commit 6aaa027

Please sign in to comment.