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.
Add map zoom controls to
seats/index
For comparison [see this commit] The Superglue version is lengthier than the commit above. Instead of just introducing HTML changes, this commit also introduces a React component to control zoom behavior and refactoring to introduce a `_seating_map.json.props` [commit]: seanpdoyle@fd394fc
- Loading branch information
Showing
10 changed files
with
98 additions
and
62 deletions.
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
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,26 @@ | ||
import React from 'react' | ||
import SVG from 'react-inlinesvg'; | ||
import plusSvg from '../assets/images/icons/plus.svg' | ||
import minusSvg from '../assets/images/icons/minus.svg' | ||
|
||
export default class extends React.Component { | ||
render() { | ||
return ( | ||
<div className="syos-frame__map-zoom syos-control-zoom"> | ||
<button | ||
className="syos-button syos-button--transparent syos-control-zoom__button" | ||
type="button" | ||
> | ||
<SVG src={ minusSvg } className="syos-icon" title="zoom out"/> | ||
</button> | ||
|
||
<button | ||
className="syos-button syos-button--transparent syos-control-zoom__button" | ||
type="button" | ||
> | ||
<SVG src={ plusSvg } className="syos-icon" title="zoom in"/> | ||
</button> | ||
</div> | ||
) | ||
} | ||
} |
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,26 @@ | ||
json.sections do | ||
json.array! sections do |section| | ||
if params.fetch(:maximum, Float::INFINITY).to_f >= section.price | ||
json.opacity "1.0" | ||
json.hidden false | ||
else | ||
json.opacity "0.3" | ||
json.hidden true | ||
end | ||
|
||
json.seats do | ||
json.array! section.seats do |seat| | ||
json.x seat.x | ||
json.y seat.y | ||
json.venue_floor_seat_path venue_floor_seat_path(venue, floor, seat.row_number) | ||
json.aria_label seat.row_number | ||
|
||
if Current.cart.include?(seat) | ||
json.href "#seat-icon-selected" | ||
else | ||
json.href "#seat-icon-unselected" | ||
end | ||
end | ||
end | ||
end | ||
end |
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
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