-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow only admin users to see registration instructions
- Loading branch information
1 parent
23085dd
commit 62e2bdd
Showing
14 changed files
with
137 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export type NavigationGroup = { | ||
heading: string; | ||
headingLink: string; | ||
items?: NavigationGroupItem[]; | ||
}; | ||
|
||
export type NavigationGroupItem = { | ||
label: string; | ||
url: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ROUTES } from '../../../constants'; | ||
import { UserFieldsFragment } from '../../../generated/graphql'; | ||
import { areRegistrationRoutesAllowed } from '../../user/permissions'; | ||
import { NavigationGroup, NavigationGroupItem } from './types'; | ||
|
||
const getNavigationGroupItemsInstructions = ( | ||
user?: UserFieldsFragment | ||
): NavigationGroupItem[] => [ | ||
{ | ||
label: 'helpPage.sideNavigation.labelEventsInstructions', | ||
url: ROUTES.INSTRUCTIONS_EVENTS, | ||
}, | ||
...(areRegistrationRoutesAllowed(user) | ||
? [ | ||
{ | ||
label: 'helpPage.sideNavigation.labelRegistrationInstructions', | ||
url: ROUTES.INSTRUCTIONS_REGISTRATION, | ||
}, | ||
] | ||
: []), | ||
{ | ||
label: 'helpPage.sideNavigation.labelFaq', | ||
url: ROUTES.INSTRUCTIONS_FAQ, | ||
}, | ||
]; | ||
|
||
export const getNavigationGroupInstructions = ( | ||
user?: UserFieldsFragment | ||
): NavigationGroup => ({ | ||
heading: 'helpPage.sideNavigation.labelInstructions', | ||
headingLink: ROUTES.INSTRUCTIONS, | ||
items: getNavigationGroupItemsInstructions(user), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.