-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from aligent/fix/story-points-updates
Fix/story points updates
- Loading branch information
Showing
25 changed files
with
2,595 additions
and
1,583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { FC, Fragment, ReactNode, SyntheticEvent, useState } from 'react'; | ||
import { MdCheckCircle } from 'react-icons/md'; | ||
|
||
import { waitFor } from '@/utils'; | ||
|
||
interface ActionButtonProps { | ||
clickAction: (e: SyntheticEvent) => void; | ||
actionLabel: ReactNode; | ||
progressLabel?: string; | ||
className?: string; | ||
disabled?: boolean; | ||
} | ||
|
||
const ActionButton: FC<ActionButtonProps> = (props) => { | ||
const { | ||
clickAction, | ||
actionLabel, | ||
progressLabel = '', | ||
className = '', | ||
disabled = false, | ||
} = props; | ||
const [inProgress, setInProgress] = useState(false); | ||
|
||
const handleOnClick = async (e: SyntheticEvent) => { | ||
setInProgress(true); | ||
clickAction(e); | ||
await waitFor(700); | ||
setInProgress(false); | ||
}; | ||
|
||
return ( | ||
<button | ||
onClick={handleOnClick} | ||
type="button" | ||
className={className} | ||
disabled={disabled} | ||
> | ||
{inProgress && progressLabel ? ( | ||
<Fragment> | ||
<MdCheckCircle /> {progressLabel} | ||
</Fragment> | ||
) : ( | ||
<Fragment>{actionLabel}</Fragment> | ||
)} | ||
</button> | ||
); | ||
}; | ||
|
||
export default ActionButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './ActionButton'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.