-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: VF-WP GitHub Actions Bot <[email protected]>
- Loading branch information
VF-WP GitHub Actions Bot
authored and
VF-WP GitHub Actions Bot
committed
Nov 20, 2024
1 parent
c6bb5b0
commit 59b8b37
Showing
16 changed files
with
153 additions
and
67 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
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
60 changes: 60 additions & 0 deletions
60
wp-content/themes/vf-wp/assets/assets/vf-tabs/vf-tabs.react.js
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* vf-tabs react component | ||
* See vf-extensions-react for usage guidance | ||
* | ||
*/ | ||
import { useEffect } from "react"; | ||
import { vfTabs } from "@visual-framework/vf-tabs/vf-tabs"; | ||
|
||
function VfTabs(tabsData) { | ||
useEffect(() => { | ||
vfTabs(); | ||
}, []); | ||
return ( | ||
<> | ||
<div className="vf-tabs"> | ||
<ul className="vf-tabs__list" data-vf-js-tabs> | ||
{Object.entries(tabsData).map(tab_forlink => { | ||
return ( | ||
<li className="vf-tabs__item" key={tab_forlink[0]}> | ||
<a | ||
className="vf-tabs__link" | ||
href={`#vf-tabs__section--${tab_forlink[1][1].tab_number}`} | ||
dangerouslySetInnerHTML={{ | ||
__html: tab_forlink[1][0].tab_title | ||
}} | ||
></a> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</div> | ||
<div className="vf-tabs-content" data-vf-js-tabs-content> | ||
{Object.entries(tabsData).map(tab_forsection => { | ||
return ( | ||
<section | ||
className="vf-tabs__section" | ||
id={`vf-tabs__section--${tab_forsection[1][1].tab_number}`} | ||
key={tab_forsection[0]} | ||
> | ||
{tab_forsection[1][2].tab_heading !== "" ? ( | ||
<h2 | ||
dangerouslySetInnerHTML={{ | ||
__html: `${tab_forsection[1][2].tab_heading}` | ||
}} | ||
></h2> | ||
) : null} | ||
<p | ||
dangerouslySetInnerHTML={{ | ||
__html: `${tab_forsection[1][3].tab_content}` | ||
}} | ||
></p> | ||
</section> | ||
); | ||
})} | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default VfTabs; |
Oops, something went wrong.