Added more components

This commit is contained in:
Lorenzo Iovino 2023-12-29 04:34:47 +01:00
parent c94493a3c5
commit 8b20acfcc4
28 changed files with 436 additions and 31 deletions

View file

@ -0,0 +1,17 @@
<!-- This is an example component -->
<div class="">
<div class="bg-white shadow-md border border-gray-200 rounded-lg max-w-sm mb-5">
<a href="/blog/{{post?.slug}}">
<img class="rounded-t-lg" src="{{post?.image}}" alt="">
</a>
<div class="p-5">
<a href="#">
<h5 class="text-gray-900 font-bold text-2xl tracking-tight mb-2">{{post?.title}}</h5>
</a>
<p class="font-normal text-gray-700 mb-3">{{post?.description}}</p>
<a class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-3 py-2 text-center inline-flex items-center" href="/blog/{{post?.slug}}">
Read more
</a>
</div>
</div>
</div>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PostCardComponent } from './post-card.component';
describe('PostCardComponent', () => {
let component: PostCardComponent;
let fixture: ComponentFixture<PostCardComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PostCardComponent]
})
.compileComponents();
fixture = TestBed.createComponent(PostCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,16 @@
import {Component, Input} from '@angular/core';
import {Post} from "../models/post";
import {JsonPipe} from "@angular/common";
@Component({
selector: 'iov-post-card',
standalone: true,
imports: [
JsonPipe
],
templateUrl: './post-card.component.html',
styleUrl: './post-card.component.scss'
})
export class PostCardComponent {
@Input() post: Post | undefined;
}