Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions src/app/notes/components/note/note.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,34 @@
<mat-card-title>
<button mat-icon-button type="button" (click)="navigateToPreviousPage() " class="btn-back">
<mat-icon aria-label="An icon-button with a arrow icon">keyboard_arrow_left</mat-icon>
</button>
{{note.title}}
</button>

<textarea
matInput
[value]="note.title"
matTextareaAutosize
matAutosizeMinRows="1"
matAutosizeMaxRows="2"
placeholder="Title"
(blur)="updateNoteTitle($event)"></textarea>
</mat-card-title>
</mat-card-header>

<mat-card-content>
<p *ngIf="note.description">
<span>{{note.description}}</span>
</p>
<div class="note-field">
<mat-form-field
floatLabel="never"
color="accent">
<textarea matInput
placeholder="Add note..."
matTextareaAutosize
matAutosizeMinRows="2"
matAutosizeMaxRows="5"
[value]="note.description || null"
(blur)="updateNoteDescription($event)"></textarea>
</mat-form-field>
</div>

<span *ngIf="note.dueDate" class="note-metadata note-duedate">
<mat-icon>flag</mat-icon> {{note.dueDate | date}}

Expand Down
16 changes: 16 additions & 0 deletions src/app/notes/components/note/note.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,20 @@ export class NoteComponent implements OnInit {
dueDate: event.value
});
}

updateNoteDescription(e) {
if (e.target.value.trim().length) {
this.noteDoc.update({
description: e.target.value
});
}
}

updateNoteTitle(e) {
if (e.target.value.trim().length) {
this.noteDoc.update({
title: e.target.value
});
}
}
}
49 changes: 44 additions & 5 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ body {
color: #FFF;
}
}

.mat-card {
.mat-card-header-text {
align-items: center;
display: flex;
}
}

@media screen and (max-width: $break-small) {
.mat-card-avatar {
height: 30px;
width: 30px;
}
}
}

app-note {
Expand All @@ -96,6 +110,36 @@ body {
}
}

.note-field {
.mat-form-field {
display: block;
font-size: 16px;

.mat-form-field-wrapper {
padding: 16px;

.mat-form-field-infix {
border: 0 none;
margin: 0;
padding: 0;
}
}

.mat-form-field-underline {
display: none;
}

@media screen and (max-width: $break-small) {
font-size: 12px;

.mat-form-field-wrapper {
padding-left: 12px;
padding-right: 12px;
}
}
}
}

.mat-card {
max-width: 80%;
margin: 2em auto;
Expand Down Expand Up @@ -144,11 +188,6 @@ body {
background-color: rgba(0,0,0,.03);
padding: 24px 8px;

.mat-card-header-text {
align-items: center;
display: flex;
}

.mat-card-title {
color: rgba(0,0,0,.54);
font-size: 20px;
Expand Down