added skip add-child for new users to allow for adding a shared child

This commit is contained in:
Brian Bjarke Jensen
2025-11-11 14:39:59 +01:00
parent dea3b5d3b5
commit c745ab1b7a
2 changed files with 45 additions and 2 deletions
+19
View File
@@ -192,6 +192,15 @@
Cancel
</button>
</form>
<div id="skipOption" style="text-align: center; margin-top: 20px; display: none;">
<p style="color: #666; font-size: 14px; margin-bottom: 10px;">
Want to accept a child share invitation first?
</p>
<button type="button" class="button secondary" onclick="skipToHome()" style="margin: 0;">
Skip for now
</button>
</div>
</div>
<script>
@@ -205,11 +214,17 @@
const urlParams = new URLSearchParams(window.location.search);
const childId = urlParams.get("id");
const isEditMode = !!childId;
const fromHome = urlParams.get("from") === "home"; // Check if redirected from home
const form = document.getElementById("addChildForm");
const messageDiv = document.getElementById("message");
const submitBtn = document.getElementById("submitBtn");
// Show skip option if user was redirected from home (has no children)
if (fromHome && !isEditMode) {
document.getElementById("skipOption").style.display = "block";
}
// Update page title and button text if editing
if (isEditMode) {
document.querySelector("h1").textContent = "✏️ Edit Child";
@@ -317,6 +332,10 @@
function goBack() {
window.location.href = "/";
}
function skipToHome() {
window.location.href = "/";
}
</script>
</body>
</html>