-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue with missing DialogTitle/DialogDescription, fix issue with …
…hot reloads
- Loading branch information
1 parent
18cf814
commit 460a407
Showing
27 changed files
with
136 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import { forwardRef } from "react"; | ||
|
||
type BrandIconProps = { | ||
slug: string; | ||
}; | ||
|
||
export const BrandIcon = ({ slug }: BrandIconProps) => { | ||
export const BrandIcon = forwardRef<HTMLImageElement, BrandIconProps>(({ slug }, ref) => { | ||
if (slug === "linkedin") { | ||
return ( | ||
<img | ||
alt="linkedin" | ||
ref={ref} | ||
alt="LinkedIn" | ||
className="size-4" | ||
src={`${window.location.origin}/support-logos/linkedin.svg`} | ||
/> | ||
); | ||
} | ||
|
||
return <img alt={slug} className="size-4" src={`https://cdn.simpleicons.org/${slug}`} />; | ||
}; | ||
return ( | ||
<img ref={ref} alt={slug} className="size-4" src={`https://cdn.simpleicons.org/${slug}`} /> | ||
); | ||
}); | ||
|
||
BrandIcon.displayName = "BrandIcon"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,38 @@ | ||
import { cn } from "@reactive-resume/utils"; | ||
import { forwardRef, useEffect } from "react"; | ||
import { useDebounceValue } from "usehooks-ts"; | ||
|
||
type BrandIconProps = { | ||
slug: string; | ||
}; | ||
|
||
export const BrandIcon = ({ slug }: BrandIconProps) => { | ||
if (slug === "linkedin") { | ||
export const BrandIcon = forwardRef<HTMLImageElement, BrandIconProps>(({ slug }, ref) => { | ||
const [debouncedSlug, setValue] = useDebounceValue(slug, 600); | ||
|
||
useEffect(() => { | ||
setValue(slug); | ||
}, [slug]); | ||
|
||
if (!slug) return null; | ||
|
||
if (debouncedSlug === "linkedin") { | ||
return ( | ||
<img | ||
ref={ref} | ||
alt="LinkedIn" | ||
className="size-5" | ||
src={`${window.location.origin}/support-logos/linkedin.svg`} | ||
/> | ||
); | ||
} | ||
|
||
return <i className={cn("si si--color text-[1.25rem]", `si-${slug}`)} />; | ||
}; | ||
return ( | ||
<img | ||
ref={ref} | ||
alt={debouncedSlug} | ||
className="size-5" | ||
src={`https://cdn.simpleicons.org/${debouncedSlug}`} | ||
/> | ||
); | ||
}); | ||
|
||
BrandIcon.displayName = "BrandIcon"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.