Skip to content

Commit 56868e2

Browse files
committed
Kitchen tweaks
1 parent 92995cb commit 56868e2

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

cypress/integration/kitchen.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Kitchen', () => {
1919
cy.press('Pa amb tomàquet');
2020

2121
// Act & Assert - Ingredients
22-
cy.press('Let\'s cook!');
22+
cy.press('Let\'s cook this!');
2323
cy.see('Mise en place');
2424
cy.see('Bread');
2525
cy.see('1 Tomato');
@@ -51,7 +51,7 @@ describe('Kitchen', () => {
5151
it('Uses timers', () => {
5252
// Arrange
5353
cy.press('Pa amb tomàquet');
54-
cy.press('Let\'s cook!');
54+
cy.press('Let\'s cook this!');
5555
cy.press('Next');
5656
cy.press('Show timers');
5757

@@ -77,7 +77,7 @@ describe('Kitchen', () => {
7777
it('Persists state', () => {
7878
// Arrange
7979
cy.press('Pa amb tomàquet');
80-
cy.press('Let\'s cook!');
80+
cy.press('Let\'s cook this!');
8181
cy.press('Bread');
8282
cy.press('Next');
8383
cy.press('Show timers');
@@ -97,7 +97,7 @@ describe('Kitchen', () => {
9797
cy.see('Timer 1');
9898

9999
cy.ariaLabel('Close the modal').click();
100-
cy.press('Show ingredients');
100+
cy.press('Previous');
101101

102102
cy.contains('label', 'Bread').within(() => {
103103
cy.get('input').should('match', ':checked');
@@ -112,12 +112,12 @@ describe('Kitchen', () => {
112112
cy.press('not now');
113113

114114
// Assert
115-
cy.dontSee('Let\'s cook!');
115+
cy.dontSee('Let\'s cook this!');
116116

117117
cy.go('back');
118118
cy.press('Pa amb tomàquet');
119119
cy.wait(1000);
120-
cy.dontSee('Let\'s cook!');
120+
cy.dontSee('Let\'s cook this!');
121121
});
122122

123123
});

src/components/AppHeader.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ const navigationButton = $computed(() => {
100100
return 'logo';
101101
});
102102
const backText = $computed(() => {
103-
if (Date.now()) {
104-
return 'Noel De Martin\'s Public Recipes';
105-
}
106-
107103
if (Viewer.active) {
108104
return collection?.name
109105
?? Viewer.collection?.name

src/routing/pages/kitchen/components/KitchenPage.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="w-full h-full overflow-auto">
1414
<div class="mx-auto max-w-4xl pt-4 pb-8 px-edge md:pt-10 min-h-full flex flex-col">
1515
<template v-if="recipe">
16-
<h1 class="text-gray-500 opacity-50 font-medium tracking-wide uppercase text-xs">
16+
<h1 class="text-gray-500 opacity-50 font-medium tracking-wide uppercase text-xs mr-8">
1717
{{ $t('kitchen.title', { recipe: recipe.name }) }}
1818
</h1>
1919
<h2 class="text-2xl font-semibold mt-4">
@@ -29,16 +29,7 @@
2929
</div>
3030
</div>
3131

32-
<div class="fixed bottom-24 right-8 md:top-32 md:bottom-auto md:right-12 flex flex-col space-y-4 z-10">
33-
<CoreButton
34-
v-if="showKitchenShortcut && $kitchen.dishes.length > 1"
35-
:title="$t('kitchen.index.show')"
36-
route="kitchen"
37-
secondary
38-
>
39-
<i-tabler-chef-hat-filled class="w-7 h-7" aria-hidden="true" />
40-
<span class="sr-only">{{ $t('kitchen.index.show') }}</span>
41-
</CoreButton>
32+
<div class="fixed bottom-24 right-8 flex flex-col-reverse space-y-4 space-y-reverse z-10 md:top-32 md:bottom-auto md:right-12 md:flex-col md:space-y-4">
4233
<CoreButton
4334
:title="$t('kitchen.timers.show')"
4435
secondary
@@ -53,6 +44,15 @@
5344
</span>
5445
</div>
5546
</CoreButton>
47+
<CoreButton
48+
v-if="showKitchenShortcut && $kitchen.dishes.length > 1"
49+
:title="$t('kitchen.index.show')"
50+
route="kitchen"
51+
secondary
52+
>
53+
<i-tabler-chef-hat-filled class="w-7 h-7" aria-hidden="true" />
54+
<span class="sr-only">{{ $t('kitchen.index.show') }}</span>
55+
</CoreButton>
5656
</div>
5757
</div>
5858
</template>

src/routing/pages/kitchen/components/KitchenTimer.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
{{ time }}
1010
</span>
1111
</div>
12-
<div class="flex space-x-2 self-center mt-1">
12+
<div
13+
class="flex self-center mt-1"
14+
:class="{
15+
'flex-col space-y-2 md:flex-row md:space-y-0 md:space-x-2': timer.isPaused(),
16+
'space-x-2': !timer.isPaused(),
17+
}"
18+
>
1319
<CoreButton
1420
v-if="timer.isPaused()"
1521
secondary
@@ -63,15 +69,15 @@
6369
@click="deleteTimer()"
6470
>
6571
<i-pepicons-trash class="w-4 h-4" aria-hidden="true" />
66-
<span class="sr-only">
72+
<span class="md:sr-only ml-1 text-xs uppercase font-medium" :class="{ 'sr-only': !timer.isPaused() }">
6773
{{ $t('kitchen.timers.delete') }}
6874
</span>
6975
</CoreButton>
7076
</div>
7177
</div>
72-
<div v-if="timer.hasStarted() && !timer.isOverTime()" class="mt-1 w-full h-2 rounded-full bg-gray-200 relative">
78+
<div v-if="timer.hasStarted() && !timer.isOverTime()" class="mt-1 w-full h-2 rounded-full bg-gray-200 relative overflow-hidden">
7379
<div
74-
class="h-full rounded-full absolute left-0 top-0"
80+
class="h-full absolute left-0 top-0"
7581
:style="`width: ${(timer.duration - timer.getTimeLeft()) * 100 / timer.duration}%`"
7682
:class="{
7783
'bg-primary-500': !timer.isPaused(),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const KITCHEN_TRANSITION_DURATION = 600;
1+
export const KITCHEN_TRANSITION_DURATION = 400;

src/services/KitchenService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export default class CookbookService extends Service<State, ComputedState, Persi
128128
public async complete(dish: Dish): Promise<void> {
129129
this.setState({
130130
dishes: arrayWithout(this.dishes, dish),
131-
timers: this.timers.filter(timer => !timer.hasDish(dish)),
131+
timers: this.dishes.length === 0
132+
? []
133+
: this.timers.filter(timer => !timer.hasDish(dish)),
132134
});
133135

134136
if (this.dishes.length === 0) {

0 commit comments

Comments
 (0)