diff --git a/src/components/layout.js b/src/components/layout.js index c6b1020..0b3e4a5 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -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} diff --git a/src/pages/index.js b/src/pages/index.js index 8b4a116..c3c7bf8 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -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}