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

View file

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