mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
chore(core): set read-only mode on mobile device (#7651)
Close [BS-795](https://linear.app/affine-design/issue/BS-795/affine-mobile-设置只读模式) - Set read-only mode on mobile device - Add mobile only support read-only warning toast - remove `user-select: none` so that user can select text in read-only mode
This commit is contained in:
@@ -21,11 +21,13 @@ const shouldShowWarning = (() => {
|
||||
// disable in SSR
|
||||
return false;
|
||||
}
|
||||
if (environment.isMobile) {
|
||||
return true;
|
||||
}
|
||||
if (environment.isChrome) {
|
||||
return environment.chromeVersion < minimumChromeVersion;
|
||||
} else {
|
||||
return !environment.isMobile;
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
|
||||
const OSWarningMessage = () => {
|
||||
@@ -36,6 +38,11 @@ const OSWarningMessage = () => {
|
||||
environment.isChrome &&
|
||||
environment.chromeVersion < minimumChromeVersion;
|
||||
|
||||
// TODO(@L-Sun): remove this message when mobile version is able to edit.
|
||||
if ('isMobile' in environment && environment.isMobile) {
|
||||
return <span>{t['com.affine.top-tip.mobile']()}</span>;
|
||||
}
|
||||
|
||||
if (notChrome) {
|
||||
return (
|
||||
<span>
|
||||
@@ -48,6 +55,7 @@ const OSWarningMessage = () => {
|
||||
} else if (notGoodVersion) {
|
||||
return <span>{t['upgradeBrowser']()}</span>;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user