Skip to content

Commit

Permalink
add presentation stories
Browse files Browse the repository at this point in the history
  • Loading branch information
glenwid committed Jun 15, 2021
1 parent c9df677 commit fc96051
Showing 1 changed file with 53 additions and 15 deletions.
68 changes: 53 additions & 15 deletions src/stories/CodeReviewCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ const customComment1: CustomComment = {

const customComment2: CustomComment = {
line: 3,
author: 'Spock',
content: 'Live long and prosper.',
author: 'Lehrpersonal',
content: 'Dieser Teil ist ausbaufähig.',
type: 'comment',
timeAdded: moment().format('DD-MM-YY HH:mm')
}

const customComment3: CustomComment = {
line: 1,
author: 'Code Quality',
content: 'Syntaktischer Zucker in Linie 4',
content: 'Use const for readonly values.',
type: 'mildInfo',
timeAdded: moment().format('DD-MM-YY HH:mm')
}
Expand All @@ -121,8 +121,8 @@ const customComment4: CustomComment = {
}

const customComment5: CustomComment = {
author: 'Test1',
content: `All tests passed. Well done.`,
author: 'Test2',
content: `Test2 passed without error.`,
type: 'success',
timeAdded: moment().format('DD-MM-YY HH:mm')
}
Expand Down Expand Up @@ -190,17 +190,37 @@ const handleCommentDeleted = (
}
}

export const jsx = Template.bind({})
jsx.args = {
export const jsxWithResult = Template.bind({})
jsxWithResult.args = {
reviewProps: {
code: jsxCode,
language: 'jsx',
showResult: true,
commentContainer: customCommentContainer,
onCommentCreated: comment => handleCommentCreated(comment, jsx),
onCommentDeleted: comment => handleCommentDeleted(comment, jsx),
onCommentCreated: comment => handleCommentCreated(comment, jsxWithResult),
onCommentDeleted: comment => handleCommentDeleted(comment, jsxWithResult),
onCommentEdited: (oldComment, newComment) =>
handleCommentEdited(oldComment, newComment, jsxWithResult),
user: 'Storybook Tester',
role: 'student'
},
width: 700,
title: 'testReview.jsx'
}

export const jsxWithoutResult = Template.bind({})
jsxWithoutResult.args = {
reviewProps: {
code: jsxCode,
language: 'jsx',
showResult: false,
commentContainer: customCommentContainer,
onCommentCreated: comment =>
handleCommentCreated(comment, jsxWithoutResult),
onCommentDeleted: comment =>
handleCommentDeleted(comment, jsxWithoutResult),
onCommentEdited: (oldComment, newComment) =>
handleCommentEdited(oldComment, newComment, jsx),
handleCommentEdited(oldComment, newComment, jsxWithoutResult),
user: 'Storybook Tester',
role: 'student'
},
Expand All @@ -226,20 +246,38 @@ css.args = {
title: 'layout.css'
}

export const cpp = Template.bind({})
cpp.args = {
export const cppStudent = Template.bind({})
cppStudent.args = {
reviewProps: {
code: cppCode,
language: 'cpp',
showResult: false,
commentContainer: customCommentContainer,
onCommentCreated: comment => handleCommentCreated(comment, cpp),
onCommentDeleted: comment => handleCommentDeleted(comment, cpp),
onCommentCreated: comment => handleCommentCreated(comment, cppStudent),
onCommentDeleted: comment => handleCommentDeleted(comment, cppStudent),
onCommentEdited: (oldComment, newComment) =>
handleCommentEdited(oldComment, newComment, cpp),
handleCommentEdited(oldComment, newComment, cppStudent),
user: 'Storybook Tester',
role: 'student'
},
width: 700,
title: 'matrix.cpp'
}

export const cppTeacher = Template.bind({})
cppTeacher.args = {
reviewProps: {
code: cppCode,
language: 'cpp',
showResult: false,
commentContainer: customCommentContainer,
onCommentCreated: comment => handleCommentCreated(comment, cppTeacher),
onCommentDeleted: comment => handleCommentDeleted(comment, cppTeacher),
onCommentEdited: (oldComment, newComment) =>
handleCommentEdited(oldComment, newComment, cppTeacher),
user: 'Storybook Tester',
role: 'teacher'
},
width: 700,
title: 'matrix.cpp'
}

0 comments on commit fc96051

Please sign in to comment.