From 636b0323075225c584b62719ed51e75521bb7ffb Mon Sep 17 00:00:00 2001
From: aura <nw@moneybot.cc>
Date: Tue, 17 Feb 2026 22:39:42 +0100
Subject: push source

---
 moneyjsx/src/first-landing.tsx | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 moneyjsx/src/first-landing.tsx

(limited to 'moneyjsx/src/first-landing.tsx')

diff --git a/moneyjsx/src/first-landing.tsx b/moneyjsx/src/first-landing.tsx
new file mode 100644
index 0000000..8d01512
--- /dev/null
+++ b/moneyjsx/src/first-landing.tsx
@@ -0,0 +1,55 @@
+import * as JSX from './jsx';
+import * as user from './user';
+
+import $ from 'jquery';
+
+import { GroupBox, Page, Spinner } from './components';
+
+async function saveNickname() {
+  const username = $( '#username-input' ).val() as string;
+  const spinner = $( <Spinner /> );
+  $( "#confirm-btn" ).append( spinner );
+
+  if( username.length > 1 ) {
+    try {
+      await user.savePrefs( { nickname: username } );
+      localStorage.removeItem( 'needs-setup' );
+      JSX.navigateParams( "/terminal", {} );
+    } catch( e: any ) {
+      $( "#landing-error" ).text( e.message );
+      $( "#landing-error" ).show();
+    }
+  }
+
+  spinner.remove();
+}
+
+export default function FirstLanding() {
+  if( user.settings && user.settings.nickname && user.settings.nickname.length > 1 )
+    setTimeout( () => JSX.navigateParams( "/terminal", {} ) );
+
+  if( !user.is_loggedin ) {
+    setTimeout( () => JSX.navigate( "/" ) );
+    return <Page>not logged in</Page>
+  }
+
+  return <Page>
+    <GroupBox title="First configuration">
+      <div>
+        Welcome to axonbox.net
+      </div>
+      <div>
+        Please input a username. This can be changed at any time.
+      </div>
+      <div id="landing-error" style="display: none"></div>
+      <input type="text" id="username-input" maxlength="15" placeholder="username" />
+      <div style="width: 100%; text-align: right; margin-top: -20px">
+        <button style="width: 150px; margin-right: 5px; display: inline; height: 20px"
+          class="settings-btn"
+          id="confirm-btn"
+          onclick={ saveNickname }
+        >Confirm</button>
+      </div>
+    </GroupBox>
+  </Page>
+}
-- 
cgit v1.2.3

