Skip to content

Commit 0ba174e

Browse files
authored
Merge branch 'development' into feature/85-from-cookie-to-localstorage
2 parents dff3467 + 52b2fea commit 0ba174e

File tree

12 files changed

+328
-291
lines changed

12 files changed

+328
-291
lines changed

functions/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
"cookieparser": "^0.1.0",
2323
"core-js": "3.6.5",
2424
"cross-env": "^7.0.2",
25+
"date-fns": "^2.14.0",
2526
"dayjs": "^1.8.26",
2627
"express": "^4.17.1",
2728
"firebase-admin": "^8.11.0",
2829
"firebase-functions": "^3.6.1",
29-
"firebase": "^7.14.2",
30+
"firebase": "^7.14.3",
3031
"js-cookie": "^2.2.1",
3132
"jwt-decode": "^2.2.0",
3233
"lodash.clonedeep": "^4.5.0",
@@ -35,6 +36,7 @@
3536
"nuxt-svg-loader": "^1.2.0",
3637
"nuxt-webfontloader": "^1.1.0",
3738
"uuid": "^8.0.0",
39+
"vue-property-decorator": "^8.4.2",
3840
"vuex-class-component": "^2.3.2",
3941
"vuex-persistedstate": "^3.0.1"
4042
},

src/assets/svgs/header_logo.svg

Lines changed: 30 additions & 0 deletions
Loading

src/components/AddButton.vue

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,7 @@
66
:height="buttonSize"
77
@click="onClick"
88
>
9-
<span v-if="iconSize === 'x-small'">
10-
<v-icon :color="iconColor" x-small>{{ iconName }}</v-icon>
11-
</span>
12-
<span v-if="iconSize === 'small'">
13-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
14-
</span>
15-
<span v-if="iconSize === 'medium'">
16-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
17-
</span>
18-
<span v-if="iconSize === 'large'">
19-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
20-
</span>
21-
<span v-if="iconSize === 'x-large'">
22-
<v-icon :color="iconColor" x-large>{{ iconName }}</v-icon>
23-
</span>
9+
<v-icon :size="iconSize" :color="iconColor">{{ iconName }}</v-icon>
2410
</v-btn>
2511
</template>
2612

