jerryshao commented on code in PR #9997:
URL: https://github.com/apache/gravitino/pull/9997#discussion_r2850593679
##########
web/web/src/app/rootLayout/Layout.js:
##########
@@ -34,10 +36,68 @@ const DynamicMainContent = dynamic(() =>
import('./MainContent'), {
ssr: false
})
+const WEB_V2_NOTICE_DISMISSED_KEY = 'gravitino:webV2NoticeDismissed'
+
const Layout = ({ children, scrollToTop }) => {
+ const [showNotice, setShowNotice] = useState(true)
+
+ useEffect(() => {
+ try {
+ const dismissed = localStorage.getItem(WEB_V2_NOTICE_DISMISSED_KEY)
+ if (dismissed === 'true') {
+ setShowNotice(false)
+ }
+ } catch (error) {
+ // Ignore storage errors and keep default behavior.
+ }
+ }, [])
+
+ const handleDismissNotice = () => {
+ setShowNotice(false)
+ try {
+ localStorage.setItem(WEB_V2_NOTICE_DISMISSED_KEY, 'true')
+ } catch (error) {
+ // Ignore storage errors.
+ }
+ }
+
return (
<div className={'layout-wrapper twc-h-full twc-flex twc-overflow-clip'}>
<Box className={'layout-content-wrapper twc-flex twc-grow
twc-min-h-[100vh] twc-min-w-0 twc-flex-col'}>
+ {showNotice && (
+ <Box
+ sx={{
+ position: 'fixed',
+ top: 16,
+ right: 16,
+ zIndex: 1200,
+ maxWidth: 520
+ }}
+ >
+ <Paper variant='outlined' sx={{ p: 4, bgcolor: '#fff', boxShadow:
'0 4px 12px rgba(0, 0, 0, 0.12)' }}>
+ <Stack direction='row' spacing={1.5} alignItems='flex-start'>
+ <Box sx={{ flex: 1 }}>
+ <Typography variant='body2' component='div'>
+ <Box component='span' sx={{ fontWeight: 600 }}>
+ Try the new Web V2 UI.
Review Comment:
Please change the sentence to `Try the new V2 Web UI.`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]