Skip to content

Commit

Permalink
Improve VisKart button
Browse files Browse the repository at this point in the history
  • Loading branch information
Arash Farzaneh Taleghani committed Feb 6, 2023
1 parent 534d847 commit 76e15bc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
Binary file added app/assets/mazemap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/components/Content/ContentHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import cx from 'classnames';
import type { Event } from 'app/models';
import { eventTypeToString } from 'app/routes/events/utils';
import styles from './ContentHeader.css';
import type { ReactNode } from 'react';
import type { HTMLAttributes, ReactNode } from 'react';

type Props = {
className?: string;
borderColor?: string;
children: ReactNode;
event?: Event;
color: string;
};
color?: string;
} & HTMLAttributes<HTMLDivElement>;
const DEFAULT_BORDER_COLOR = '#FCD748';

/**
Expand Down
14 changes: 14 additions & 0 deletions app/routes/events/components/EventDetail/EventDetail.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
align-items: center;
}

.iconWithTextMazeMap {
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

.infoIcon {
min-width: 26px;
display: flex;
Expand All @@ -58,3 +65,10 @@
.registeredBox {
margin-top: 1em;
}

.mapButton {
margin-top: 5px;
margin-bottom: 5px;
max-width: 130px;
max-height: 33px;
}
36 changes: 22 additions & 14 deletions app/routes/events/components/EventDetail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import moment from 'moment-timezone';
import { Component, Fragment } from 'react';
import { Link } from 'react-router-dom';
import mazemapLogo from 'app/assets/mazemap.png';
import Button from 'app/components/Button';
import CommentView from 'app/components/Comments/CommentView';
import {
Content,
Expand All @@ -11,6 +13,7 @@ import {
} from 'app/components/Content';
import DisplayContent from 'app/components/DisplayContent';
import Icon from 'app/components/Icon';
import { CircularPicture } from 'app/components/Image';
import InfoList from 'app/components/InfoList';
import { Flex } from 'app/components/Layout';
import { MazemapEmbed } from 'app/components/MazemapEmbed';
Expand Down Expand Up @@ -395,29 +398,34 @@ export default class EventDetail extends Component<Props, State> {
<Icon name="time-outline" className={styles.infoIcon} />
<FromToTime from={event.startTime} to={event.endTime} />
</div>
<div className={styles.iconWithText}>
<Icon name="location-outline" className={styles.infoIcon} />
{event.location}
</div>
{event.isPriced && (
<div className={styles.iconWithTextMazeMap}>
<div className={styles.iconWithText}>
<Icon name="cash-outline" className={styles.infoIcon} />
{event.priceMember / 100},-
<Icon name="location-outline" className={styles.infoIcon} />
{event.location}
</div>
)}
{event.mazemapPoi && (
<>
<div
className={styles.simulateLink}
{event.mazemapPoi && (
<Button
className={styles.mapButton}
onClick={() =>
this.setState({
mapIsOpen: !this.state.mapIsOpen,
})
}
>
{' '}
<CircularPicture size={25} alt="" src={mazemapLogo} />
{this.state.mapIsOpen ? 'Skjul kart' : 'Vis kart'}
</div>
</Button>
)}
</div>

{event.isPriced && (
<div className={styles.iconWithText}>
<Icon name="cash-outline" className={styles.infoIcon} />
{event.priceMember / 100},-
</div>
)}
{event.mazemapPoi && (
<>
{this.state.mapIsOpen && (
<MazemapEmbed mazemapPoi={event.mazemapPoi} />
)}
Expand Down

0 comments on commit 76e15bc

Please sign in to comment.