User specific motd changes (again)

This commit is contained in:
mrfry 2021-01-14 16:37:39 +01:00
parent 23dc6197ad
commit 179c1f0079
2 changed files with 7 additions and 8 deletions

View file

@ -106,8 +106,11 @@ export default function Layout({
<div className="userStatus"> <div className="userStatus">
<div <div
onClick={() => { onClick={() => {
if (!userSpecificMotd) {
return
}
setShowMotdModal(true) setShowMotdModal(true)
if (userSpecificMotd && userSpecificMotd.seen) { if (userSpecificMotd.seen) {
return return
} }
fetch(constants.apiUrl + 'infos', { fetch(constants.apiUrl + 'infos', {
@ -128,7 +131,7 @@ export default function Layout({
refetchGlobalData() refetchGlobalData()
}) })
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: userSpecificMotd ? 'pointer' : 'default' }}
title={ title={
userSpecificMotd && !userSpecificMotd.seen userSpecificMotd && !userSpecificMotd.seen
? "You've got Mail!" ? "You've got Mail!"
@ -145,9 +148,7 @@ export default function Layout({
setShowMotdModal(false) setShowMotdModal(false)
}} }}
> >
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>Üzenet admintól:</div>
Üzenet az oldal készítőjétől:
</div>
<div>{userSpecificMotd.msg}</div> <div>{userSpecificMotd.msg}</div>
</Modal> </Modal>
) : null} ) : null}

View file

@ -134,9 +134,7 @@ export default function Index(props) {
return ( return (
<div> <div>
<hr /> <hr />
<div className={styles.subtitle}> <div className={styles.subtitle}>Üzenet admintól:</div>
Üzenet az oldal készítőjétől (ezt csak te látod):
</div>
{userSpecificMotd ? ( {userSpecificMotd ? (
<div <div
className={styles.motd} className={styles.motd}