Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: navbar component
  • Loading branch information
ayushhagarwal committed May 14, 2023
1 parent d960ae3 commit 5317789
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/app/app.component.html
@@ -1,3 +1,4 @@
<h1 class="text-3xl bg-slate-400 font-bold underline">
Hello this is typescript in action!
</h1>
<div class="h-screen w-screen bg-gray-400">
<app-navbar></app-navbar>
Hello this is a supercool pokemon project in making
</div>
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Expand Up @@ -3,7 +3,8 @@ import { PokemonService } from './service/pokemon.service';

@Component({
selector: 'app-root',
template: '<h1>{{ pokemonType }}</h1>',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
pokemonType: string;
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Expand Up @@ -5,10 +5,12 @@ import { AppComponent } from './app.component';

import { HttpClientModule } from '@angular/common/http';
import { PokemonService } from './service/pokemon.service';
import { NavbarComponent } from './components/navbar/navbar.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
NavbarComponent
],
imports: [
BrowserModule,
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions src/app/components/navbar/navbar.component.html
@@ -0,0 +1,10 @@
<nav class="flex items-center justify-between flex-wrap bg-teal-400 p-4">
<div class="flex items-center flex-shrink-0 text-white mr-6">
<img
src="../../../assets/images/pokeball.svg"
alt="Pokeball"
class="w-10 h-10 mr-0.5"
/>
<span class="font-semibold text-xl tracking-tight">Pokemon</span>
</div>
</nav>
25 changes: 25 additions & 0 deletions src/app/components/navbar/navbar.component.spec.ts
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NavbarComponent } from './navbar.component';

describe('NavbarComponent', () => {
let component: NavbarComponent;
let fixture: ComponentFixture<NavbarComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ NavbarComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(NavbarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions src/app/components/navbar/navbar.component.ts
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
152 changes: 152 additions & 0 deletions src/assets/images/pokeball.svg
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 5317789

Please sign in to comment.