Skip to content

Commit

Permalink
Merge pull request #118 from e-picsa/fix/option-tool-icons
Browse files Browse the repository at this point in the history
Add some icons to mat stepper
  • Loading branch information
chrismclarke authored Apr 12, 2023
2 parents b6e865f + 9b6df2d commit a4757e0
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 183 deletions.
26 changes: 26 additions & 0 deletions apps/picsa-tools/option-tool/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Component } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { MatIconRegistry } from '@angular/material/icon';


@Component({
selector: 'option-root',
Expand All @@ -7,4 +10,27 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'picsa-tools-option-tool';

constructor(
private matIconRegistry: MatIconRegistry,
private domSanitizer: DomSanitizer
) {
this.registerIcons();
}
// register custom icons from the assets/svgs folder for access within the app
// icons can be accessed in mat-icon as svgIcon='station_data_${key}'
registerIcons() {
const icons = {
female: 'female',
male: 'male'
};
for (const [key, value] of Object.entries(icons)) {
const iconName = `picsa_options_${key}`;
const iconUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(
`assets/svgs/${value}.svg`
);
this.matIconRegistry.addSvgIcon(iconName, iconUrl);
}
}

}
6 changes: 5 additions & 1 deletion apps/picsa-tools/option-tool/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import { BrowserModule } from '@angular/platform-browser';
import { EditorComponent } from './components/editor/editor.component';
import { FormsModule } from '@angular/forms';
import { HomeComponent } from './pages/home/home.component';
import { HttpClientModule } from '@angular/common/http';

import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { OptionMaterialModule } from './material.module';
import { ReactiveFormsModule} from '@angular/forms';


@NgModule({
declarations: [AppComponent, HomeComponent, EditorComponent],
imports: [BrowserModule, OptionMaterialModule, FormsModule, ReactiveFormsModule,BrowserAnimationsModule,NoopAnimationsModule],
imports: [BrowserModule, OptionMaterialModule, FormsModule, HttpClientModule, ReactiveFormsModule,BrowserAnimationsModule,NoopAnimationsModule],
providers: [],
bootstrap: [AppComponent],
})
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


.dialog-content {
padding-bottom: 2rem;
.saveButtonPosition {
position: absolute;
left: 20px;
Expand All @@ -39,6 +40,10 @@
align-items: center;
justify-content: center;
flex-direction: column;
// .rain-icon{
// font-size: 50px;
// color: black;
// }

.form-group {
// width: 500px;
Expand All @@ -55,9 +60,33 @@
input.form-control {
font-size: 16px;
outline-color: #8a2644;
padding: 10px;
padding: 5px;
width: 90%;
}
textarea.form-control {
font-size: 16px;
outline-color: #8a2644;
padding: 5px;
white-space: pre-wrap;
word-wrap: break-word;
vertical-align: top;
}
.delete-button{
color: red;
background-color: white;
padding: 3px;
height: 6rem;
width: 4rem;
font-weight: 700;
display: flex;
border-radius: 5px;
gap: 5px;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid red;
}


.ButtonSection {
width: 15rem;
Expand All @@ -82,6 +111,7 @@
display: flex;
border-radius: 5px;
margin: 2px;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
Expand Down
5 changes: 2 additions & 3 deletions apps/picsa-tools/option-tool/src/app/material.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ import { NgModule } from '@angular/core';

import { MatButtonModule } from '@angular/material/button';
import { MatDialogModule } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatStepperModule } from '@angular/material/stepper';
import { MatTableModule } from '@angular/material/table';



const COMPONENTS = [
MatButtonModule,
MatDialogModule,
MatIconModule,
MatStepperModule,
MatTableModule,
];

// use custom module to make it easier to control what is available through app
@NgModule({
imports: COMPONENTS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ th {
.container {
position: relative;
height: 100vh;
overflow: auto;
background-color: #fff;
width: 100%;
z-index: 20;
Expand All @@ -20,7 +21,7 @@ th {
padding-top: 2rem;
top: 0;
right: 0;

}
.buttonposition{
position: absolute;
Expand Down
15 changes: 15 additions & 0 deletions apps/picsa-tools/option-tool/src/assets/svgs/female.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions apps/picsa-tools/option-tool/src/assets/svgs/male.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4757e0

Please sign in to comment.