Skip to content

Commit

Permalink
fix(stories): Add DeleteIcon into CustomCard story
Browse files Browse the repository at this point in the history
fix #306
  • Loading branch information
dapi committed Jul 30, 2019
1 parent 4b2101b commit dcd6ab8
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 4 deletions.
23 changes: 22 additions & 1 deletion stories/CustomCard.story.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
import React from 'react'
import {storiesOf} from '@storybook/react'
import {MovableCardWrapper } from 'rt/styles/Base'
import DeleteButton from 'rt/widgets/DeleteButton'

import Board from '../src'
import Tag from 'rt/components/Card/Tag'

const CustomCard = ({onClick, className, name, cardStyle, body, dueOn, cardColor, subTitle, tagStyle, escalationText, tags}) => {
const CustomCard = ({
onClick,
className,
name,
cardStyle,
body,
dueOn,
cardColor,
subTitle,
tagStyle,
escalationText,
tags,
showDeleteButton,
onDelete,
}) => {
const clickDelete = e => {
onDelete()
e.stopPropagation()
}

return (
<MovableCardWrapper
onClick={onClick}
Expand All @@ -24,6 +44,7 @@ const CustomCard = ({onClick, className, name, cardStyle, body, dueOn, cardColor
}}>
<div style={{fontSize: 14, fontWeight: 'bold'}}>{name}</div>
<div style={{fontSize: 11}}>{dueOn}</div>
{showDeleteButton && <DeleteButton onClick={clickDelete} />}
</header>
<div style={{fontSize: 12, color: '#BD3B36'}}>
<div style={{color: '#4C4C4C', fontWeight: 'bold'}}>{subTitle}</div>
Expand Down
61 changes: 58 additions & 3 deletions tests/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14790,13 +14790,38 @@ exports[`Storyshots Custom Components Card 1`] = `
color: #000;
}

.c8 {
.c10 {
padding: 2px 3px;
border-radius: 3px;
margin: 2px 5px;
font-size: 70%;
}

.c8 {
text-align: center;
position: absolute;
top: -1px;
right: 2px;
cursor: pointer;
}

.c9 {
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
display: inline-block;
border: none;
font-size: 8px;
height: 15px;
line-height: 1px;
margin: 0 0 8px;
padding: 0;
text-align: center;
width: 15px;
background: inherit;
cursor: pointer;
opacity: 0;
}

.c6:hover .c9 {
opacity: 1;
}
Expand Down Expand Up @@ -15015,6 +15040,16 @@ exports[`Storyshots Custom Components Card 1`] = `
>
due in a day
</div>
<div
className="c8"
onClick={[Function]}
>
<button
className="c9"
>
</button>
</div>
</header>
<div
style={
Expand Down Expand Up @@ -15107,6 +15142,16 @@ exports[`Storyshots Custom Components Card 1`] = `
>
due now
</div>
<div
className="c8"
onClick={[Function]}
>
<button
className="c9"
>
</button>
</div>
</header>
<div
style={
Expand Down Expand Up @@ -15229,6 +15274,16 @@ exports[`Storyshots Custom Components Card 1`] = `
>
due in a day
</div>
<div
className="c8"
onClick={[Function]}
>
<button
className="c9"
>
</button>
</div>
</header>
<div
style={
Expand Down Expand Up @@ -15285,7 +15340,7 @@ exports[`Storyshots Custom Components Card 1`] = `
}
>
<span
className="c8"
className="c10"
style={
Object {
"backgroundColor": "red",
Expand All @@ -15297,7 +15352,7 @@ exports[`Storyshots Custom Components Card 1`] = `
Critical
</span>
<span
className="c8"
className="c10"
style={
Object {
"backgroundColor": "#0079BF",
Expand Down

0 comments on commit dcd6ab8

Please sign in to comment.