@@ -9,29 +9,42 @@ interface TokenInputProps {
99
1010export function TokenInput ( { tokenDraft, tokenChanged, onChange, onApply } : TokenInputProps ) {
1111 return (
12- < div style = { { padding : "8px 20px" , borderBottom : "2px solid var(--border-dark)" , display : "flex" , gap : "8px" , background : "var(--bg-app)" , flexShrink : 0 } } >
13- < input
14- className = "input"
15- type = "password"
16- placeholder = "GitHub Personal Access Token (optional, for higher rate limits)"
17- value = { tokenDraft }
18- onChange = { ( e ) => onChange ( e . target . value ) }
19- onKeyDown = { ( e ) => {
20- if ( e . key === "Enter" ) {
21- e . preventDefault ( ) ;
22- onApply ( ) ;
23- }
24- } }
25- style = { { flex : 1 , fontSize : "13px" , background : "var(--bg-card-dark)" , border : "2px solid var(--border-dark)" , color : "var(--text-on-dark)" , padding : "8px 12px" , outline : "none" } }
26- />
27- < button
28- type = "button"
29- style = { { fontSize : "12px" , padding : "5px 10px" , background : "transparent" , border : "1px solid var(--border-dark)" , color : "var(--text-on-dark-secondary)" , cursor : "pointer" } }
30- onClick = { onApply }
31- disabled = { ! tokenChanged }
32- >
33- Apply
34- </ button >
12+ < div style = { { padding : "8px 20px 10px" , borderBottom : "2px solid var(--border-dark)" , background : "var(--bg-app)" , flexShrink : 0 } } >
13+ < div style = { { display : "flex" , gap : "8px" } } >
14+ < input
15+ className = "input"
16+ type = "password"
17+ placeholder = "GitHub Personal Access Token (required for private repos)"
18+ value = { tokenDraft }
19+ onChange = { ( e ) => onChange ( e . target . value ) }
20+ onKeyDown = { ( e ) => {
21+ if ( e . key === "Enter" ) {
22+ e . preventDefault ( ) ;
23+ onApply ( ) ;
24+ }
25+ } }
26+ style = { { flex : 1 , fontSize : "13px" , background : "var(--bg-card-dark)" , border : "2px solid var(--border-dark)" , color : "var(--text-on-dark)" , padding : "8px 12px" , outline : "none" } }
27+ />
28+ < button
29+ type = "button"
30+ style = { { fontSize : "12px" , padding : "5px 10px" , background : "transparent" , border : "1px solid var(--border-dark)" , color : "var(--text-on-dark-secondary)" , cursor : "pointer" } }
31+ onClick = { onApply }
32+ disabled = { ! tokenChanged }
33+ >
34+ Apply
35+ </ button >
36+ </ div >
37+ < div style = { { marginTop : "5px" , fontSize : "11px" , color : "var(--text-on-dark-secondary)" } } >
38+ Don't have one?{ " " }
39+ < a
40+ href = "https://github.com/settings/tokens/new?scopes=repo& description = GitAsk "
41+ target = "_blank"
42+ rel = "noopener noreferrer"
43+ style = { { color : "var(--text-on-dark-secondary)" , textDecoration : "underline" , textUnderlineOffset : "2px" } }
44+ >
45+ Get a GitHub token
46+ </ a >
47+ </ div >
3548 </ div >
3649 ) ;
3750}
0 commit comments