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:
GRL78 2021-09-21 20:24:53 +02:00 committed by GitHub
parent ccea46fe2b
commit 3f1c5246f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 8 deletions

View file

@ -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);
}
}