11import React , { useState } from 'react' ;
2- import { Container , Flex , Card , Heading , Text , TextField , Button , Callout } from '@radix-ui/themes' ;
2+ import { Container , Flex , Card , Heading , Text , TextField , Button , Callout , Box } from '@radix-ui/themes' ;
33import { useAuthStore } from '../stores/authStore' ;
4+ import { AsciiArt } from './AsciiArt' ;
45
56export function AuthScreen ( ) {
67 const [ apiKey , setApiKey ] = useState ( '' ) ;
@@ -25,71 +26,79 @@ export function AuthScreen() {
2526 } ;
2627
2728 return (
28- < Container size = "1" >
29- < Flex direction = "column" align = "center" justify = "center" minHeight = "100vh" >
30- < Card size = "3" >
31- < Flex direction = "column" gap = "6" width = "25vw" >
32- < Flex direction = "column" gap = "2" >
33- < Heading size = "4" > Array</ Heading >
34- </ Flex >
29+ < Flex height = "100vh" >
30+ { /* Left pane - Auth form */ }
31+ < Box width = "50%" className = "border-r border-gray-6" >
32+ < Container size = "1" >
33+ < Flex direction = "column" align = "center" justify = "center" height = "100vh" >
34+ < Card size = "3" >
35+ < Flex direction = "column" gap = "6" width = "25vw" >
36+ < Flex direction = "column" gap = "2" >
37+ < Heading size = "4" > Array</ Heading >
38+ </ Flex >
3539
36- < form onSubmit = { handleSubmit } >
37- < Flex direction = "column" gap = "4" >
38- < Flex direction = "column" gap = "6" >
40+ < form onSubmit = { handleSubmit } >
41+ < Flex direction = "column" gap = "4" >
42+ < Flex direction = "column" gap = "6" >
43+ < Flex direction = "column" gap = "2" >
44+ < Text as = "label" htmlFor = "apiKey" size = "2" weight = "medium" color = "gray" >
45+ Personal API Key
46+ </ Text >
47+ < TextField . Root
48+ id = "apiKey"
49+ type = "password"
50+ value = { apiKey }
51+ onChange = { ( e ) => setApiKey ( e . target . value ) }
52+ placeholder = "phx_..."
53+ required
54+ />
55+ < Text size = "1" color = "gray" >
56+ Get your API key from PostHog settings
57+ </ Text >
58+ </ Flex >
3959
60+ < Flex direction = "column" gap = "2" >
61+ < Text as = "label" htmlFor = "apiHost" size = "2" weight = "medium" color = "gray" >
62+ PostHog Instance URL
63+ </ Text >
64+ < TextField . Root
65+ id = "apiHost"
66+ type = "url"
67+ value = { apiHost }
68+ onChange = { ( e ) => setApiHost ( e . target . value ) }
69+ placeholder = "https://app.posthog.com"
70+ required
71+ />
72+ </ Flex >
73+ </ Flex >
4074
41- < Flex direction = "column" gap = "2" >
42- < Text as = "label" htmlFor = "apiKey" size = "2" weight = "medium" color = "gray" >
43- Personal API Key
44- </ Text >
45- < TextField . Root
46- id = "apiKey"
47- type = "password"
48- value = { apiKey }
49- onChange = { ( e ) => setApiKey ( e . target . value ) }
50- placeholder = "phx_..."
51- required
52- />
53- < Text size = "1" color = "gray" >
54- Get your API key from PostHog settings
55- </ Text >
56- </ Flex >
75+ { error && (
76+ < Callout . Root color = "red" >
77+ < Callout . Text > { error } </ Callout . Text >
78+ </ Callout . Root >
79+ ) }
5780
58- < Flex direction = "column" gap = "2" >
59- < Text as = "label" htmlFor = "apiHost" size = "2" weight = "medium" color = "gray" >
60- PostHog Instance URL
61- </ Text >
62- < TextField . Root
63- id = "apiHost"
64- type = "url"
65- value = { apiHost }
66- onChange = { ( e ) => setApiHost ( e . target . value ) }
67- placeholder = "https://app.posthog.com"
68- required
69- />
81+ < Button
82+ type = "submit"
83+ disabled = { isLoading || ! apiKey }
84+ variant = 'classic'
85+ size = "3"
86+ mt = "4"
87+ >
88+ { isLoading ? 'Connecting...' : 'Connect' }
89+ </ Button >
7090 </ Flex >
71- </ Flex >
72-
73- { error && (
74- < Callout . Root color = "red" >
75- < Callout . Text > { error } </ Callout . Text >
76- </ Callout . Root >
77- ) }
78-
79- < Button
80- type = "submit"
81- disabled = { isLoading || ! apiKey }
82- variant = 'classic'
83- size = "3"
84- mt = "4"
85- >
86- { isLoading ? 'Connecting...' : 'Connect' }
87- </ Button >
91+ </ form >
8892 </ Flex >
89- </ form >
93+ </ Card >
9094 </ Flex >
91- </ Card >
92- </ Flex >
93- </ Container >
95+ </ Container >
96+ </ Box >
97+
98+ { /* Right pane - ASCII Art */ }
99+ < Box width = "50%" height = "100%" >
100+ < AsciiArt scale = { 1 } />
101+ </ Box >
102+ </ Flex >
94103 ) ;
95104}
0 commit comments