mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update signin button in visitor mode
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { userService } from "../services";
|
||||
import { useAppSelector } from "../store";
|
||||
import Only from "./common/OnlyWhen";
|
||||
import showDailyReviewDialog from "./DailyReviewDialog";
|
||||
import showSettingDialog from "./SettingDialog";
|
||||
@ -13,8 +12,6 @@ import "../less/siderbar.less";
|
||||
interface Props {}
|
||||
|
||||
const Sidebar: React.FC<Props> = () => {
|
||||
const user = useAppSelector((state) => state.user.user);
|
||||
|
||||
const handleMyAccountBtnClick = () => {
|
||||
showSettingDialog();
|
||||
};
|
||||
@ -44,17 +41,6 @@ const Sidebar: React.FC<Props> = () => {
|
||||
<button className="btn action-btn" onClick={handleArchivedBtnClick}>
|
||||
<span className="icon">🗂</span> Archived
|
||||
</button>
|
||||
<Only when={userService.isVisitorMode()}>
|
||||
{user ? (
|
||||
<button className="btn action-btn" onClick={() => (window.location.href = "/")}>
|
||||
<span className="icon">🏠</span> Back to Home
|
||||
</button>
|
||||
) : (
|
||||
<button className="btn action-btn" onClick={() => (window.location.href = "/signin")}>
|
||||
<span className="icon">👉</span> Sign in
|
||||
</button>
|
||||
)}
|
||||
</Only>
|
||||
</div>
|
||||
<Only when={!userService.isVisitorMode()}>
|
||||
<ShortcutList />
|
||||
|
Reference in New Issue
Block a user