@@ -17,11 +17,13 @@ import { isUndefined } from "src/utils";
1717import { Phases } from "components/Phase" ;
1818
1919import { IBaseMaintenanceButton } from "." ;
20+ import { Link } from "react-router-dom" ;
2021
2122const StyledButton = styled ( Button ) `
2223 width: 100%;
2324` ;
2425
26+ const StyledLabel = styled . label `` ;
2527interface IDrawButton extends IBaseMaintenanceButton {
2628 numberOfVotes ?: string ;
2729 period ?: string ;
@@ -40,6 +42,11 @@ const DrawButton: React.FC<IDrawButton> = ({ id, numberOfVotes, setIsOpen, perio
4042 [ maintenanceData , isDrawn , phase , period ]
4143 ) ;
4244
45+ const needToPassPhase = useMemo (
46+ ( ) => ! isUndefined ( maintenanceData ) && ! isDrawn && period === Period . Evidence && phase !== Phases . drawing ,
47+ [ maintenanceData , isDrawn , phase , period ]
48+ ) ;
49+
4350 const {
4451 data : drawConfig ,
4552 isLoading : isLoadingConfig ,
@@ -68,7 +75,17 @@ const DrawButton: React.FC<IDrawButton> = ({ id, numberOfVotes, setIsOpen, perio
6875 setIsOpen ( false ) ;
6976 } ) ;
7077 } ;
71- return < StyledButton text = "Draw" small isLoading = { isLoading } disabled = { isDisabled } onClick = { handleClick } /> ;
78+ return (
79+ < >
80+ { needToPassPhase ? (
81+ < StyledLabel >
82+ Jurors can be drawn in < small > drawing</ small > phase.
83+ < br /> Pass phase < Link to = "/courts/1/purpose/#maintenance" > here</ Link > .
84+ </ StyledLabel >
85+ ) : null }
86+ < StyledButton text = "Draw" small isLoading = { isLoading } disabled = { isDisabled } onClick = { handleClick } />
87+ </ >
88+ ) ;
7289} ;
7390
7491export default DrawButton ;
0 commit comments