Skip to content

Commit 9e6f77d

Browse files
authored
Merge pull request #139 from Nekoya3/feature/137-add-editing-screen-action
editing screenの中身を作る
2 parents 961999e + 6273fe9 commit 9e6f77d

22 files changed

+982
-231
lines changed

src/components/ContentCard.vue

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,89 @@
11
<template>
2-
<v-card class="ContentCard elevation-4">
3-
<v-card-actions class="ContentCard-Actions">
4-
<subject-tag
5-
v-for="(item, idx) in subjects"
6-
:key="idx"
7-
class="ContentCard-SubjectTag"
8-
:name="item.name || '教科名'"
9-
:icon="item.icon || ''"
10-
:icon-color="item.iconColor || 'white'"
11-
:background-color="item.backgroundColor || '#A5D8FF'"
2+
<div class="ContentCard-Outer">
3+
<v-card class="ContentCard elevation-4">
4+
<v-card-actions class="ContentCard-Actions">
5+
<subject-tag
6+
class="ContentCard-SubjectTag"
7+
:name="lesson.subject.name || '教科名'"
8+
icon-color="white"
9+
:background-color="lesson.subject.color || '#A5D8FF'"
10+
/>
11+
<subject-tag
12+
v-if="lesson.videos.length > 0"
13+
class="ContentCard-SubjectTag"
14+
:name="'動画'"
15+
:icon="'mdi-video'"
16+
:icon-color="'#424242'"
17+
:background-color="'#E0E0E0'"
18+
/>
19+
</v-card-actions>
20+
<v-card-title>
21+
<h2 class="ContentCard-Title">{{ lesson.title }}</h2>
22+
</v-card-title>
23+
<v-card-text>
24+
<p class="ContentCard-Description">{{ lesson.description }}</p>
25+
</v-card-text>
26+
</v-card>
27+
<div v-if="editable" class="ContentCard-Button-Outer">
28+
<content-card-editor-button
29+
class="ContentCard-Button"
30+
icon-name="mdi-eye-off"
31+
@click="$emit('toggleHidden')"
1232
/>
13-
<subject-tag
14-
class="ContentCard-SubjectTag"
15-
:name="'動画'"
16-
:icon="'mdi-video'"
17-
:icon-color="'#424242'"
18-
:background-color="'#E0E0E0'"
33+
<content-card-editor-button
34+
class="ContentCard-Button"
35+
icon-name="mdi-pencil"
36+
@click="$emit('clickEditButton')"
1937
/>
20-
</v-card-actions>
21-
<v-card-title>
22-
<h2 class="ContentCard-Title">{{ title }}</h2>
23-
</v-card-title>
24-
<v-card-text>
25-
<p class="ContentCard-Description">{{ description }}</p>
26-
</v-card-text>
27-
</v-card>
38+
<!--
39+
<content-card-editor-button
40+
class="ContentCard-Button"
41+
icon-name="mdi-file-multiple"
42+
/>
43+
-->
44+
</div>
45+
</div>
2846
</template>
2947

3048
<script lang="ts">
3149
import Vue from 'vue'
3250
import SubjectTag from '@/components/SubjectTag.vue'
51+
import ContentCardEditorButton from '@/components/ContentCardEditorButton.vue'
52+
import { classData } from '~/types/store/classData'
3353
3454
export default Vue.extend({
35-
components: { SubjectTag },
55+
components: {
56+
SubjectTag,
57+
ContentCardEditorButton
58+
},
3659
props: {
37-
subjects: {
38-
type: Array,
39-
default: () => []
40-
},
41-
title: {
42-
type: String,
43-
default: ''
60+
lesson: {
61+
type: Object as () => classData.Lesson,
62+
required: true
4463
},
45-
description: {
46-
type: String,
47-
default: ''
64+
editable: {
65+
type: Boolean,
66+
default: false
4867
}
4968
}
5069
})
5170
</script>
5271

5372
<style scoped lang="scss">
73+
.ContentCard-Outer {
74+
display: flex;
75+
}
76+
.ContentCard-Button-Outer {
77+
display: flex;
78+
flex-direction: column;
79+
flex: 0 1 auto;
80+
margin-left: 12px;
81+
.ContentCard-Button {
82+
margin-bottom: 12px;
83+
}
84+
}
5485
.ContentCard {
86+
flex: 1 1 auto;
5587
color: $color-gray;
5688
border-radius: 14px !important;
5789
.ContentCard-Actions {

src/components/ContentCardEditable.vue

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/components/ContentCardEditorButton.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
2-
<v-btn class="editorButton" width="48px" height="48px">
2+
<v-btn
3+
class="editorButton"
4+
width="48px"
5+
height="48px"
6+
@click="$emit('click')"
7+
>
38
<v-icon :color="iconColor" :size="iconSize">{{ iconName }}</v-icon>
49
</v-btn>
510
</template>

0 commit comments

Comments
 (0)