This repository was archived by the owner on Dec 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +39
-5
lines changed
screens/hours/components/HoursCard Expand file tree Collapse file tree 4 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,21 @@ import React from 'react';
22
33import './CircleButton.less' ;
44
5- export default function CircleButton ( { children, onClick } ) {
5+ import cn from '../../helpers/ClassNameHelper' ;
6+
7+ interface CircleButtonProps {
8+ className : string ;
9+ onClick : ( ) => void ;
10+ children : React . ReactNode ;
11+ }
12+
13+ export default function CircleButton ( {
14+ className,
15+ children,
16+ onClick,
17+ } : CircleButtonProps ) {
618 return (
7- < span className = " circle-button" onClick = { onClick } >
19+ < span className = { cn ( ' circle-button' , className ) } onClick = { onClick } >
820 { children }
921 </ span >
1022 ) ;
Original file line number Diff line number Diff line change 1+ function cn ( ...classes : ( string | undefined | null | boolean ) [ ] ) {
2+ return classes . filter ( ( i ) => ! ! i ) . join ( ' ' ) ;
3+ }
4+
5+ export default cn ;
Original file line number Diff line number Diff line change 22 width : 300px ;
33}
44
5- .hours-card__icon {
5+ .hours-card .ant-card-body {
6+ display : flex ;
7+ flex-direction : row ;
8+ }
9+
10+ .hours-card__info {
11+ flex : 1 ;
12+ }
13+
14+ .hours-card__button {
15+ display : none ;
16+ }
17+
18+ .hours-card :hover .hours-card__button {
19+ display : inline-flex ;
20+ }
21+
22+ .anticon.hours-card__icon {
623 color : white ;
724}
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ export default observer(function HoursCard({ taskTime }: HoursCardProps) {
3737
3838 return (
3939 < Card className = "hours-card" >
40- < div >
40+ < div className = "hours-card__info" >
4141 < div > { task . title } </ div >
4242 < div > { `${ timeFormat ( time [ 0 ] ) } - ${ timeFormat ( time [ 1 ] ) } ` } </ div >
4343 </ div >
44- < CircleButton onClick = { handleClick } >
44+ < CircleButton onClick = { handleClick } className = "hours-card__button" >
4545 { ! task . active ? (
4646 < CaretRightFilled className = "hours-card__icon" />
4747 ) : (
You can’t perform that action at this time.
0 commit comments