forked from seanpdoyle/select-your-own-seat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For comparison [see this commit][commit] Nothing exciting here. The ergonomics is similar to the Stimulus version. [commit]: seanpdoyle@752ef6d
- Loading branch information
Showing
10 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react' | ||
import SVG from 'react-inlinesvg'; | ||
import uncheckedSvg from '../assets/images/icons/circle.svg' | ||
import checkedSvg from '../assets/images/icons/check-circle.svg' | ||
|
||
const MaxRadioButton = (props) => { | ||
const { label, ...rest} = props | ||
|
||
return ( | ||
<> | ||
<input | ||
{...rest} | ||
className="syos-tile-controls__input" | ||
ref={React.createRef()} | ||
/> | ||
<label className="syos-tile-controls__control" htmlFor={rest.id}> | ||
<SVG src={ uncheckedSvg } className="syos-icon syos-tile-controls__icon syos-tile-controls__icon--unselected" aria-hidden={true}/> | ||
<SVG src={ checkedSvg } className="syos-icon syos-tile-controls__icon syos-tile-controls__icon--selected" aria-hidden={true}/> | ||
{ label } | ||
</label> | ||
</> | ||
) | ||
} | ||
|
||
export default class extends React.Component { | ||
render () { | ||
const { | ||
filterForm, | ||
} = this.props | ||
|
||
const controlElements = Object | ||
.values(filterForm.inputs) | ||
.map((inputProps) => <MaxRadioButton {...inputProps} />); | ||
|
||
return ( | ||
<form {...filterForm.props}> | ||
<fieldset className="syos-u-margin-bottom-6"> | ||
<legend className="syos-u-margin-bottom-2 syos-inline-stack"> | ||
<h2 className="syos-inline-stack__item"> | ||
Filter by max price | ||
</h2> | ||
|
||
<input className="syos-button syos-button--transparent" type="reset" value="Clear Filters" /> | ||
</legend> | ||
|
||
<div className="syos-tile-controls"> | ||
{controlElements} | ||
</div> | ||
|
||
<input type="submit" className="syos-button syos-u-margin-top-2" value="Apply Filters" /> | ||
</fieldset> | ||
</form> | ||
) | ||
} | ||
} |
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,14 @@ | ||
json.filter_form do | ||
form_props( | ||
url: venue_floor_seats_path(venue, floor), | ||
method: :get | ||
) do |f| | ||
[5_00, 10_00, 15_00, nil].each_cons(2).to_a.each do |max_nmax| | ||
maximum = max_nmax[0] | ||
next_maximum = max_nmax[1] | ||
checked = params[:maximum].to_i == maximum || [params[:maximum], next_maximum].none? | ||
|
||
f.radio_button(:maximum, maximum, checked: checked, label: number_to_currency(maximum / 100.0)) | ||
end | ||
end | ||
end |
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 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