Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Add IsOfficial-filter and remove horisontal lines in programme #168

Merged
merged 9 commits into from
Jun 11, 2019
49 changes: 31 additions & 18 deletions components/EventList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const EventList = props => {
const currentDay = dayjs.utc(day[0].startingTime).add(2, "hour");
return (
<Event key={currentDay.format("YYYY-MM-DD")}>
<Sticky>
<Sticky style={{ zIndex: 2, position: "relative" }}>
christiankn marked this conversation as resolved.
Show resolved Hide resolved
<EventDay>
{currentDay.format("dddd")}{" "}
<span>{currentDay.format("D. MMMM")}</span>
Expand All @@ -76,17 +76,21 @@ const EventList = props => {
>
<EventLink>
{event.image ? (
<EventImage
src={imageUrlFor(event.image)
.height(250)
.url()}
alt="arrangementsbilde"
/>
<EventImageContainer>
<EventImage
src={imageUrlFor(event.image)
.height(250)
.url()}
alt="arrangementsbilde"
/>
</EventImageContainer>
) : (
<EventImage
src="/static/placeholder.jpg"
alt="arrangementsbilde"
/>
<EventImageContainer>
<EventImage
src="/static/placeholder.jpg"
alt="arrangementsbilde"
/>
</EventImageContainer>
)}

<EventInfo>
Expand Down Expand Up @@ -179,30 +183,38 @@ const EventDay = styled.h2`

const EventLink = styled.a`
cursor: pointer;
border-bottom: 2px solid lightgrey;
padding: 10px 0;
padding: 20px 0;
display: flex;
flex-direction: row;
align-items: center;
text-decoration: none;
color: inherit;
transition: transform 0.2s ease-in-out;

&:last-child {
border-bottom: 0;
}

&:hover {
text-decoration: underline;

:hover,
:focus {
transform: scale(1.05);
}
}
`;

const EventDayListWrapper = styled.div`
margin-top: 20px;
`;

const EventImageContainer = styled.div`
width: 150px;
height: 120px;
max-width: 25%;
`;

const EventImage = styled.img`
width: 80px;
height: 80px;
width: 150px;
height: 120px;
object-fit: cover;
`;

Expand All @@ -225,6 +237,7 @@ const EventTime = styled.div`
font-weight: 600;
color: ${theme.orange};
margin-right: 10px;
width: 100%;
`;

const EventPlace = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions components/Filter/Selectors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const SelectBox = styled.label`
height: 2em;
min-width: 100px;
flex-grow: 1;
flex-basis: 0;
white-space: nowrap;
cursor: pointer;
color: ${({ checked }) => (checked ? "white" : "inherit")};
background-color: ${({ checked }) => (checked ? theme.purple : "inherit")};
Expand Down
3 changes: 1 addition & 2 deletions components/Filter/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export default Filter;
const Wrapper = styled.div`
display: flex;
flex-direction: column;
padding: 10px;
border: 3px solid ${theme.purple};
padding: 10px 0;
& > *:not(:first-child) {
margin-top: 20px;
}
Expand Down
6 changes: 6 additions & 0 deletions pages/events/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ const Events = props => {
]}
defaultSelector={query.category || "-1"}
toggles={[
{
off: "Alle",
on: "Arrangert av Oslo Pride",
isOn: query.official === "true",
callback: value => toggleFilter("official", "true")
},
{
off: "Alle",
on: "Rullestolvennlig",
Expand Down