-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc6f84f
commit 2dd9876
Showing
6 changed files
with
149 additions
and
76 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
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,28 +1,50 @@ | ||
const InfoBar = ({ title }) => { | ||
return ( | ||
<h1 | ||
className="group relative z-20 scroll-mt-20 text-3xl font-bold text-gray-800 dark:text-white capitalize my-4" | ||
id="default-table" | ||
interface IInfoBarProps { | ||
title: string; | ||
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; | ||
}; | ||
|
||
const Content = ({ title }) => ( | ||
<> | ||
<a | ||
aria-hidden="true" | ||
tabIndex={-1} | ||
target="_blank" | ||
rel="noreferrer" | ||
href="#default-table" | ||
className="text-gray-800" | ||
> | ||
<a | ||
aria-hidden="true" | ||
tabIndex={-1} | ||
target="_blank" | ||
rel="noreferrer" | ||
href="#default-table" | ||
> | ||
{title} | ||
</a> | ||
{title} | ||
</a> | ||
|
||
<a | ||
href="#" | ||
aria-label="" | ||
className="ml-2 text-violet-900 opacity-0 transition-opacity group-hover:opacity-100 dark:text-primary-500" | ||
> | ||
# | ||
</a> | ||
</> | ||
); | ||
|
||
const className = "group relative z-20 scroll-mt-20 text-3xl font-bold text-gray-800 dark:text-white capitalize my-4"; | ||
const id = "default-table"; | ||
|
||
<a | ||
href="#" | ||
aria-label="" | ||
className="ml-2 text-violet-900 opacity-0 transition-opacity group-hover:opacity-100 dark:text-primary-500" | ||
> | ||
# | ||
</a> | ||
</h1> | ||
); | ||
const InfoBar = ({ title, as = "h1" }: IInfoBarProps) => { | ||
switch (as) { | ||
case "h6": | ||
return <h6 id={id} className={className}><Content title={title} /></h6>; | ||
case "h5": | ||
return <h5 id={id} className={className}><Content title={title} /></h5>; | ||
case "h4": | ||
return <h4 id={id} className={className}><Content title={title} /></h4>; | ||
case "h3": | ||
return <h3 id={id} className={className}><Content title={title} /></h3>; | ||
case "h2": | ||
return <h2 id={id} className={className}><Content title={title} /></h2>; | ||
case "h1": | ||
default: | ||
return <h1 id={id} className={className}><Content title={title} /></h1>; | ||
} | ||
}; | ||
|
||
export default InfoBar; |
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