Skip to content

Commit

Permalink
Add action to go to public-facing event page in event editing interface
Browse files Browse the repository at this point in the history
  • Loading branch information
julianweng committed Nov 23, 2024
1 parent 57ec73d commit c092ec7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions frontend/components/ClubEditPage/EventsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { Field } from 'formik'
import moment from 'moment'
import React, {
forwardRef,
ReactElement,
RefObject,
useRef,
useState,
} from 'react'
import Link from 'next/link'
import { forwardRef, ReactElement, RefObject, useRef, useState } from 'react'
import TimeAgo from 'react-timeago'
import styled from 'styled-components'

Expand Down Expand Up @@ -492,6 +487,13 @@ export default function EventsCard({ club }: EventsCardProps): ReactElement {
: 'Note: you must be an approved club to create publicly-viewable events.'}
</Text>
<ModelForm
actions={(object) => (
<Link legacyBehavior href={{ pathname: `/events/${object.id}` }}>
<button className="button is-info is-small">
<Icon name="eye" /> Page
</button>
</Link>
)}
baseUrl={`/clubs/${club.code}/events/`}
listParams={`&end_time__gte=${new Date().toISOString()}`}
fields={eventFields}
Expand Down

0 comments on commit c092ec7

Please sign in to comment.