Skip to content

Commit

Permalink
cleanup and change styles
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheihuzarevich committed Mar 6, 2024
1 parent d91cdae commit 7368e0c
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 10 deletions.
Empty file removed src/app/app.component.css
Empty file.
1 change: 0 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RouterOutlet } from '@angular/router';
standalone: true,
imports: [ RouterOutlet ],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@if (form) {
<ng-container [formGroup]="form">
<button class="create-button" (click)="createScheduleItem()">Create New</button>

<mat-card class="calendar-card">
<date-picker formControlName="startDate"></date-picker>
</mat-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
box-shadow: none;
}

.create-button {
font-family: Roboto;
border: none;
background: white;
outline: none;
padding: 10px;
color: #3c4043;
font-size: 12px;
font-weight: 500;
border-radius: 16px;
text-transform: uppercase;
box-shadow: var(--box-shadow);
cursor: pointer;

&:hover {
background: var(--hovered-background-color);
}
}

.employees-card {
padding: 0;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ChangeDetectionStrategy,
Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild,
Component, EventEmitter, OnDestroy, OnInit, Output,
} from '@angular/core';
import { MatCard, MatCardHeader } from '@angular/material/card';
import { MatCalendar, MatCalendarBody } from '@angular/material/datepicker';
Expand All @@ -11,6 +11,7 @@ import { EmployeeService } from '../../employee.service';
import { startWith, Subscription } from 'rxjs';
import { IActionPanelValue } from './i-action-panel-value';
import { DatePickerComponent } from '../date-picker/date-picker.component';
import { MatButton } from '@angular/material/button';

interface IFormValue {
startDate: Date;
Expand All @@ -23,7 +24,6 @@ interface IFormValue {
styleUrl: './action-panel.component.scss',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,

imports: [
MatCard,
MatCalendar,
Expand All @@ -32,7 +32,8 @@ interface IFormValue {
ReactiveFormsModule,
MatCardHeader,
MatCalendarBody,
DatePickerComponent
DatePickerComponent,
MatButton
]
})
export class ActionPanelComponent implements OnInit, OnDestroy {
Expand All @@ -47,7 +48,7 @@ export class ActionPanelComponent implements OnInit, OnDestroy {
public valueChange: EventEmitter<IActionPanelValue> = new EventEmitter<IActionPanelValue>();

constructor(
private employeeService: EmployeeService
private employeeService: EmployeeService,
) {
}

Expand Down Expand Up @@ -87,6 +88,10 @@ export class ActionPanelComponent implements OnInit, OnDestroy {
this.form?.get('startDate')?.setValue(date);
}

public createScheduleItem(): void {
alert('create');
}

public ngOnDestroy(): void {
this.subscriptions.unsubscribe();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</mat-card>
}
<mat-menu #menu="matMenu">
<button mat-menu-item>Edit</button>
<button mat-menu-item>Delete</button>
<button mat-menu-item (click)="editScheduleItem()">Edit</button>
<button mat-menu-item (click)="deleteScheduleItem()">Delete</button>
</mat-menu>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ export class ScheduleItemComponent {
public viewModel: IScheduleItem | undefined;

constructor(
private elementReference: ElementRef<HTMLElement>
private elementReference: ElementRef<HTMLElement>
) {
}

public editScheduleItem(): void {
alert('edit');
}

public deleteScheduleItem(): void {
alert('delete');
}
}
14 changes: 13 additions & 1 deletion src/styles/_material.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.cdk-overlay-backdrop {
background: transparent;
}

.mdc-dialog {

.mat-mdc-dialog-surface {
box-shadow: var(--box-shadow) !important;
border-radius: 8px;
}
}

.mat-calendar {
--mat-datepicker-calendar-date-selected-state-background-color: var(--blue-color);
--mat-datepicker-toggle-active-state-icon-color: var(--blue-color);
Expand Down Expand Up @@ -51,7 +63,7 @@
}

.mat-mdc-menu-panel {
box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12) !important;
box-shadow: var(--box-shadow) !important;
border-radius: 4px !important;
min-width: 190px !important;

Expand Down
2 changes: 2 additions & 0 deletions src/styles/_colors.scss → src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

--text-color: #5f6368;
--hovered-background-color: #5F63680A;

--box-shadow: 0px 1px 2px 0px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);
}
2 changes: 1 addition & 1 deletion src/styles/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "colors";
@import "variables";
@import "material";

html, body {
Expand Down

0 comments on commit 7368e0c

Please sign in to comment.