TO MERGE : Contact page from Admin or Environment Variable (#1401)
* Contact page from Admin or Environment Variable * Get contact page from admin by pusher * Changes requested * Modify contactPageStore management * documentation environment variables Co-authored-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
parent
ccea46fe2b
commit
3f1c5246f8
7 changed files with 27 additions and 8 deletions
|
@ -74,13 +74,18 @@ function createSubMenusStore() {
|
|||
|
||||
export const subMenusStore = createSubMenusStore();
|
||||
|
||||
export const contactPageStore = writable<string | undefined>(CONTACT_URL);
|
||||
|
||||
export function checkSubMenuToShow() {
|
||||
if (!get(userIsAdminStore)) {
|
||||
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
||||
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
||||
subMenusStore.removeMenu(SubMenusInterface.contact);
|
||||
|
||||
if (get(userIsAdminStore)) {
|
||||
subMenusStore.addMenu(SubMenusInterface.globalMessages);
|
||||
}
|
||||
|
||||
if (CONTACT_URL === undefined) {
|
||||
subMenusStore.removeMenu(SubMenusInterface.contact);
|
||||
if (get(contactPageStore) !== undefined) {
|
||||
subMenusStore.addMenu(SubMenusInterface.contact);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue