@@ -9,19 +9,19 @@ interface GitHubDomainCheckerProps {
99export function GitHubDomainChecker ( { id} : GitHubDomainCheckerProps = { } ) {
1010 const [ domain , setDomain ] = useState ( '' ) ;
1111 const [ isValidDomain , setIsValidDomain ] = useState ( false ) ;
12-
12+
1313 // Updated to handle github.com URLs with paths (e.g., github.com/user)
1414 const isGitHubCom = ( ( ) => {
1515 const trimmedDomain = domain . toLowerCase ( ) . trim ( ) ;
1616 if ( ! trimmedDomain ) return false ;
17-
17+
1818 // Remove protocol if present
1919 const domainWithoutProtocol = trimmedDomain . replace ( / ^ h t t p s ? : \/ \/ / , '' ) ;
20-
20+
2121 // Check if it starts with github.com (with or without path)
2222 return domainWithoutProtocol . startsWith ( 'github.com' ) ;
2323 } ) ( ) ;
24-
24+
2525 const hasInput = domain . trim ( ) . length > 0 ;
2626
2727 // Validate domain format
@@ -31,7 +31,7 @@ export function GitHubDomainChecker({id}: GitHubDomainCheckerProps = {}) {
3131 setIsValidDomain ( false ) ;
3232 return ;
3333 }
34-
34+
3535 // Check if it contains github.com (valid)
3636 if ( trimmedDomain . toLowerCase ( ) . includes ( 'github.com' ) ) {
3737 setIsValidDomain ( true ) ;
@@ -49,11 +49,11 @@ export function GitHubDomainChecker({id}: GitHubDomainCheckerProps = {}) {
4949 setDomain ( newDomain ) ;
5050 validateDomain ( newDomain ) ;
5151 } ;
52-
52+
5353 // Improved input styling with dark mode support
5454 const inputClassName =
5555 'form-input w-full rounded-md border-[1.5px] focus:ring-2 focus:ring-accent-purple/20 border-gray-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-400' ;
56-
56+
5757 // Use provided id or generate a fallback
5858 const inputId = id || `gh-domain-${ Date . now ( ) } ` ;
5959
@@ -78,19 +78,19 @@ export function GitHubDomainChecker({id}: GitHubDomainCheckerProps = {}) {
7878 < div className = "mt-4 p-4 rounded-md border dark:border-gray-600" >
7979 { isValidDomain ? (
8080 < div >
81- < div className = "text-sm font-medium mb-2" >
82- Recommended Installation:
83- </ div >
81+ < div className = "text-sm font-medium mb-2" > Recommended Installation:</ div >
8482 { isGitHubCom ? (
8583 < div className = "text-green-700 bg-green-50 dark:text-green-300 dark:bg-green-900/30 p-3 rounded-md" >
8684 < div className = "mb-2" >
87- < strong > GitHub</ strong > - Use the standard GitHub integration for github.com
85+ < strong > GitHub</ strong > - Use the standard GitHub integration for
86+ github.com
8887 </ div >
8988 </ div >
9089 ) : (
9190 < div className = "text-blue-700 bg-blue-50 dark:text-blue-300 dark:bg-blue-900/30 p-3 rounded-md" >
9291 < div className = "mb-2" >
93- < strong > GitHub Enterprise</ strong > - Use GitHub Enterprise integration for your domain
92+ < strong > GitHub Enterprise</ strong > - Use GitHub Enterprise integration
93+ for your domain
9494 </ div >
9595 </ div >
9696 ) }
0 commit comments