feat(account-page): implement account layout with sidebar, profile form, and purchase list components
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="account-layout">
|
||||||
|
<app-account-sidebar class="account-sidebar"></app-account-sidebar>
|
||||||
|
<div class="account-content">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
.account-layout {
|
||||||
|
display: flex;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 40px 20px;
|
||||||
|
gap: 40px;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
min-height: calc(100vh - 100px);
|
||||||
|
}
|
||||||
|
.account-sidebar {
|
||||||
|
width: 250px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.account-content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
@@ -6,31 +6,7 @@ import { AccountSidebar } from '../components/account-sidebar/account-sidebar';
|
|||||||
selector: 'app-account-layout',
|
selector: 'app-account-layout',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterOutlet, AccountSidebar],
|
imports: [RouterOutlet, AccountSidebar],
|
||||||
template: `
|
templateUrl: './account-layout.html',
|
||||||
<div class="account-layout">
|
styleUrl: './account-layout.scss',
|
||||||
<app-account-sidebar class="account-sidebar"></app-account-sidebar>
|
|
||||||
<div class="account-content">
|
|
||||||
<router-outlet></router-outlet>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.account-layout {
|
|
||||||
display: flex;
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 40px 20px;
|
|
||||||
gap: 40px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
min-height: calc(100vh - 100px);
|
|
||||||
}
|
|
||||||
.account-sidebar {
|
|
||||||
width: 250px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.account-content {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class AccountLayout {}
|
export class AccountLayout {}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<div class="sidebar-container">
|
||||||
|
<h2 class="sidebar-title">MI CUENTA</h2>
|
||||||
|
<div class="divider"></div>
|
||||||
|
<nav class="sidebar-nav">
|
||||||
|
<a routerLink="/mi-cuenta/datos-personales" routerLinkActive="active" class="nav-link">Datos Personales</a>
|
||||||
|
<a routerLink="/mi-cuenta/compras" routerLinkActive="active" class="nav-link">Mis compras</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
.sidebar-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.sidebar-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1a1a1a;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.sidebar-nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.nav-link {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #888;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
.nav-link:hover {
|
||||||
|
color: #5a5a5a;
|
||||||
|
}
|
||||||
|
.nav-link.active {
|
||||||
|
color: #5b75ff; /* Blue color matching the image */
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
@@ -5,51 +5,7 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
|
|||||||
selector: 'app-account-sidebar',
|
selector: 'app-account-sidebar',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterLink, RouterLinkActive],
|
imports: [RouterLink, RouterLinkActive],
|
||||||
template: `
|
templateUrl: './account-sidebar.html',
|
||||||
<div class="sidebar-container">
|
styleUrl: './account-sidebar.scss',
|
||||||
<h2 class="sidebar-title">MI CUENTA</h2>
|
|
||||||
<div class="divider"></div>
|
|
||||||
<nav class="sidebar-nav">
|
|
||||||
<a routerLink="/mi-cuenta/datos-personales" routerLinkActive="active" class="nav-link">Datos Personales</a>
|
|
||||||
<a routerLink="/mi-cuenta/compras" routerLinkActive="active" class="nav-link">Mis compras</a>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.sidebar-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.sidebar-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #1a1a1a;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.divider {
|
|
||||||
height: 1px;
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.sidebar-nav {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
.nav-link {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #888;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: color 0.2s;
|
|
||||||
}
|
|
||||||
.nav-link:hover {
|
|
||||||
color: #5a5a5a;
|
|
||||||
}
|
|
||||||
.nav-link.active {
|
|
||||||
color: #5b75ff; /* Blue color matching the image */
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class AccountSidebar {}
|
export class AccountSidebar {}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<form [formGroup]="profileForm" class="profile-form">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Nombre y Apellido:</label>
|
||||||
|
<app-input
|
||||||
|
type="text"
|
||||||
|
placeholder="Descripción"
|
||||||
|
[value]="profileForm.controls['fullName'].value"
|
||||||
|
(valueChange)="profileForm.controls['fullName'].setValue($event)"
|
||||||
|
></app-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Email:</label>
|
||||||
|
<app-input
|
||||||
|
type="email"
|
||||||
|
placeholder="Descripción"
|
||||||
|
[value]="profileForm.controls['email'].value"
|
||||||
|
(valueChange)="profileForm.controls['email'].setValue($event)"
|
||||||
|
></app-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>DNI:</label>
|
||||||
|
<app-input
|
||||||
|
type="text"
|
||||||
|
placeholder="Descripción"
|
||||||
|
[value]="profileForm.controls['dni'].value"
|
||||||
|
(valueChange)="profileForm.controls['dni'].setValue($event)"
|
||||||
|
></app-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Teléfono:</label>
|
||||||
|
<app-input
|
||||||
|
type="text"
|
||||||
|
placeholder="Descripción"
|
||||||
|
[value]="profileForm.controls['phone'].value"
|
||||||
|
(valueChange)="profileForm.controls['phone'].setValue($event)"
|
||||||
|
></app-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Contraseña:</label>
|
||||||
|
<app-input
|
||||||
|
type="password"
|
||||||
|
placeholder="Descripción"
|
||||||
|
[value]="profileForm.controls['password'].value"
|
||||||
|
(valueChange)="profileForm.controls['password'].setValue($event)"
|
||||||
|
></app-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<app-button type="button" variant="cancel" hostClass="action-btn">Cancelar</app-button>
|
||||||
|
<app-button type="submit" variant="primary" hostClass="action-btn">Guardar</app-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
.profile-form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.form-group label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.form-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
.action-btn {
|
||||||
|
flex: 1;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
@@ -7,90 +7,8 @@ import { ButtonComponent } from '../../../../../../shared/components/button/butt
|
|||||||
selector: 'app-profile-form',
|
selector: 'app-profile-form',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ReactiveFormsModule, InputComponent, ButtonComponent],
|
imports: [ReactiveFormsModule, InputComponent, ButtonComponent],
|
||||||
template: `
|
templateUrl: './profile-form.html',
|
||||||
<form [formGroup]="profileForm" class="profile-form">
|
styleUrl: './profile-form.scss',
|
||||||
<div class="form-group">
|
|
||||||
<label>Nombre y Apellido:</label>
|
|
||||||
<app-input
|
|
||||||
type="text"
|
|
||||||
placeholder="Descripción"
|
|
||||||
[value]="profileForm.controls['fullName'].value"
|
|
||||||
(valueChange)="profileForm.controls['fullName'].setValue($event)"
|
|
||||||
></app-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Email:</label>
|
|
||||||
<app-input
|
|
||||||
type="email"
|
|
||||||
placeholder="Descripción"
|
|
||||||
[value]="profileForm.controls['email'].value"
|
|
||||||
(valueChange)="profileForm.controls['email'].setValue($event)"
|
|
||||||
></app-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>DNI:</label>
|
|
||||||
<app-input
|
|
||||||
type="text"
|
|
||||||
placeholder="Descripción"
|
|
||||||
[value]="profileForm.controls['dni'].value"
|
|
||||||
(valueChange)="profileForm.controls['dni'].setValue($event)"
|
|
||||||
></app-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Teléfono:</label>
|
|
||||||
<app-input
|
|
||||||
type="text"
|
|
||||||
placeholder="Descripción"
|
|
||||||
[value]="profileForm.controls['phone'].value"
|
|
||||||
(valueChange)="profileForm.controls['phone'].setValue($event)"
|
|
||||||
></app-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Contraseña:</label>
|
|
||||||
<app-input
|
|
||||||
type="password"
|
|
||||||
placeholder="Descripción"
|
|
||||||
[value]="profileForm.controls['password'].value"
|
|
||||||
(valueChange)="profileForm.controls['password'].setValue($event)"
|
|
||||||
></app-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-actions">
|
|
||||||
<app-button type="button" variant="cancel" hostClass="action-btn">Cancelar</app-button>
|
|
||||||
<app-button type="submit" variant="primary" hostClass="action-btn">Guardar</app-button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.profile-form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
max-width: 500px;
|
|
||||||
}
|
|
||||||
.form-group {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.form-group label {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
.form-actions {
|
|
||||||
display: flex;
|
|
||||||
gap: 12px;
|
|
||||||
margin-top: 16px;
|
|
||||||
}
|
|
||||||
.action-btn {
|
|
||||||
flex: 1;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class ProfileForm {
|
export class ProfileForm {
|
||||||
profileForm: FormGroup;
|
profileForm: FormGroup;
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<div class="purchase-item">
|
||||||
|
<div class="purchase-info">
|
||||||
|
<span class="purchase-id">Compra {{ purchase.id }}.</span>
|
||||||
|
<span class="purchase-date">Fecha de compra: {{ purchase.date }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="purchase-action">
|
||||||
|
<span class="arrow-icon">›</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="purchase-list-container">
|
||||||
|
<app-purchase-list-item
|
||||||
|
*ngFor="let purchase of purchases"
|
||||||
|
[purchase]="purchase">
|
||||||
|
</app-purchase-list-item>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.purchase-list-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
@@ -6,21 +6,8 @@ import { PurchaseListItem } from '../purchase-list-item/purchase-list-item';
|
|||||||
selector: 'app-purchase-list',
|
selector: 'app-purchase-list',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, PurchaseListItem],
|
imports: [CommonModule, PurchaseListItem],
|
||||||
template: `
|
templateUrl: './purchase-list.html',
|
||||||
<div class="purchase-list-container">
|
styleUrl: './purchase-list.scss',
|
||||||
<app-purchase-list-item
|
|
||||||
*ngFor="let purchase of purchases"
|
|
||||||
[purchase]="purchase">
|
|
||||||
</app-purchase-list-item>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.purchase-list-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class PurchaseList {
|
export class PurchaseList {
|
||||||
purchases = [
|
purchases = [
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div class="page-container">
|
||||||
|
<h2 class="page-title">DATOS PERSONALES</h2>
|
||||||
|
<app-profile-form></app-profile-form>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.page-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.page-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #888;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
@@ -5,23 +5,7 @@ import { ProfileForm } from '../../components/profile-form/profile-form';
|
|||||||
selector: 'app-profile-page',
|
selector: 'app-profile-page',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ProfileForm],
|
imports: [ProfileForm],
|
||||||
template: `
|
templateUrl: './profile-page.html',
|
||||||
<div class="page-container">
|
styleUrl: './profile-page.scss',
|
||||||
<h2 class="page-title">DATOS PERSONALES</h2>
|
|
||||||
<app-profile-form></app-profile-form>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.page-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.page-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #888;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class ProfilePage {}
|
export class ProfilePage {}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div class="page-container">
|
||||||
|
<h2 class="page-title">MIS COMPRAS</h2>
|
||||||
|
<app-purchase-list></app-purchase-list>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.page-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.page-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #888;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
@@ -5,23 +5,7 @@ import { PurchaseList } from '../../components/purchase-list/purchase-list';
|
|||||||
selector: 'app-purchases-page',
|
selector: 'app-purchases-page',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [PurchaseList],
|
imports: [PurchaseList],
|
||||||
template: `
|
templateUrl: './purchases-page.html',
|
||||||
<div class="page-container">
|
styleUrl: './purchases-page.scss',
|
||||||
<h2 class="page-title">MIS COMPRAS</h2>
|
|
||||||
<app-purchase-list></app-purchase-list>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: `
|
|
||||||
.page-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.page-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #888;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class PurchasesPage {}
|
export class PurchasesPage {}
|
||||||
|
|||||||
Reference in New Issue
Block a user