feat(app): add login button to info modal (#755)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Anton Tranelis 2026-03-13 10:15:20 +01:00 committed by GitHub
parent 298560c02e
commit 9a6ec7d7c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 20 deletions

View File

@ -5,7 +5,8 @@
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
import { useEffect, useState } from 'react'
import { TextView } from 'utopia-ui'
import { useNavigate } from 'react-router-dom'
import { TextView, useAuth } from 'utopia-ui'
import { config } from './config'
@ -15,20 +16,35 @@ interface ChapterProps {
}
export function Welcome1({ clickAction1, map }: ChapterProps) {
const { isAuthenticated } = useAuth()
const navigate = useNavigate()
return (
<>
{map.custom_text ? (
<>
<TextView rawText={map.custom_text}></TextView>
<div className='tw:grid'>
<label
className='tw:btn tw:btn-primary tw:place-self-end tw:mt-4'
onClick={() => {
clickAction1()
}}
>
Close
</label>
<div className='tw:grid tw:mt-4'>
{isAuthenticated ? (
<label
className='tw:btn tw:btn-primary tw:place-self-end'
onClick={() => {
clickAction1()
}}
>
Close
</label>
) : (
<label
className='tw:btn tw:btn-primary tw:place-self-end'
onClick={() => {
clickAction1()
void navigate('/login')
}}
>
Login
</label>
)}
</div>
</>
) : (
@ -45,15 +61,27 @@ export function Welcome1({ clickAction1, map }: ChapterProps) {
Join us and grow the network by adding projects and events to the map.
</p>
<p className='tw:py-1'>Create your personal profile and place it on the map.</p>
<div className='tw:grid'>
<label
className='tw:btn tw:btn-primary tw:place-self-end tw:mt-4'
onClick={() => {
clickAction1()
}}
>
Close
</label>
<div className='tw:grid tw:mt-4'>
{isAuthenticated ? (
<label
className='tw:btn tw:btn-primary tw:place-self-end'
onClick={() => {
clickAction1()
}}
>
Close
</label>
) : (
<label
className='tw:btn tw:btn-primary tw:place-self-end'
onClick={() => {
clickAction1()
void navigate('/login')
}}
>
Login
</label>
)}
</div>
</>
)}

View File

@ -1,4 +1,4 @@
export { AuthProvider } from './useAuth'
export { AuthProvider, useAuth } from './useAuth'
export { LoginPage } from './LoginPage'
export { SignupPage } from './SignupPage'
export { RequestPasswordPage } from './RequestPasswordPage'