Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
cdd37e36
Commit
cdd37e36
authored
Nov 18, 2017
by
Andrew Hrdy
Browse files
Started working on maps on mobile, WIP.
parent
ed84dd70
Changes
4
Show whitespace changes
Inline
Side-by-side
src/components/CardContainer.js
View file @
cdd37e36
...
...
@@ -13,7 +13,7 @@ const CardContainer = ({searchTerm, facilities}) => {
{
facilities
.
filter
(
filterCards
).
map
(
item
=>
{
return
(
<
Grid
key
=
{
item
.
slug
}
item
>
<
FacilityCard
facility
=
{
item
}
/
>
<
FacilityCard
facility
=
{
item
}
facilities
=
{
facilities
}
/
>
<
/Grid
>
)
})}
...
...
src/components/FacilitiesMap.js
View file @
cdd37e36
...
...
@@ -136,7 +136,8 @@ class FacilitiesMap extends React.Component {
}
const
styleSheet
=
{
mapContainer
:
{
transition
:
'
250ms ease-in-out
'
transition
:
'
250ms ease-in-out
'
,
width
:
'
100%
'
}
};
...
...
src/containers/FacilityCard.js
View file @
cdd37e36
...
...
@@ -12,7 +12,10 @@ import {addFavoriteFacility, removeFavoriteFacility, setSelectedFacility} from '
import
DirectionsWalkIcon
from
'
material-ui-icons/DirectionsWalk
'
;
import
LocationOnIcon
from
'
material-ui-icons/LocationOn
'
;
import
{
removeBrackets
}
from
'
../utils/nameUtils
'
;
import
classnames
from
'
classnames
'
import
classnames
from
'
classnames
'
;
import
FacilitiesMap
from
'
../components/FacilitiesMap
'
;
import
Dialog
,
{
DialogTitle
,
DialogContent
,
DialogActions
}
from
'
material-ui/Dialog
'
;
import
Button
from
'
material-ui/Button
'
;
import
{
amber
,
...
...
@@ -44,14 +47,19 @@ class FacilityCard extends React.Component {
constructor
(
props
){
super
(
props
);
this
.
state
=
{
isHovered
:
false
isHovered
:
false
,
isMapOpen
:
false
}
}
handleClick
=
()
=>
{
handleC
ardC
lick
=
()
=>
{
this
.
props
.
setSelectedFacility
(
this
.
props
.
facility
);
};
toggleMap
=
()
=>
{
this
.
setState
({
isMapOpen
:
!
this
.
state
.
isMapOpen
});
};
/**
* Gets the the initials for a facility name. The initials will be the first character of the first and last word
* of the facility. Initial lengths range from 1-2.
...
...
@@ -130,10 +138,12 @@ class FacilityCard extends React.Component {
};
render
()
{
const
{
facility
,
favorites
,
selectedFacility
,
addFavoriteFacility
,
removeFavoriteFacility
}
=
this
.
props
;
const
{
facility
,
facilities
,
favorites
,
selectedFacility
,
addFavoriteFacility
,
removeFavoriteFacility
}
=
this
.
props
;
const
isSelected
=
selectedFacility
.
slug
===
facility
.
slug
;
return
(
<
Card
onClick
=
{
this
.
handleClick
}
className
=
{
classnames
(
'
fc-root
'
,
s
elected
Facility
.
slug
===
facility
.
slug
&&
'
fc-selected
'
)}
<
Card
onClick
=
{
this
.
handleC
ardC
lick
}
className
=
{
classnames
(
'
fc-root
'
,
isS
elected
&&
'
fc-selected
'
)}
onMouseEnter
=
{
this
.
handleMouseEnter
}
onMouseLeave
=
{
this
.
handleMouseLeave
}
raised
>
<
CardMedia
className
=
{
'
fc-media
'
}
image
=
{
'
https://gmucampus.files.wordpress.com/2010/09/00sothside2.jpg
'
}
/
>
...
...
@@ -162,7 +172,7 @@ class FacilityCard extends React.Component {
<
CardActions
>
<
Grid
container
justify
=
{
'
space-around
'
}
>
<
Grid
item
className
=
{
'
fc-extra
I
nfo
W
rapper
'
}
>
<
Grid
item
className
=
{
'
fc-extra
-i
nfo
-w
rapper
'
}
>
<
FacilityStatus
facility
=
{
facility
}
/
>
<
/Grid
>
...
...
@@ -176,6 +186,12 @@ class FacilityCard extends React.Component {
<
/Grid
>
<
/Grid
>
<
/CardActions
>
<
Button
className
=
{
'
fc-toggle-map-btn
'
}
onClick
=
{
this
.
toggleMap
}
>
Open
Map
<
/Button
>
<
Dialog
open
=
{
this
.
state
.
isMapOpen
}
onRequestClose
=
{
this
.
toggleMap
}
classes
=
{{
paper
:
'
fc-map-dialog
'
}}
>
<
FacilitiesMap
facilities
=
{
facilities
}
facility
=
{
facility
}
isMapOpen
=
{
true
}
/
>
<
/Dialog
>
<
/Card
>
)
}
...
...
src/styles/containers/facilityCard.scss
View file @
cdd37e36
...
...
@@ -60,6 +60,10 @@
overflow
:
hidden
;
}
.fc-toggle-map-btn
{
display
:
none
!
important
;
}
@supports
(
-webkit-line-clamp
:
2
)
{
.fc-two-line-ellipsis
{
overflow
:
hidden
;
...
...
@@ -118,12 +122,22 @@
@media
screen
and
(
max-width
:
1023px
)
{
.fc-root
{
@include
transition
(
150ms
ease-in-out
);
&
.fc-selected
{
.fc-one-line-ellipsis
{
white-space
:
normal
;
overflow
:
inherit
;
}
.fc-toggle-map-btn
{
display
:
block
!
important
;
width
:
100%
!
important
;
}
}
}
.fc-map-dialog
{
width
:
100%
!
important
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment