File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ root = "."
22tmp_dir = " .air"
33
44[build ]
5- bin = " ./.air/memos.exe"
6- cmd = " go build -o ./.air/memos.exe ./main.go"
7- delay = 1000
8- exclude_dir = [" .air" , " web" , " build" ]
9- exclude_file = []
10- exclude_regex = []
11- exclude_unchanged = false
12- follow_symlink = false
13- full_bin = " "
14- send_interrupt = true
15- kill_delay = 2000
5+ bin = " ./.air/memos.exe --mode dev "
6+ cmd = " go build -o ./.air/memos.exe ./main.go"
7+ delay = 1000
8+ exclude_dir = [" .air" , " web" , " build" ]
9+ exclude_file = []
10+ exclude_regex = []
11+ exclude_unchanged = false
12+ follow_symlink = false
13+ full_bin = " "
14+ send_interrupt = true
15+ kill_delay = 2000
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ root = "."
22tmp_dir = " .air"
33
44[build ]
5- bin = " ./.air/memos"
6- cmd = " go build -o ./.air/memos ./main.go"
7- delay = 1000
8- exclude_dir = [" .air" , " web" , " build" ]
9- exclude_file = []
10- exclude_regex = []
11- exclude_unchanged = false
12- follow_symlink = false
13- full_bin = " "
14- send_interrupt = true
15- kill_delay = 2000
5+ bin = " ./.air/memos --mode dev "
6+ cmd = " go build -o ./.air/memos ./main.go"
7+ delay = 1000
8+ exclude_dir = [" .air" , " web" , " build" ]
9+ exclude_file = []
10+ exclude_regex = []
11+ exclude_unchanged = false
12+ follow_symlink = false
13+ full_bin = " "
14+ send_interrupt = true
15+ kill_delay = 2000
Original file line number Diff line number Diff line change 11import { useEffect , useState } from "react" ;
22import { toast } from "react-hot-toast" ;
33import { useTranslation } from "react-i18next" ;
4- import { useUserStore } from "@/store/module" ;
4+ import { useGlobalStore , useUserStore } from "@/store/module" ;
55import Icon from "./Icon" ;
66import { generateDialog } from "./Dialog" ;
77
@@ -10,11 +10,16 @@ type Props = DialogProps;
1010const ChangePasswordDialog : React . FC < Props > = ( { destroy } : Props ) => {
1111 const { t } = useTranslation ( ) ;
1212 const userStore = useUserStore ( ) ;
13+ const globalStore = useGlobalStore ( ) ;
14+ const profile = globalStore . state . systemStatus . profile ;
1315 const [ newPassword , setNewPassword ] = useState ( "" ) ;
1416 const [ newPasswordAgain , setNewPasswordAgain ] = useState ( "" ) ;
1517
1618 useEffect ( ( ) => {
17- // do nth
19+ if ( profile . mode === "demo" && userStore . state . user ?. id === userStore . state . host ?. id ) {
20+ toast . error ( "Demo mode does not support this operation." ) ;
21+ destroy ( ) ;
22+ }
1823 } , [ ] ) ;
1924
2025 const handleCloseBtnClick = ( ) => {
Original file line number Diff line number Diff line change 1+ import { useEffect , useState } from "react" ;
2+ import { useGlobalStore } from "@/store/module" ;
3+ import Icon from "./Icon" ;
4+
5+ interface State {
6+ show : boolean ;
7+ }
8+
9+ const DemoBanner : React . FC = ( ) => {
10+ const globalStore = useGlobalStore ( ) ;
11+ const profile = globalStore . state . systemStatus . profile ;
12+ const [ state , setState ] = useState < State > ( {
13+ show : false ,
14+ } ) ;
15+
16+ useEffect ( ( ) => {
17+ const isDemo = profile . mode === "demo" ;
18+ setState ( {
19+ show : isDemo ,
20+ } ) ;
21+ } , [ ] ) ;
22+
23+ if ( ! state . show ) return null ;
24+
25+ return (
26+ < div className = "flex flex-row items-center justify-center w-full py-2 text-lg font-medium dark:text-gray-300 bg-white dark:bg-zinc-700 shadow" >
27+ < div className = "w-full max-w-6xl px-4 flex flex-row justify-between items-center gap-x-3" >
28+ < span > A lightweight, self-hosted memo hub. Open Source and Free forever.</ span >
29+ < a className = "btn-primary shadow" href = "https://usememos.com/docs/install/docker" target = "_blank" >
30+ Install
31+ < Icon . ExternalLink className = "w-4 h-auto ml-1" />
32+ </ a >
33+ </ div >
34+ </ div >
35+ ) ;
36+ } ;
37+
38+ export default DemoBanner ;
Original file line number Diff line number Diff line change 11import { Outlet } from "react-router-dom" ;
22import Header from "@/components/Header" ;
33import UpgradeVersionBanner from "@/components/UpgradeVersionBanner" ;
4+ import DemoBanner from "@/components/DemoBanner" ;
45
56function Root ( ) {
67 return (
78 < div className = "w-full min-h-full bg-zinc-100 dark:bg-zinc-800" >
89 < div className = "w-full h-auto flex flex-col justify-start items-center" >
10+ < DemoBanner />
911 < UpgradeVersionBanner />
1012 </ div >
1113 < div className = "w-full max-w-6xl mx-auto flex flex-row justify-center items-start" >
You can’t perform that action at this time.
0 commit comments