Skip to content

Commit

Permalink
feat: block reject event if is_official false PS-161
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkojamG committed Dec 17, 2024
1 parent 8edbe2b commit b405133
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/components/pages/events/ManageEventsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Layout from '../../layout/Layout';
import { isPending } from '../../../utils/event';
import useAuth from '../../../hooks/useAuth';
import { Event } from '../../../store/types';
import { isOfficialSelector } from '../../../store/reducers/auth';

const DetailsCluster = styled.div`
display: flex;
Expand Down Expand Up @@ -98,6 +99,7 @@ const ManageEventsPage = () => {
const nextParams = useAppSelector(nextParamsSelector);
const events = useAppSelector(eventsSelector);
const ordering = useAppSelector(orderingSelector);
const isOfficial = useAppSelector(isOfficialSelector);

const apiAccessToken = getApiToken();

Expand Down Expand Up @@ -262,14 +264,17 @@ const ManageEventsPage = () => {
disabled={!isEventPending}
/>
)}
<Button
id={`reject_event_${event.id}`}
data-testid={`reject_event_${event.id}`}
translate="site.page.manage_events.table.action.remove"
color="danger"
onClick={() => remove(event)}
append="times"
/>

{isOfficial && (
<Button
id={`reject_event_${event.id}`}
data-testid={`reject_event_${event.id}`}
translate="site.page.manage_events.table.action.remove"
color="danger"
onClick={() => remove(event)}
append="times"
/>
)}
</div>
</DetailsRow>
)}
Expand Down

0 comments on commit b405133

Please sign in to comment.