-
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.
* Add `CheckButton` component * Update task client functions * Add `onSubmit` callback prop to `TaskForm` and update comments * Improve backend comments * Use `data-testid` instead of querying by label text
- Loading branch information
Showing
12 changed files
with
116 additions
and
20 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 @@ | ||
.button { | ||
background-color: transparent; | ||
border: none; | ||
} |
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,36 @@ | ||
import React from "react"; | ||
import styles from "src/components/CheckButton.module.css"; | ||
|
||
export interface CheckButtonProps { | ||
checked: boolean; | ||
disabled?: boolean; | ||
onPress?: () => void; | ||
className?: string; | ||
} | ||
|
||
/** | ||
* See `src/components/Button.tsx` for an explanation of `React.forwardRef`. | ||
* This component uses two SVG images to display the checked/unchecked icons. | ||
* Both come from the `public` folder--thanks to Create React App, anything in | ||
* that folder is automatically made available as a public file, so it's a good | ||
* place to store static icons and images. (You can also view the icons directly | ||
* in your browser by visiting, say, `localhost:3000/checkButton.checked.svg`.) | ||
*/ | ||
export const CheckButton = React.forwardRef<HTMLButtonElement, CheckButtonProps>( | ||
function CheckButton({ checked, disabled, onPress, className }: CheckButtonProps, ref) { | ||
let buttonClass = styles.button; | ||
if (className) { | ||
buttonClass += ` ${className}`; | ||
} | ||
return ( | ||
<button ref={ref} disabled={disabled} onClick={onPress} className={buttonClass}> | ||
<img | ||
src={checked ? "/checkButton.checked.svg" : "/checkButton.unchecked.svg"} | ||
alt="" | ||
width={28} | ||
height={28} | ||
/> | ||
</button> | ||
); | ||
}, | ||
); |
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