Change motd banner to motd modal

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-10-09 19:09:29 +02:00
parent 328bc917eb
commit ee7cde0096
26 changed files with 361 additions and 269 deletions

31
src/redux/motd/methods.ts Normal file
View file

@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { store } from '..'
import { DismissMotdAction, MotdActionType, SetMotdAction } from './types'
/**
* Sets a not-dismissed motd message in the global application state.
*
* @param text The motd text content
* @param lastModified An identifier that describes when the motd was changed the last time.
*/
export const setMotd = (text: string, lastModified: string | null): void => {
store.dispatch({
type: MotdActionType.SET_MOTD,
text,
lastModified
} as SetMotdAction)
}
/**
* Dismisses the currently saved motd message.
*/
export const dismissMotd = (): void => {
store.dispatch({
type: MotdActionType.DISMISS_MOTD
} as DismissMotdAction)
}