This repository was archived by the owner on Jan 23, 2022. It is now read-only.
forked from annearbor/nuxt-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourseCard.stories.js
41 lines (38 loc) · 1.51 KB
/
CourseCard.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { storiesOf } from "@storybook/vue";
import { text, number, color } from "@storybook/addon-knobs";
import CourseCard from "@components/molecules/CourseCard";
import notes from "@docs/storybook/courseCard.md";
import { defaultCourse, courseOldDataFormat } from "./mockData/CourseCard";
storiesOf("5 Molecules/CourseCard", module)
.addParameters({
notes,
})
.add("CourseCard", () => ({
components: { CourseCard },
template: `<base-grid><CourseCard v-bind="course" /><CourseCard v-bind="course" /><CourseCard v-bind="course" /></base-grid>`,
data: () => ({
course: {
...defaultCourse,
teacherName: text("teacherName", defaultCourse.teacherName),
name: text("name", defaultCourse.name),
abbreviation: text("abbreviation", defaultCourse.abbreviation),
nextCourseTime: text("nextCourseTime", defaultCourse.nextCourseTime),
nextCourseRoom: text("nextCourseRoom", defaultCourse.nextCourseRoom),
color: color("Color", defaultCourse.color),
colorGradient: color("colorGradient", defaultCourse.colorGradient),
newAssignments: number("newAssignments", defaultCourse.newAssignments),
notification: number("notification", defaultCourse.notification),
alert: text("alert", defaultCourse.alert),
},
}),
}))
.add("CourseCard getting old data format", () => ({
components: { CourseCard },
template: '<base-grid><CourseCard v-bind="course" /></base-grid>',
data: () => ({
course: {
...courseOldDataFormat,
color: color("Color", courseOldDataFormat.color),
},
}),
}));