Skip to content

Commit

Permalink
Merge pull request #3803 from webkom/fix-event-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz committed Apr 17, 2023
2 parents 6df20b6 + b2e77b5 commit 80992be
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 53 deletions.
2 changes: 1 addition & 1 deletion app/routes/admin/groups/components/GroupPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const PermissionList = ({
closeOnConfirm={true}
onConfirm={() => removePermission(permission, group, editGroup)}
>
<i className={`fa fa-times ${styles.removeIcon}`} />
<i className={`fa fa-times`} />
</ConfirmModalWithParent>
{permission}
</li>
Expand Down
10 changes: 3 additions & 7 deletions app/routes/events/components/EventAdministrate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { cloneElement } from 'react';
import { Content } from 'app/components/Content';
import { LoginPage } from 'app/components/LoginForm';
import NavigationTab, { NavigationLink } from 'app/components/NavigationTab';
import type { EventPool } from 'app/models';
import type { EventEntity } from 'app/reducers/events';
import replaceUnlessLoggedIn from 'app/utils/replaceUnlessLoggedIn';
import type { ReactElement } from 'react';
import type { ReactNode } from 'react';

type Props = {
children: Array<ReactElement>;
children: (props: Props) => ReactNode;
currentUser: Record<string, any>;
event: EventEntity | null | undefined;
match: {
Expand Down Expand Up @@ -41,10 +40,7 @@ const EventAdministrateIndex = (props: Props) => {
</NavigationLink>
<NavigationLink to={`${base}/abacard`}>Abacard</NavigationLink>
</NavigationTab>
{props.children &&
props.children.map((child) =>
cloneElement(child, { ...props, children: undefined })
)}
{props.children(props)}
</Content>
);
};
Expand Down
99 changes: 54 additions & 45 deletions app/routes/events/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,51 +81,60 @@ const eventRoute = ({
loggedIn,
}}
>
<RouteWrapper
exact
path={`${match.path}/attendees`}
Component={EventAttendeeRoute}
passedProps={{
currentUser,
loggedIn,
}}
/>
<RouteWrapper
exact
path={`${match.path}/allergies`}
Component={EventAllergiesRoute}
passedProps={{
currentUser,
loggedIn,
}}
/>
<RouteWrapper
exact
path={`${match.path}/statistics`}
Component={EventStatistics}
passedProps={{
currentUser,
loggedIn,
}}
/>
<RouteWrapper
exact
path={`${match.path}/admin-register`}
Component={EventAdminRegisterRoute}
passedProps={{
currentUser,
loggedIn,
}}
/>
<RouteWrapper
exact
path={`${match.path}/abacard`}
Component={EventAbacardRoute}
passedProps={{
currentUser,
loggedIn,
}}
/>
{(props) => (
<>
<RouteWrapper
exact
path={`${match.path}/attendees`}
Component={EventAttendeeRoute}
passedProps={{
currentUser,
loggedIn,
...props,
}}
/>
<RouteWrapper
exact
path={`${match.path}/allergies`}
Component={EventAllergiesRoute}
passedProps={{
currentUser,
loggedIn,
...props,
}}
/>
<RouteWrapper
exact
path={`${match.path}/statistics`}
Component={EventStatistics}
passedProps={{
currentUser,
loggedIn,
...props,
}}
/>
<RouteWrapper
exact
path={`${match.path}/admin-register`}
Component={EventAdminRegisterRoute}
passedProps={{
currentUser,
loggedIn,
...props,
}}
/>
<RouteWrapper
exact
path={`${match.path}/abacard`}
Component={EventAbacardRoute}
passedProps={{
currentUser,
loggedIn,
...props,
}}
/>
</>
)}
</EventAdministrateRoute>
)}
</Route>
Expand Down

0 comments on commit 80992be

Please sign in to comment.