feat(navbar): add navbar component and update dashboard layout

This commit is contained in:
Jan K9f 2025-01-19 21:59:45 +01:00
commit ebe251c149
Signed by: jank
GPG key ID: 50620ADD22CD330B
10 changed files with 189 additions and 161 deletions

View file

@ -1,24 +1,27 @@
<div class="overflow-x-auto">
<table class="table">
<!-- head -->
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Url</th>
<th>Short Url</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
@for (link of links; track link) {
<tr class="bg-base-200">
<th>{{link.id}}</th>
<td>{{link.name}}</td>
<td>{{link.url}}</td>
<td>Not done yet</td>
</tr>
}
</tbody>
</table>
<div class="mx-auto container">
<app-navbar></app-navbar>
<div class="overflow-x-auto">
<table class="table">
<!-- head -->
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Url</th>
<th>Short Url</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
@for (link of links; track link) {
<tr class="bg-base-200">
<th>{{link.id}}</th>
<td>{{link.name}}</td>
<td><a href="{{link.link}}">{{link.link}}</a></td>
<td>ndy</td>
</tr>
}
</tbody>
</table>
</div>
</div>

View file

@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import { LinkService } from '../service/link.service';
import { RecordModel } from 'pocketbase';
import { NavbarComponent } from '../navbar/navbar.component';
@Component({
selector: 'app-dashboard',
imports: [],
imports: [NavbarComponent],
templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.css'
})

View file

View file

@ -0,0 +1,52 @@
<div class="navbar bg-base-100 rounded-2xl shadow-xl my-3 z-100">
<div class="navbar-start">
<div class="dropdown">
<div tabindex="0" role="button" class="btn btn-ghost lg:hidden">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h8m-8 6h16" />
</svg>
</div>
<ul
tabindex="0"
class="menu menu-sm dropdown-content bg-base-100 rounded-box z-[10000] mt-3 w-52 p-2 shadow">
<li><a>Dashboard</a></li>
<li>
<a>Parent</a>
<ul class="p-2">
<li><a>Submenu 1</a></li>
<li><a>Submenu 2</a></li>
</ul>
</li>
<li><a>Item 3</a></li>
</ul>
</div>
<a class="btn btn-ghost text-xl">jklink</a>
</div>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
<li><a>Item 1</a></li>
<li>
<details>
<summary>Parent</summary>
<ul class="p-2">
<li><a>Submenu 1</a></li>
<li><a>Submenu 2</a></li>
</ul>
</details>
</li>
<li><a>Item 3</a></li>
</ul>
</div>
<div class="navbar-end">
<a class="btn">Button</a>
</div>
</div>

View file

@ -0,0 +1,23 @@
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({
imports: [NavbarComponent]
})
.compileComponents();
fixture = TestBed.createComponent(NavbarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,12 @@
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'app-navbar',
imports: [],
templateUrl: './navbar.component.html',
styleUrl: './navbar.component.css',
encapsulation: ViewEncapsulation.None,
})
export class NavbarComponent {
}

View file

@ -1,5 +1,5 @@
<!doctype html>
<html class="h-full bg-white" lang="en">
<html class="h-full" lang="en" data-theme="light">
<head>
<meta charset="utf-8">
<title>Jklink</title>
@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body class="h-full" data-theme="light">
<body class="h-full base-100" >
<app-root></app-root>
</body>
</html>