added skip add-child for new users to allow for adding a shared child
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user