Skip to content

Commit

Permalink
Add button for adding event to cal (#683)
Browse files Browse the repository at this point in the history
* Add button for adding event to cal
  • Loading branch information
henrikskog authored Aug 31, 2023
1 parent 7db4c8a commit 45098ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/events/components/DetailView/AttendanceEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Attendance from '../Attendance';
import { attendeeSelectors, fetchAttendeeByEventId, patchAttendee } from 'events/slices/attendees';
import EventPaymentBlock from '../EventPayment/EventPaymentBlock';
import EventPrice from '../EventPayment/EventPrice';
import { Select } from '@dotkomonline/design-system';
import { Button, Select } from '@dotkomonline/design-system';
import { IExtra } from '../../models/Extras';
import PublicAttendeesWrapper from './PublicAttendeesModal/PublicAttendeesWrapper';
import ParticipantsButton from './PublicAttendeesModal/ParticipantsButton';
Expand Down Expand Up @@ -109,6 +109,11 @@ const AttendanceEvent: FC<IProps> = ({ eventId, eventTitle }) => {
<PublicAttendeesWrapper isAttending={attendanceEvent.is_attendee} canAttend={isEligibleForSignup}>
<ParticipantsButton eventTitle={eventTitle} eventId={eventId} />
</PublicAttendeesWrapper>
{attendanceEvent.is_attendee && (
<a href={`https://old.online.ntnu.no/events/${eventId}.ics`} className={style.calendarButton}>
<Button variant="outline">Legg til i kalender</Button>
</a>
)}
</div>
{attendanceEvent.payment && (
<Block title="Pris" className={`${style.fullBlock} ${style.priceBlock}`}>
Expand Down
8 changes: 8 additions & 0 deletions src/events/components/DetailView/detail.less
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,11 @@
.priceBlock {
text-align: center;
}

.calendarButton {
margin-top: 1em;
}

.calendarButton > button {
width: 100%;
}

1 comment on commit 45098ea

@vercel
Copy link

@vercel vercel bot commented on 45098ea Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.