| @@ -20,13 +20,26 @@ const DashboardDefault = () => { | |||||
| backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
| backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
| } | } | ||||
| const getWelcomeMsg=()=>{ | |||||
| var current = new Date() | |||||
| var curHr = current.getHours() | |||||
| if (curHr < 12) { | |||||
| return "Good Morning" | |||||
| } else if (curHr < 18) { | |||||
| return "Good Afternoon" | |||||
| } else { | |||||
| //evening | |||||
| return "Good Evening" | |||||
| } | |||||
| } | |||||
| return ( | return ( | ||||
| <Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column"> | <Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column"> | ||||
| <Grid item xs={12}> | <Grid item xs={12}> | ||||
| <div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
| <Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | <Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | ||||
| Morning, {userData.fullenName} | |||||
| {getWelcomeMsg()}, {userData.fullenName} | |||||
| </Typography> | </Typography> | ||||
| </Stack> | </Stack> | ||||
| </div> | </div> | ||||
| @@ -35,6 +35,20 @@ const DashboardDefault = () => { | |||||
| backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
| backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
| } | } | ||||
| const getWelcomeMsg=()=>{ | |||||
| var current = new Date() | |||||
| var curHr = current.getHours() | |||||
| if (curHr < 12) { | |||||
| return <FormattedMessage id="welcomeMsg_am" /> | |||||
| } else if (curHr < 18) { | |||||
| return <FormattedMessage id="welcomeMsg_pm" /> | |||||
| } else { | |||||
| return <FormattedMessage id="welcomeMsg_night" /> | |||||
| } | |||||
| } | |||||
| return ( | return ( | ||||
| <Grid container sx={{ minHeight: '87vh' }} direction="column"> | <Grid container sx={{ minHeight: '87vh' }} direction="column"> | ||||
| <Grid item xs={12} > | <Grid item xs={12} > | ||||
| @@ -42,7 +56,7 @@ const DashboardDefault = () => { | |||||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
| {/* <Typography variant="h5">我的公共啟事</Typography> */} | {/* <Typography variant="h5">我的公共啟事</Typography> */} | ||||
| <Typography color='#FFF' variant="h5" sx={{ ml: 10, display: { xs: 'none', sm: 'none', md: 'block' } }}> | <Typography color='#FFF' variant="h5" sx={{ ml: 10, display: { xs: 'none', sm: 'none', md: 'block' } }}> | ||||
| {isORGLoggedIn() ? userData.fullenName : userData.fullchName}, <FormattedMessage id="welcomeMsg" /> | |||||
| {isORGLoggedIn() ? userData.fullenName : userData.fullchName}, {getWelcomeMsg()} | |||||
| </Typography> | </Typography> | ||||
| </Stack> | </Stack> | ||||
| </div> | </div> | ||||
| @@ -96,7 +96,10 @@ | |||||
| "onlinePaymentHistory": "Online Payment History", | "onlinePaymentHistory": "Online Payment History", | ||||
| "setting": "Settings", | "setting": "Settings", | ||||
| "companyOrUserRecord": "Company/Institutional User Records", | "companyOrUserRecord": "Company/Institutional User Records", | ||||
| "welcomeMsg": "Good afternoon! Please select the required service.", | |||||
| "welcomeMsg_am": "Good morning! Please select the required service.", | |||||
| "welcomeMsg_pm": "Good afternoon! Please select the required service.", | |||||
| "welcomeMsg_night": "Good evening! Please select the required service.", | |||||
| "login": "Login", | "login": "Login", | ||||
| "logout": "Logout", | "logout": "Logout", | ||||
| @@ -95,7 +95,9 @@ | |||||
| "onlinePaymentHistory": "网上付款记录", | "onlinePaymentHistory": "网上付款记录", | ||||
| "setting": "设置", | "setting": "设置", | ||||
| "companyOrUserRecord": "公司/机构用户记录", | "companyOrUserRecord": "公司/机构用户记录", | ||||
| "welcomeMsg": "午安! 请选择所需服务。", | |||||
| "welcomeMsg_am": "早安! 请选择所需服务。", | |||||
| "welcomeMsg_pm": "午安! 请选择所需服务。", | |||||
| "welcomeMsg_night": "晚安! 请选择所需服务。", | |||||
| "login": "登录", | "login": "登录", | ||||
| "logout": "登出", | "logout": "登出", | ||||
| @@ -95,7 +95,9 @@ | |||||
| "onlinePaymentHistory": "網上付款記錄", | "onlinePaymentHistory": "網上付款記錄", | ||||
| "setting": "設定", | "setting": "設定", | ||||
| "companyOrUserRecord": "公司/機構用戶記錄", | "companyOrUserRecord": "公司/機構用戶記錄", | ||||
| "welcomeMsg": "午安! 請選擇所需服務。", | |||||
| "welcomeMsg_am": "早安! 請選擇所需服務。", | |||||
| "welcomeMsga_pm": "午安! 請選擇所需服務。", | |||||
| "welcomeMsg_night": "晚安! 請選擇所需服務。", | |||||
| "login": "登入", | "login": "登入", | ||||
| "logout": "登出", | "logout": "登出", | ||||