Unverified Commit 3322710d authored by Charlie.Wei's avatar Charlie.Wei Committed by GitHub

Maintenance notice href (#2227)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: 's avatarcrazywoola <427733928@qq.com>
Co-authored-by: 's avatarcrazywoola <100913391+crazywoola@users.noreply.github.com>
parent 404bf11d
...@@ -7,7 +7,9 @@ import { NOTICE_I18N } from '@/utils/language' ...@@ -7,7 +7,9 @@ import { NOTICE_I18N } from '@/utils/language'
const MaintenanceNotice = () => { const MaintenanceNotice = () => {
const { locale } = useContext(I18n) const { locale } = useContext(I18n)
const [showNotice, setShowNotice] = useState(localStorage.getItem('hide-maintenance-notice') !== '1') const [showNotice, setShowNotice] = useState(localStorage.getItem('hide-maintenance-notice') !== '1')
const handleJumpNotice = () => {
window.open(NOTICE_I18N.href, '_blank')
}
const handleCloseNotice = () => { const handleCloseNotice = () => {
localStorage.setItem('hide-maintenance-notice', '1') localStorage.setItem('hide-maintenance-notice', '1')
setShowNotice(false) setShowNotice(false)
...@@ -22,8 +24,8 @@ const MaintenanceNotice = () => { ...@@ -22,8 +24,8 @@ const MaintenanceNotice = () => {
return ( return (
<div className='shrink-0 flex items-center px-4 h-[38px] bg-[#FFFAEB] border-b border-[0.5px] border-b-[#FEF0C7] z-20'> <div className='shrink-0 flex items-center px-4 h-[38px] bg-[#FFFAEB] border-b border-[0.5px] border-b-[#FEF0C7] z-20'>
<div className='shrink-0 flex items-center mr-2 px-2 h-[22px] bg-[#F79009] text-white text-[11px] font-medium rounded-xl'>{titleByLocale[locale]}</div> <div className='shrink-0 flex items-center mr-2 px-2 h-[22px] bg-[#F79009] text-white text-[11px] font-medium rounded-xl'>{titleByLocale[locale]}</div>
<div className='grow text-xs font-medium text-gray-700'>{descByLocale[locale]}</div> <div className='grow text-xs font-medium text-gray-700 cursor-pointer' onClick={handleJumpNotice}>{descByLocale[locale]}</div>
<X className='shrink-0 w-4 h-4 text-gray-500 cursor-pointer' onClick={handleCloseNotice} /> <X className='shrink-0 w-4 h-4 text-gray-500 cursor-pointer' onClick={handleCloseNotice}/>
</div> </div>
) )
} }
......
...@@ -102,4 +102,5 @@ export const NOTICE_I18N = { ...@@ -102,4 +102,5 @@ export const NOTICE_I18N = {
'ja-JP': 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.', 'ja-JP': 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
'ko-KR': 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.', 'ko-KR': 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
}, },
href: '#',
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment