-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(home-button): add home-button component to library (#923)
* feat(home-button): add home-button component to library * refactor(home-button): transfer home button to common package
- Loading branch information
1 parent
a3b32dd
commit 4d0c8b2
Showing
9 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/common/src/lib/home-button/home-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<button | ||
id="homeButton" | ||
mat-icon-button | ||
tooltip-position="below" | ||
matTooltipShowDelay="500" | ||
[matTooltip]="'igo.context.sidenav.mainMenu' | translate" | ||
(click)="onUnselectButtonClick()"> | ||
<mat-icon svgIcon="home"></mat-icon> | ||
</button> |
8 changes: 8 additions & 0 deletions
8
packages/common/src/lib/home-button/home-button.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#homeButton { | ||
position: absolute; | ||
top: 50px; | ||
left: 0px; | ||
border-radius: 0; | ||
height: 46px; | ||
width: 48px; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/common/src/lib/home-button/home-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Component, EventEmitter, Output } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'igo-home-button', | ||
templateUrl: './home-button.component.html', | ||
styleUrls: ['./home-button.component.scss'] | ||
}) | ||
export class HomeButtonComponent { | ||
|
||
@Output() unselectButton = new EventEmitter<any>(); | ||
|
||
constructor() {} | ||
|
||
onUnselectButtonClick() { | ||
this.unselectButton.emit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { IgoLanguageModule } from '@igo2/core'; | ||
|
||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { MatTooltipModule } from '@angular/material/tooltip'; | ||
|
||
import { HomeButtonComponent } from './home-button.component'; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
MatIconModule, | ||
MatButtonModule, | ||
MatTooltipModule, | ||
IgoLanguageModule | ||
], | ||
exports: [HomeButtonComponent], | ||
declarations: [HomeButtonComponent], | ||
providers: [] | ||
}) | ||
export class IgoHomeButtonModule {} |
16 changes: 16 additions & 0 deletions
16
packages/common/src/lib/home-button/home-button.theming.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@mixin igo-home-button-theming($theme) { | ||
$primary: map-get($theme, primary); | ||
$accent: map-get($theme, accent); | ||
$foreground: map-get($theme, foreground); | ||
|
||
igo-home-button > #homeButton { | ||
background-color: mat.get-color-from-palette($primary); | ||
color: mat.get-color-from-palette($primary, default-contrast); | ||
|
||
&:hover { | ||
background-color: mat.get-color-from-palette($accent, lighter); | ||
color: black; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './home-button.component'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters