File tree Expand file tree Collapse file tree 2 files changed +55
-4
lines changed Expand file tree Collapse file tree 2 files changed +55
-4
lines changed Original file line number Diff line number Diff line change 88 Box ,
99 VisuallyHidden ,
1010} from '@chakra-ui/react' ;
11- import { BellIcon } from '@chakra-ui/icons' ;
11+ import { StarIcon } from '@chakra-ui/icons' ;
1212
1313export const Task = ( {
1414 task : { id, title, state } ,
@@ -47,8 +47,7 @@ export const Task = ({
4747 flex = "1 1 auto"
4848 color = { state === 'TASK_ARCHIVED' ? 'gray.400' : 'gray.700' }
4949 textDecoration = { state === 'TASK_ARCHIVED' ? 'line-through' : 'none' }
50- fontSize = "md"
51- fontWeight = "bold"
50+ fontSize = "sm"
5251 isTruncated
5352 value = { title }
5453 onChange = { ( e ) => onEditTitle ( e . target . value , id ) }
@@ -59,7 +58,7 @@ export const Task = ({
5958 flex = "none"
6059 aria-label = { state === 'TASK_PINNED' ? 'unpin' : 'pin' }
6160 variant = { state === 'TASK_PINNED' ? 'unpin' : 'pin' }
62- icon = { < BellIcon /> }
61+ icon = { < StarIcon /> }
6362 onClick = { ( ) => onTogglePinTask ( state , id ) }
6463 />
6564 </ Flex >
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { Task } from './Task' ;
3+
4+ export default {
5+ component : Task ,
6+ title : 'Task' ,
7+ argTypes : {
8+ onArchiveTask : { action : 'onArchiveTask' } ,
9+ onTogglePinTask : { action : 'onTogglePinTask' } ,
10+ onEditTitle : { action : 'onEditTitle' } ,
11+ } ,
12+ } ;
13+
14+ const Template = ( args ) => < Task { ...args } /> ;
15+
16+ export const Default = Template . bind ( { } ) ;
17+ Default . args = {
18+ task : {
19+ id : '1' ,
20+ title : 'Buy milk' ,
21+ state : 'TASK_INBOX' ,
22+ } ,
23+ } ;
24+
25+ export const Pinned = Template . bind ( { } ) ;
26+ Pinned . args = {
27+ task : {
28+ id : '2' ,
29+ title : 'QA dropdown' ,
30+ state : 'TASK_PINNED' ,
31+ } ,
32+ } ;
33+
34+ export const Archived = Template . bind ( { } ) ;
35+ Archived . args = {
36+ task : {
37+ id : '3' ,
38+ title : 'Write schema for account menu' ,
39+ state : 'TASK_ARCHIVED' ,
40+ } ,
41+ } ;
42+
43+ const longTitleString = `This task's name is absurdly large. In fact, I think if I keep going I might end up with content overflow. What will happen? The star that represents a pinned task could have text overlapping. The text could cut-off abruptly when it reaches the star. I hope not!` ;
44+
45+ export const LongTitle = Template . bind ( { } ) ;
46+ LongTitle . args = {
47+ task : {
48+ id : '4' ,
49+ title : longTitleString ,
50+ state : 'TASK_INBOX' ,
51+ } ,
52+ } ;
You can’t perform that action at this time.
0 commit comments