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 #470 from shikorism/feature/326-react-checkin-form
チェックインフォームをReactで作り替える
- Loading branch information
Showing
24 changed files
with
791 additions
and
592 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
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { CheckinForm } from './components/CheckinForm'; | ||
|
||
const initialState = JSON.parse(document.getElementById('initialState')?.textContent as string); | ||
ReactDOM.render(<CheckinForm initialState={initialState} />, document.getElementById('checkinForm')); |
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,25 @@ | ||
import React from 'react'; | ||
|
||
type CheckboxProps = { | ||
id: string; | ||
name: string; | ||
className?: string; | ||
checked?: boolean; | ||
onChange?: (newValue: boolean) => void; | ||
}; | ||
|
||
export const CheckBox: React.FC<CheckboxProps> = ({ id, name, className, checked, onChange, children }) => ( | ||
<div className={`custom-control custom-checkbox ${className}`}> | ||
<input | ||
id={id} | ||
name={name} | ||
type="checkbox" | ||
className="custom-control-input" | ||
checked={checked} | ||
onChange={(e) => onChange && onChange(e.target.checked)} | ||
/> | ||
<label className="custom-control-label" htmlFor={id}> | ||
{children} | ||
</label> | ||
</div> | ||
); |
Oops, something went wrong.