mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
Change motd banner to motd modal
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
328bc917eb
commit
ee7cde0096
26 changed files with 361 additions and 269 deletions
31
src/redux/motd/methods.ts
Normal file
31
src/redux/motd/methods.ts
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue