-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into injiweb-700-share-validity
Signed-off-by: Vijay Kumar S <[email protected]>
- Loading branch information
Showing
13 changed files
with
756 additions
and
444 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
import React from "react"; | ||
import {HelpAccordionItemProps} from "../../types/components"; | ||
import {IoIosArrowDown, IoIosArrowUp} from "react-icons/io"; | ||
|
||
import { HelpAccordionItemProps } from "../../types/components"; | ||
import { IoIosArrowDown, IoIosArrowUp } from "react-icons/io"; | ||
import {renderContent} from "../../utils/builder"; | ||
|
||
export const HelpAccordionItem: React.FC<HelpAccordionItemProps> = (props) => { | ||
|
||
return <React.Fragment> | ||
<div className="rounded-md mb-2 shadow-sm shadow-iw-shadow" | ||
data-testid="Help-Item-Container"> | ||
<button | ||
data-testid="Help-Item-Title-Button" | ||
className="w-full p-5 text-left font-bold hover:bg-iw-helpAccordionHover focus:outline-none" | ||
onClick={() => props.setOpen(props.id === props.open ? -1 : props.id)} | ||
> | ||
<div className={"flex flex-row text-iw-title"} | ||
data-testid="Help-Item-Title-Text"> | ||
{props.title} | ||
<div className={"flex items-center ms-auto"}> | ||
{ | ||
(props.id === props.open) ? <IoIosArrowUp size={20} data-testid="Help-Item-UpArrow"/> : | ||
<IoIosArrowDown size={20} data-testid="Help-Item-DownArrow"/> | ||
} | ||
return ( | ||
<React.Fragment> | ||
<div className="rounded-md mb-2 shadow-sm shadow-iw-shadow" | ||
data-testid="Help-Item-Container"> | ||
<button | ||
data-testid="Help-Item-Title-Button" | ||
className="w-full p-5 text-left font-bold hover:bg-iw-helpAccordionHover focus:outline-none" | ||
onClick={() => props.setOpen(props.id === props.open ? -1 : props.id)} | ||
> | ||
<div className={"flex flex-row text-iw-title"} | ||
data-testid="Help-Item-Title-Text"> | ||
{props.title} | ||
<div className={"flex items-center ms-auto"}> | ||
{ | ||
(props.id === props.open) ? <IoIosArrowUp size={20} data-testid="Help-Item-UpArrow"/> : | ||
<IoIosArrowDown size={20} data-testid="Help-Item-DownArrow"/> | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</button> | ||
{(props.id === props.open) && ( | ||
<div className="p-5 bg-iw-background border-t-2" | ||
data-testid="Help-Item-Content-Text"> | ||
{props.content.map((content, index) => <p key={index} className={"text-iw-title"}>{content}</p>)} | ||
|
||
</div> | ||
)} | ||
</div> | ||
</React.Fragment> | ||
} | ||
</button> | ||
{(props.id === props.open) && ( | ||
<div className="p-5 bg-iw-background border-t-2" | ||
data-testid="Help-Item-Content-Text"> | ||
{props.content.map((content, index) => ( | ||
<p key={index} className={"text-iw-title"}> | ||
{renderContent(content)} | ||
</p> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
Oops, something went wrong.