@@ -51,14 +37,9 @@ export default Vue.extend({
5137
default: '#004170'
5238
},
5339
iconSize: {
54-
type: String,
40+
type: [String, Number],
5541
required: false,
56-
default: 'medium',
57-
validator(value: string): boolean {
58-
return ['x-small', 'small', 'medium', 'large', 'x-large'].includes(
59-
value
60-
)
61-
}
42+
default: '40'
6243
}
6344
},
6445
methods: {

src/components/CalendarBar.vue

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<v-container fill-height class="calendar-bar">
33
<v-row align="center" class="pa-0 ma-0">
44
<v-col cols="1" class="pa-0 ma-1">
5-
<v-card class="calendar-bar-ym" flat="true">
5+
<v-card class="calendar-bar-ym" flat>
66
<v-card-title class="calendar-bar-ym-title">
77
{{ currentMonthString }}
88
</v-card-title>
@@ -13,7 +13,7 @@
1313
</v-col>
1414
<v-col
1515
v-for="date in dateListWindow.list"
16-
:key="date"
16+
:key="fmtft(date)"
1717
v-touch="{
1818
left: () => dateListWindow.nextList(),
1919
right: () => dateListWindow.prevList()
@@ -23,7 +23,6 @@
2323
>
2424
<v-card
2525
class="calendar-bar-date elevation-4"
26-
flat="false"
2726
:class="{
2827
current: fmtft(date) === fmtft(dateListWindow.currentDate)
2928
}"
@@ -195,10 +194,19 @@ class DateListWindowImpl implements DateListWindow {
195194
196195
@Component
197196
export default class CalendarBar extends Vue {
198-
@Prop({ default: new Date() }) date: Date | undefined
199-
@Prop({ default: { view: 'Week', startWeekOn: 'Monday' } }) config:
200-
| CalendarBarConfig
201-
| undefined
197+
@Prop({
198+
default() {
199+
return { view: 'Week', startWeekOn: 'Monday' }
200+
}
201+
})
202+
config: CalendarBarConfig | undefined
203+
204+
@Prop({
205+
default() {
206+
return new Date()
207+
}
208+
})
209+
public value!: Date
202210
203211
dateListWindow: DateListWindow = new DateListWindowImpl(
204212
this.config?.view ?? 'Week',
@@ -211,9 +219,19 @@ export default class CalendarBar extends Vue {
211219
return this.dateListWindow.currentDate
212220
}
213221
222+
private get date(): Date {
223+
return this.value
224+
}
225+
226+
@Emit()
227+
public input(value: Date) {
228+
return value
229+
}
230+
214231
@Watch('dateListWindow.currentDate', { immediate: true })
215232
// @Watch('dateListWindow.currentDate')
216233
onChangeCurrentDate() {
234+
this.input(this.dateListWindow.currentDate)
217235
this.changeCurrentDate()
218236
}
219237
@@ -247,14 +265,7 @@ export default class CalendarBar extends Vue {
247265
.calendar-bar {
248266
color: $color-white;
249267
font-size: small;
250-
background: linear-gradient(
251-
to bottom,
252-
$color-white 0%,
253-
$color-white 50%,
254-
$color-base-color-01 50%,
255-
$color-base-color-01 100%
256-
);
257-
padding: 0 3px;
268+
padding: 0 0;
258269
}
259270
260271
.calendar-bar-ym {
@@ -281,13 +292,15 @@ export default class CalendarBar extends Vue {
281292
.calendar-bar-ym-title {
282293
color: $color-base-color-01;
283294
font-size: 12px;
295+
font-weight: bold;
284296
padding: 8px 0 0 0;
285297
}
286298
287299
.calendar-bar-ym-subtitle {
288300
color: $color-white !important;
289301
font-size: 10px;
290-
padding: 8px 2px 16px;
302+
font-weight: bold;
303+
padding: 8px 2px 0;
291304
}
292305
293306
.calendar-bar-date {

src/components/LessonCaption.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export default Vue.extend({
5252
})
5353
</script>
5454

55-
<style scoped>
55+
<style lang="scss" scoped>
5656
.lessoncaption-title {
5757
display: flex;
5858
flex-direction: column;
59-
background: #015998;
60-
color: #fff;
59+
background: $color-base-color-07;
60+
color: $color-white;
6161
height: 66px;
6262
border-radius: 22px !important;
6363
margin: 0 8px;
@@ -71,7 +71,7 @@ export default Vue.extend({
7171
font-size: 28px;
7272
padding: 10px 2px 0 2px;
7373
display: flex;
74-
color: #fff !important;
74+
color: $color-white !important;
7575
align-items: center;
7676
text-align: center;
7777
}
@@ -80,7 +80,7 @@ export default Vue.extend({
8080
font-size: 8px;
8181
margin-top: 0;
8282
display: flex;
83-
color: #fff !important;
83+
color: $color-white !important;
8484
align-items: center;
8585
text-align: center;
8686
}
@@ -91,7 +91,7 @@ export default Vue.extend({
9191
font-weight: normal;
9292
font-size: 10px;
9393
text-align: center;
94-
color: #fff;
94+
color: $color-white;
9595
flex: none;
9696
order: 4;
9797
align-self: center;
Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
<template>
2-
<v-bottom-sheet v-model="sheet" persistent>
3-
<v-container class="simple-bottom-sheet">
4-
<v-row>
5-
<v-col class="message">{{ message }}</v-col>
6-
<v-col cols="2">
7-
<span class="abb-button">
8-
<AddButton @addButtonClicked="addButtonClicked" />
9-
</span>
10-
</v-col>
11-
</v-row>
12-
</v-container>
2+
<v-bottom-sheet v-model="sheet" class="sheet" persistent scrollable>
3+
<v-card class="card">
4+
<v-card-title class="card-title" />
5+
<v-card-text class="card-text">
6+
<v-container class="container">
7+
<v-row class="row">
8+
<v-col class="col message">{{ message }}</v-col>
9+
<v-col cols="2">
10+
<span class="add-button">
11+
<AddButton @addButtonClicked="addButtonClicked" />
12+
</span>
13+
</v-col>
14+
</v-row>
15+
</v-container>
16+
</v-card-text>
17+
</v-card>
1318
</v-bottom-sheet>
1419
</template>
1520

@@ -23,6 +28,7 @@ export default Vue.extend({
2328
props: {
2429
message: {
2530
type: String,
31+
default: 'メッセージ',
2632
required: true
2733
},
2834
expanded: {
@@ -38,32 +44,46 @@ export default Vue.extend({
3844
},
3945
methods: {
4046
addButtonClicked() {
41-
this.sheet = !this.sheet
4247
this.$emit('addButtonClicked')
4348
}
4449
}
4550
})
4651
</script>
4752

4853
<style lang="scss" scoped>
49-
.simple-bottom-sheet {
54+
.card {
5055
background-color: $color-base-color-07;
51-
color: $color-white;
52-
border-radius: 24px 24px 0 0;
56+
border-radius: 24px 24px 0 0 !important;
57+
}
58+
59+
.card-title {
60+
padding: 8px !important;
61+
}
62+
.card-text {
63+
padding: 0 !important;
64+
}
65+
66+
.container {
67+
padding: 0 16px 16px;
68+
}
69+
70+
.row {
71+
margin: 0;
72+
padding: 0;
73+
}
74+
75+
.col {
5376
padding: 0;
5477
}
5578
5679
.message {
57-
max-width: 90%;
58-
padding: 1rem 1.5rem;
5980
align-self: center;
81+
color: $color-white !important;
82+
font-family: 'Noto Sans JP', sans-serif;
6083
}
6184
6285
.add-button {
63-
max-width: 20%;
64-
margin: 0 12px;
65-
padding: 10px;
66-
align-self: end;
86+
align-self: start;
6787
float: right;
6888
}
6989
</style>

src/components/__tests__/CalendarBar.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ describe('CalendarBar.vue', () => {
6262
// 2020-05-08T10:00:00.000+0900
6363
const dt = new Date(2020, 4, 8, 10, 0, 0, 0)
6464
const wrapper = mountFunction({
65-
propsData: { date: dt, config: { view: 'V', startWeekOn: 'DOW' } }
65+
propsData: { value: dt, config: { view: 'V', startWeekOn: 'DOW' } }
6666
})
67-
expect(wrapper.props().date).toBe(dt)
67+
expect(wrapper.props().value).toBe(dt)
6868
expect(wrapper.props().config.view).toBe('V')
6969
expect(wrapper.props().config.startWeekOn).toBe('DOW')
7070
})
@@ -87,7 +87,7 @@ describe('CalendarBar.vue', () => {
8787

8888
wrapper = mountFunction({
8989
propsData: {
90-
date: dt,
90+
value: dt,
9191
config: { view: 'Day', startWeekOn: 'Sunday' }
9292
}
9393
})
@@ -97,7 +97,7 @@ describe('CalendarBar.vue', () => {
9797

9898
wrapper = mountFunction({
9999
propsData: {
100-
date: dt,
100+
value: dt,
101101
config: { view: 'Day', startWeekOn: 'Monday' }
102102
}
103103
})
@@ -118,7 +118,7 @@ describe('CalendarBar.vue', () => {
118118
new Date(2020, 4, 9, 10, 0, 0, 0)
119119
)
120120
const props = (pDate: Date, pDow: string) => ({
121-
date: pDate,
121+
value: pDate,
122122
config: { view: 'Week', startWeekOn: pDow }
123123
})
124124
let dateListWindow
@@ -234,7 +234,7 @@ describe('CalendarBar.vue', () => {
234234
new Date(2020, 4, 9, 10, 0, 0, 0)
235235
)
236236
const props = (pDate: Date, pDow: string) => ({
237-
date: pDate,
237+
value: pDate,
238238
config: { view: 'Weekday', startWeekOn: pDow }
239239
})
240240
let dateListWindow
@@ -300,7 +300,7 @@ describe('CalendarBar.vue', () => {
300300

301301
wrapper = mountFunction({
302302
propsData: {
303-
date: dt,
303+
value: dt,
304304
config: { view: 'Day', startWeekOn: 'Sunday' }
305305
}
306306
})
@@ -368,7 +368,7 @@ describe('CalendarBar.vue', () => {
368368

369369
wrapper = mountFunction({
370370
propsData: {
371-
date: dt,
371+
value: dt,
372372
config: { view: 'Week', startWeekOn: 'Sunday' }
373373
}
374374
})
@@ -438,7 +438,7 @@ describe('CalendarBar.vue', () => {
438438

439439
wrapper = mountFunction({
440440
propsData: {
441-
date: dt,
441+
value: dt,
442442
config: { view: 'Weekday', startWeekOn: 'Sunday' }
443443
}
444444
})

0 commit comments

Comments
 (0)