This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Bwc9876/dev
0.6.0
- Loading branch information
Showing
30 changed files
with
514 additions
and
135 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Placement } from "@popperjs/core"; | ||
import PropTypes from "prop-types"; | ||
import { Popover, PopoverBody, PopoverHeader } from "react-bootstrap"; | ||
import IconPopoverTrigger from "./IconPopoverTrigger"; | ||
|
||
export type DescriptionPopoverProps = { | ||
id: string; | ||
title: string; | ||
body: string; | ||
icon: PropTypes.ReactElementLike; | ||
className?: string; | ||
placement?: Placement; | ||
}; | ||
|
||
function IconPopover(props: DescriptionPopoverProps) { | ||
const popover = ( | ||
<Popover className="position-absolute" id={`${props.id}-popover`}> | ||
<PopoverHeader>{props.title}</PopoverHeader> | ||
<PopoverBody>{props.body}</PopoverBody> | ||
</Popover> | ||
); | ||
|
||
return ( | ||
<IconPopoverTrigger | ||
className={props.className} | ||
popover={popover} | ||
icon={props.icon} | ||
placement={props.placement} | ||
ariaLabel="Info" | ||
/> | ||
); | ||
} | ||
|
||
export default IconPopover; |
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,33 @@ | ||
import { Placement } from "@popperjs/core"; | ||
import PropTypes from "prop-types"; | ||
import { cloneElement } from "react"; | ||
import { OverlayTrigger } from "react-bootstrap"; | ||
|
||
export type InfoIconTriggerProps = { | ||
popover: PropTypes.ReactElementLike; | ||
icon: PropTypes.ReactElementLike; | ||
ariaLabel: string; | ||
className?: string; | ||
placement?: Placement; | ||
}; | ||
|
||
function IconPopoverTrigger(props: InfoIconTriggerProps) { | ||
// noinspection RequiredAttributes | ||
return ( | ||
<OverlayTrigger | ||
delay={{ show: 50, hide: 50 }} | ||
trigger={["hover", "focus"]} | ||
placement={props.placement ?? "right"} | ||
overlay={props.popover} | ||
> | ||
{cloneElement(props.icon, { | ||
className: `ms-2 fs-6 text-secondary${ | ||
props.className ? ` ${props.className}` : "" | ||
}`, | ||
"aria-label": props.ariaLabel | ||
})} | ||
</OverlayTrigger> | ||
); | ||
} | ||
|
||
export default IconPopoverTrigger; |
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
21 changes: 0 additions & 21 deletions
21
src/MainWindow/Panels/Editor/Editors/Inspector/FieldTemplates/DescriptionPopover.tsx
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/MainWindow/Panels/Editor/Editors/Inspector/FieldTemplates/InfoIconTrigger.tsx
This file was deleted.
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
Oops, something went wrong.