@authdog/react-elements 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,10 +12,10 @@ import { Github, AlertCircle } from "lucide-react"
12
12
  import { Alert, AlertDescription } from "../../components/ui/alert"
13
13
 
14
14
  export const LoginForm = () => {
15
- const [email, setEmail] = useState("")
16
- const [password, setPassword] = useState("")
17
- const [error, setError] = useState("")
18
- const [isLoading, setIsLoading] = useState(false)
15
+ const [email, setEmail] = useState("");
16
+ const [password, setPassword] = useState("");
17
+ const [error, setError] = useState("");
18
+ const [isLoading, setIsLoading] = useState(false);
19
19
 
20
20
  const handleEmailLogin = async (e: React.FormEvent) => {
21
21
  e.preventDefault()
@@ -1,4 +1,5 @@
1
1
  import { LucideProps } from "lucide-react"
2
+ import { useEffect, useState } from "react"
2
3
 
3
4
  const iconProps: LucideProps = {
4
5
  className: "mr-2 h-4 w-4",
@@ -6,14 +7,21 @@ const iconProps: LucideProps = {
6
7
  }
7
8
 
8
9
  export const renderIcon = ((Icon: any) => {
9
- const isMounted = typeof window !== 'undefined'
10
- if (!isMounted) return null;
10
+ const [isMounted, setIsMounted] = useState(false)
11
+
12
+ useEffect(() => {
13
+ setIsMounted(true)
14
+ }, [])
15
+
16
+ if (!isMounted) {
17
+ return <span className="mr-2 h-4 w-4" aria-hidden="true" />
18
+ }
19
+
11
20
  return <Icon {...iconProps} />
12
21
  }) as React.FC<{
13
22
  Icon: any
14
23
  }>
15
24
 
16
-
17
25
  export const IconWrapper = ({ Icon }: { Icon: any }) => {
18
26
  return (
19
27
  <span className="inline-flex items-center justify-center">