Skip to content

Commit 9c08784

Browse files
Criados os componentes responsáveis pela visualização dos detalhes dos restaurantes, além do carrinho de pedidos, navegação ainda está estática
1 parent 4a631e1 commit 9c08784

11 files changed

+219
-5
lines changed

src/app/app.module.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { ROUTES } from './app.routes';
1212
import { RestaurantsComponent } from './restaurants/restaurants.component';
1313
import { RestaurantComponent } from './restaurants/restaurant/restaurant.component';
1414
import { RestaurantService } from './restaurants/restaurant/restaurant.service';
15-
import { RestaurantDetailComponent } from './restaurant/restaurant-detail/restaurant-detail.component';
15+
import { RestaurantDetailComponent } from './restaurant-detail/restaurant-detail.component';
16+
import { MenuComponent } from './restaurant-detail/menu/menu.component';
17+
import { ShoppingCartComponent } from './restaurant-detail/shopping-cart/shopping-cart.component';
18+
import { MenuItemComponent } from './restaurant-detail/menu-item/menu-item.component';
1619

1720

1821
@NgModule({
@@ -23,7 +26,10 @@ import { RestaurantDetailComponent } from './restaurant/restaurant-detail/restau
2326
AboutComponent,
2427
RestaurantsComponent,
2528
RestaurantComponent,
26-
RestaurantDetailComponent
29+
RestaurantDetailComponent,
30+
MenuComponent,
31+
ShoppingCartComponent,
32+
MenuItemComponent
2733
],
2834
imports: [
2935
BrowserModule,

src/app/app.routes.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import { Routes } from "@angular/router";
22
import { HomeComponent } from "./home/home.component";
33
import { AboutComponent } from "./about/about.component";
44
import { RestaurantsComponent } from "./restaurants/restaurants.component";
5+
import { RestaurantDetailComponent } from "./restaurant-detail/restaurant-detail.component";
56

67
export const ROUTES: Routes = [
78
{path: '', component: HomeComponent},
8-
{path: 'about', component: AboutComponent},
9-
{path: 'restaurants', component: RestaurantsComponent}
9+
{path: 'restaurants', component: RestaurantsComponent},
10+
{path: 'restaurants/:id', component: RestaurantDetailComponent},
11+
{path: 'about', component: AboutComponent}
12+
1013
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
menu-item works!
3+
</p>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-menu-item',
5+
templateUrl: './menu-item.component.html'
6+
})
7+
export class MenuItemComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--INÍCIO DO MENU -->
2+
<div class="col-md-9 col-xs-12">
3+
4+
<div class="menu-item-info-box">
5+
<span class="menu-item-info-box-icon"><img src="assets/img/foods/cupcake.png"></span>
6+
7+
<div class="menu-item-info-box-content">
8+
<span class="menu-item-info-box-text">Cup Cake</span>
9+
<span class="menu-item-info-box-detail">Cup Cake recheado de Doce de Leite</span>
10+
<span class="menu-item-info-box-price">R$ 10,00</span>
11+
<a class=""><i class="fa fa-plus-circle"></i> Adicionar</a>
12+
</div>
13+
<!-- /.info-box-content -->
14+
</div>
15+
<!-- /.info-box -->
16+
17+
<div class="menu-item-info-box">
18+
<span class="menu-item-info-box-icon"><img src="assets/img/foods/donut.png"></span>
19+
20+
<div class="menu-item-info-box-content">
21+
<span class="menu-item-info-box-text">Donut</span>
22+
<span class="menu-item-info-box-detail">Coberto com chantilly</span>
23+
<span class="menu-item-info-box-price">R$ 10,00</span>
24+
<a class=""><i class="fa fa-plus-circle"></i> Adicionar</a>
25+
</div>
26+
<!-- /.info-box-content -->
27+
</div>
28+
<!-- /.info-box -->
29+
30+
<div class="menu-item-info-box">
31+
<span class="menu-item-info-box-icon"><img src="assets/img/foods/croissant.png"></span>
32+
33+
<div class="menu-item-info-box-content">
34+
<span class="menu-item-info-box-text">Croissant</span>
35+
<span class="menu-item-info-box-detail">Recheado com queijo e presunto</span>
36+
<span class="menu-item-info-box-price">R$ 10,00</span>
37+
<a class=""><i class="fa fa-plus-circle"></i> Adicionar</a>
38+
</div>
39+
<!-- /.info-box-content -->
40+
</div>
41+
<!-- /.info-box -->
42+
43+
</div>
44+
<div class="col-md-3 col-xs-12">
45+
<mt-shopping-cart></mt-shopping-cart>
46+
</div>
47+
<!-- FIM DO MENU -->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-menu',
5+
templateUrl: './menu.component.html'
6+
})
7+
export class MenuComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!-- INÍCIO DO CONTEÚDO -->
2+
<section class="content-header">
3+
<h1>
4+
5+
</h1>
6+
</section>
7+
8+
9+
<section class="content">
10+
11+
<div class="row">
12+
<div class="col-xs-12">
13+
<div class="box box-solid">
14+
<div class="box-header with-border">
15+
<i class="fa fa-home"></i>
16+
17+
<h3 class="box-title">Bread &amp; Brakery</h3><span class="pull-right"><i class="fa fa-star"></i> 4.5</span>
18+
</div>
19+
<!-- /.box-header -->
20+
<div class="box-body">
21+
<div class="col-sm-3 col-xs-12">
22+
<img class="box-img-detail" src="assets/img/restaurants/breadbakery.png" />
23+
</div>
24+
25+
<dl class="col-sm-9 col-xs-12">
26+
<dt>Categoria</dt>
27+
<dd>Padaria</dd>
28+
<dt>Quem somos</dt>
29+
<dd>A Bread &amp; Brakery tem 40 anos de mercado. Fazemos os melhores doces e pães. Compre e confira.</dd>
30+
<dt>Horários</dt>
31+
<dd>Funciona de segunda à sexta, de 8h às 23h</dd>
32+
</dl>
33+
</div>
34+
<!-- /.box-body -->
35+
<div class="box-footer detail-footer">
36+
<a class="pull-left detail-active" href="detail-restaurant.html">
37+
Menu
38+
</a>
39+
<a class="pull-right" href="detail-restaurant-reviews.html">
40+
Avaliações
41+
</a>
42+
</div>
43+
</div>
44+
</div>
45+
<!-- /.col-xs-12 -->
46+
47+
</div>
48+
49+
50+
<div class="row">
51+
<mt-menu></mt-menu>
52+
</div>
53+
54+
</section>
55+
<!-- FIM DO CONTEÚDO -->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-restaurant-detail',
5+
templateUrl: './restaurant-detail.component.html'
6+
})
7+
export class RestaurantDetailComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--INICIO DO CARRINHO-->
2+
<div class="box box-solid">
3+
<div class="box-header">
4+
<i class="fa fa-shopping-cart"></i>
5+
6+
<h3 class="box-title">Carrinho</h3>
7+
</div>
8+
<!-- /.box-header -->
9+
<div class="box-body">
10+
<div class="table-responsive">
11+
<table class="table">
12+
<tbody>
13+
<tr>
14+
<th style="width:60%">Cerveja:</th>
15+
16+
<td class="text-right">R$ 6,00</td>
17+
18+
</tr>
19+
<tr>
20+
<th>Pork Burger</th>
21+
22+
<td class="text-right">R$ 22,00</td>
23+
</tr>
24+
<tr>
25+
<th>Frete:</th>
26+
27+
<td class="text-right">R$ 8,00</td>
28+
</tr>
29+
<tr>
30+
<th>Total:</th>
31+
32+
<td class="text-right">R$ 80,90</td>
33+
</tr>
34+
</tbody></table>
35+
</div>
36+
</div>
37+
<div class="box-footer">
38+
<div class="pull-right">
39+
<button type="button" class="btn btn-danger"><i class="fa fa-trash"></i> Limpar</button>
40+
<a href="order.html" class="btn btn-success"><i class="fa fa-credit-card"></i> Fechar Pedido</a>
41+
</div>
42+
</div>
43+
</div>
44+
<!-- FIM DO CARRINHO -->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-shopping-cart',
5+
templateUrl: './shopping-cart.component.html'
6+
})
7+
export class ShoppingCartComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}

0 commit comments

Comments
 (0)