-
Notifications
You must be signed in to change notification settings - Fork 481
/
ParentLetter.story.jsx
75 lines (69 loc) · 1.74 KB
/
ParentLetter.story.jsx
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import PropTypes from 'prop-types';
import {UnconnectedParentLetter as ParentLetter} from './ParentLetter';
import {SectionLoginType} from '../../util/sharedConstants';
import wizardPng from '../../../static/skins/studio/wizard_thumb.png';
export default storybook => {
storybook = storybook.storiesOf('ParentLetter', module);
const sampleSection = {
id: 7,
code: 'ABCDEF'
};
const sampleStudents = [
{
id: 100,
name: 'Neville',
secret_picture_path: wizardPng,
secret_words: 'wizarding world'
},
{
id: 101,
name: 'Hermione',
secret_picture_path: wizardPng,
secret_words: 'wizarding world'
}
];
// Make stories for generic letters and personalized letters
// Make a story for every login type
Object.values(SectionLoginType).forEach(loginType => {
storybook = storybook.add(`Generic / ${loginType}`, () => (
<Page>
<ParentLetter
section={{
...sampleSection,
loginType: loginType
}}
teacherName="Minerva McGonagall"
/>
</Page>
));
storybook = storybook.add(`Personalized / ${loginType}`, () => (
<Page>
<ParentLetter
section={{
...sampleSection,
loginType: loginType
}}
teacherName="Minerva McGonagall"
students={sampleStudents}
studentId={'101'}
/>
</Page>
));
});
};
const Page = ({children}) => (
<div
style={{
backgroundColor: 'white',
width: '8.5in',
height: '11in',
padding: '1in',
margin: '0.25in',
border: 'solid gray thin'
}}
>
{children}
</div>
);
Page.propTypes = {children: PropTypes.node};