Skip to content

Commit 185f601

Browse files
authored
Merge pull request #429 from kaizumaki/feature/issue-428-calender-ui
カレンダーまわりのUIをFigmaに合わせて修正
2 parents bf81488 + 3ba719c commit 185f601

File tree

4 files changed

+59
-26
lines changed

4 files changed

+59
-26
lines changed

src/assets/locales/ja.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"default": "何らかのエラーが発生しました。時間をおいて再度お試しください。"
1515
}
1616
},
17+
"calender": {
18+
"prev_week": "前の週",
19+
"next_week": "次の週",
20+
"to_today": "今日へ移動"
21+
},
1722
"footer": {
1823
"about": "おうちで時間割について",
1924
"contact": "お問い合わせ",

src/components/CalendarBar.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
<template>
22
<v-container fill-height class="calendar-bar">
3+
<v-row justify="space-between" class="pa-0 ma-0">
4+
<v-btn text color="#0071C2" @click="dateListWindow.prevList">
5+
<v-icon>mdi-menu-left</v-icon>
6+
{{ $t('common.calender.prev_week') }}
7+
</v-btn>
8+
<v-btn text color="#0071C2" @click="$emit('showCalender')">
9+
{{ fmtym(dateListWindow.currentDate) }}
10+
<v-icon>mdi-calendar-today</v-icon>
11+
</v-btn>
12+
<v-btn text color="#0071C2" @click="dateListWindow.nextList">
13+
{{ $t('common.calender.next_week') }}
14+
<v-icon>mdi-menu-right</v-icon>
15+
</v-btn>
16+
</v-row>
317
<v-row align="center" class="pa-0 ma-0">
418
<v-col cols="1" class="pa-0 ma-1">
519
<v-card class="calendar-bar-ym" flat>
@@ -262,6 +276,10 @@ export default class CalendarBar extends Vue {
262276
return format(date, 'yyyy-MM-dd HH:mm:ss EEE')
263277
}
264278
279+
fmtym(date: Date): String {
280+
return format(date, 'yyyy年M月', { locale: ja })
281+
}
282+
265283
fmtISO(date: Date): String {
266284
return formatISO(date)
267285
}

src/layouts/classes.vue

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@
55
v-model="date"
66
locale="ja"
77
first-day-of-week="1"
8+
width="100%"
9+
class="mb-4"
810
@input="openCalenderDialog = false"
911
/>
12+
<base-action-button
13+
theme="secondary"
14+
:text="$t('common.calender.to_today')"
15+
@click="
16+
date = new Date()
17+
openCalenderDialog = false
18+
"
19+
/>
1020
</v-dialog>
1121
<base-dialog
1222
v-model="openClassIdDialog"
@@ -48,21 +58,11 @@
4858
<v-overlay :value="loading" color="#0071C2" opacity="1" z-index="9999">
4959
<div class="loader">Loading</div>
5060
</v-overlay>
51-
<v-app-bar fixed app class="bar" elevation="0">
61+
<v-app-bar fixed app class="bar" elevation="0" extension-height="83">
5262
<HeaderLogo />
5363
<AppLanguageSelector />
5464
<v-spacer />
5565
<div class="classes-buttons">
56-
<v-btn
57-
fab
58-
small
59-
outlined
60-
rounded
61-
color="#0071C2"
62-
@click="openCalenderDialog = true"
63-
>
64-
<v-icon>mdi-calendar-today</v-icon>
65-
</v-btn>
6666
<v-btn
6767
fab
6868
small
@@ -76,7 +76,10 @@
7676
</div>
7777
<template v-slot:extension>
7878
<div class="header-calender">
79-
<CalendarBar v-model="app.currentDate" />
79+
<CalendarBar
80+
v-model="app.currentDate"
81+
@showCalender="openCalenderDialog = true"
82+
/>
8083
</div>
8184
</template>
8285
</v-app-bar>
@@ -95,6 +98,7 @@ import AppLanguageSelector from '@/components/AppLanguageSelector.vue'
9598
import HeaderLogo from '@/assets/svgs/header_logo.svg'
9699
import CalendarBar from '@/components/CalendarBar.vue'
97100
import BaseDialog from '@/components/BaseDialog.vue'
101+
import BaseActionButton from '@/components/BaseActionButton.vue'
98102
import { vxm } from '@/store'
99103
100104
type LocalData = {
@@ -113,6 +117,7 @@ export default Vue.extend({
113117
CalendarBar,
114118
BaseDialog,
115119
HeaderLogo,
120+
BaseActionButton,
116121
},
117122
data(): LocalData {
118123
return {
@@ -174,7 +179,7 @@ export default Vue.extend({
174179
margin: 0 auto;
175180
width: 100%;
176181
max-width: 640px;
177-
height: 40px;
182+
height: 100%;
178183
}
179184
.classes-container {
180185
height: 100%;

src/layouts/protected.vue

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@
55
v-model="date"
66
locale="ja"
77
first-day-of-week="1"
8+
width="100%"
9+
class="mb-4"
810
@input="openCalenderDialog = false"
911
/>
12+
<base-action-button
13+
theme="secondary"
14+
:text="$t('common.calender.to_today')"
15+
@click="
16+
date = new Date()
17+
openCalenderDialog = false
18+
"
19+
/>
1020
</v-dialog>
1121
<base-dialog
1222
v-model="openClassIdDialog"
@@ -41,21 +51,11 @@
4151
<v-overlay :value="loading" color="#0071C2" opacity="1" z-index="9999">
4252
<div class="loader">Loading</div>
4353
</v-overlay>
44-
<v-app-bar fixed app class="bar" elevation="0">
54+
<v-app-bar fixed app class="bar" elevation="0" extension-height="83">
4555
<HeaderLogo />
4656
<AppLanguageSelector />
4757
<v-spacer />
4858
<div class="admin-buttons">
49-
<v-btn
50-
fab
51-
x-small
52-
outlined
53-
rounded
54-
color="#0071C2"
55-
@click="openCalenderDialog = true"
56-
>
57-
<v-icon>mdi-calendar-today</v-icon>
58-
</v-btn>
5959
<v-btn
6060
fab
6161
x-small
@@ -79,7 +79,10 @@
7979
</div>
8080
<template v-slot:extension>
8181
<div class="header-calender">
82-
<CalendarBar v-model="app.currentDate" />
82+
<CalendarBar
83+
v-model="app.currentDate"
84+
@showCalender="openCalenderDialog = true"
85+
/>
8386
</div>
8487
</template>
8588
</v-app-bar>
@@ -99,6 +102,7 @@ import AppLanguageSelector from '@/components/AppLanguageSelector.vue'
99102
import HeaderLogo from '@/assets/svgs/header_logo.svg'
100103
import CalendarBar from '@/components/CalendarBar.vue'
101104
import BaseDialog from '@/components/BaseDialog.vue'
105+
import BaseActionButton from '@/components/BaseActionButton.vue'
102106
103107
type LocalData = {
104108
loading: boolean
@@ -114,6 +118,7 @@ export default Vue.extend({
114118
CalendarBar,
115119
BaseDialog,
116120
HeaderLogo,
121+
BaseActionButton,
117122
},
118123
data(): LocalData {
119124
return {
@@ -173,7 +178,7 @@ export default Vue.extend({
173178
margin: 0 auto;
174179
width: 100%;
175180
max-width: 640px;
176-
height: 40px;
181+
height: 100%;
177182
}
178183
.classes-container {
179184
height: 100%;

0 commit comments

Comments
 (0)