@@ -152,6 +152,9 @@ const GeneralSettings = () => {
152152 const [ canvasFolderPath , setCanvasFolderPath ] = useState < string > (
153153 plugin . settings . canvasFolderPath ,
154154 ) ;
155+ const [ username , setUsername ] = useState < string > (
156+ plugin . settings . username || "" ,
157+ ) ;
155158 const [ canvasAttachmentsFolderPath , setCanvasAttachmentsFolderPath ] =
156159 useState < string > ( plugin . settings . canvasAttachmentsFolderPath ) ;
157160 const [ nodeTagHotkey , setNodeTagHotkey ] = useState < string > (
@@ -203,6 +206,12 @@ const GeneralSettings = () => {
203206 [ plugin ] ,
204207 ) ;
205208
209+ const handleSetUsername = ( newValue : string ) => {
210+ setUsername ( newValue ) ;
211+ plugin . settings . username = newValue ;
212+ void plugin . saveSettings ( ) ;
213+ } ;
214+
206215 return (
207216 < div className = "general-settings" >
208217 < div className = "setting-item" >
@@ -307,6 +316,27 @@ const GeneralSettings = () => {
307316 </ div >
308317 </ div >
309318
319+ < div
320+ className = {
321+ "setting-item " + ( plugin . settings . syncModeEnabled ? "" : "hidden" )
322+ }
323+ >
324+ < div className = "setting-item-info" >
325+ < div className = "setting-item-name" > Username</ div >
326+ < div className = "setting-item-description" >
327+ A username that will be associated with your vault if you share
328+ data.
329+ </ div >
330+ </ div >
331+ < div className = "setting-item-control" >
332+ < input
333+ type = "text"
334+ value = { username }
335+ onChange = { ( e ) => handleSetUsername ( e . target . value ) }
336+ />
337+ </ div >
338+ </ div >
339+
310340 < InfoSection />
311341 </ div >
312342 ) ;
0 commit comments