Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Updated the daily quote section - added padding, colour and right-quote img #386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/app/components/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- navbar -->
<app-navbar></app-navbar>
<!-- main -->
<div class="container">
<div class="container pb-3">
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<h3 style="color: black;" class="block-with-username"><strong>Welcome {{Username}}!👋</strong></h3>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
Expand Down Expand Up @@ -96,8 +96,8 @@ <h5 class="error-label"><span class="badge badge-danger" id="error-label">Error

<!-- Quote -->
<footer class="quote mt-1 pb-0">
<span class="quoteText"><img src="https://img.icons8.com/fluent-systems-filled/24/000000/quote-left.png"/>{{quote?.text}}</span>
<span class="quoteAuthor">- {{quote?.author === "" ? 'Anonymous' : quote?.author}}</span>
<span class="quoteText"><img src="https://img.icons8.com/fluent-systems-filled/24/000000/quote-left.png"/>{{quote?.text}}<img src="https://img.icons8.com/fluent-systems-filled/24/000000/quote-right.png"/></span>
<span class="quoteAuthor pb-4">- {{quote?.author === "" ? 'Anonymous' : quote?.author}}</span>
</footer>


Expand Down
10 changes: 2 additions & 8 deletions src/app/components/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Router} from '@angular/router';
import { RestService } from 'src/app/services/rest.service';
import { DailyQuote } from 'src/interfaces/daily-quote';
import { FilterFolderPipe } from 'src/app/shared/filter-folder.pipe';
import quotes from 'src/interfaces/quotes';
declare var $: any;

@Component({
Expand Down Expand Up @@ -477,14 +478,7 @@ export class DashboardComponent implements OnInit {
}

getQuote() {
this.apiService.getDailyQuote()
.then((quote: DailyQuote) => {
this.quote = quote;
})
.catch((err) => {
// Here we store a random dummyQuote to the quote property.
this.quote = this.apiService.getDummyQuote();
});
this.quote = quotes[Math.floor(Math.random()*quotes.length)];
}

// Assign the selected colour to input value
Expand Down
98 changes: 98 additions & 0 deletions src/interfaces/quotes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
const quotes =
[
{
"text": "That is what learning is. You suddenly understand something you’ve understood all your life, but in a new way.",
"author": "Doris Lessing"
},
{
"text": "Live as if you were to die tomorrow. Learn as if you were to live forever.",
"author": "Mahatma Gandhi"
},
{
"text": "The more that you read, the more things you will know. The more that you learn, the more places you’ll go.",
"author": "Dr. Seus"
},
{
"text": "Tell me and I forget, teach me and I may remember, involve me and I learn.",
"author": "Benjamin Franklin"
},
{
"text": "Change is the end result of all true learning.",
"author": "Leo Buscaglia"
},
{
"text": "Learning never exhausts the mind.",
"author": "Leonardo da Vinci"
},
{
"text": "A wise man can learn more from a foolish question than a fool can learn from a wise answer.",
"author": "Bruce Lee"
},
{
"text": "Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young.",
"author": "Henry Ford"
},
{
"text": "Try to learn something about everything and everything about something.",
"author": "Thomas H. Huxley"
},
{
"text": "Learning is not attained by chance. It must be sought for with ardor and attended with diligence.",
"author": "Abigail Adams"
},
{
"text": "Learn as though you would never be able to master it; hold it as though you would be in fear of losing it.",
"author": "Confucius"
},
{
"text": "The capacity to learn is a gift; the ability to learn is a skill; the willingness to learn is a choice!",
"author": "Brian Herbert"
},
{
"text": "There is no end to education. The whole of life, from the moment you are born to the moment you die, is a process of learning.",
"author": "Jiddu Krishnamurti"
},{
"text": "One learns from books and example only that certain things can be done. Actual learning requires that you do those things.",
"author": "Frank Herbert"
},{
"text": "You don’t understand anything until you learn it more than one way.",
"author": "Marvin Minsky"
},{
"text": "Spoon feeding in the long run teaches us nothing but the shape of the spoon.",
"author": "E. M. Forster"
},{
"text": "In the end we retain from our studies only that which we practically apply.",
"author": "Johann Wolfgang Von Goethe"
},{
"text": "Study hard what interests you the most in the most undisciplined, irreverent and original manner possible.",
"author": "Richard Feynman"
},{
"text": "Being a student is easy. Learning requires actual work.",
"author": "William Crawford"
},{
"text": "The great aim of education is not knowledge but action.",
"author": "Herbert Spencer"
},{
"text": "If you think education is expensive, try estimating the cost of ignorance.",
"author": "Howard Gardner"
},{
"text": "The ability to speak exactly is intimately related to the ability to know exactly.",
"author": "Wendell Berry"
},{
"text": "The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn.",
"author": "Alvin Toffler"
}
]

export default quotes;