Place popover to right on edit pages (#3939)

This commit is contained in:
WithoutPants
2023-07-26 09:23:50 +10:00
committed by GitHub
parent 40124ee5a4
commit eb8a69e326
8 changed files with 23 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ import { galleryTitle } from "src/core/galleries";
import { TagPopover } from "../Tags/TagPopover";
import { defaultMaxOptionsShown, IUIConfig } from "src/core/config";
import { useDebouncedSetState } from "src/hooks/debounce";
import { Placement } from "react-bootstrap/esm/Overlay";
export type SelectObject = {
id: string;
@@ -832,9 +833,9 @@ export const MovieSelect: React.FC<IFilterProps> = (props) => {
);
};
export const TagSelect: React.FC<IFilterProps & { excludeIds?: string[] }> = (
props
) => {
export const TagSelect: React.FC<
IFilterProps & { excludeIds?: string[]; hoverPlacement?: Placement }
> = (props) => {
const [tagAliases, setTagAliases] = useState<Record<string, string[]>>({});
const [allAliases, setAllAliases] = useState<string[]>([]);
const { data, loading } = useAllTagsForFilter();
@@ -890,7 +891,7 @@ export const TagSelect: React.FC<IFilterProps & { excludeIds?: string[] }> = (
: optionProps.data.value;
return (
<TagPopover id={id}>
<TagPopover id={id} placement={props.hoverPlacement}>
<reactSelectComponents.Option {...thisOptionProps} />
</TagPopover>
);

View File

@@ -15,6 +15,7 @@ import { galleryTitle } from "src/core/galleries";
import * as GQL from "src/core/generated-graphql";
import { TagPopover } from "../Tags/TagPopover";
import { markerTitle } from "src/core/markers";
import { Placement } from "react-bootstrap/esm/Overlay";
interface IFile {
path: string;
@@ -40,6 +41,7 @@ interface IProps {
scene?: Partial<Pick<SceneDataFragment, "id" | "title" | "files">>;
gallery?: Partial<IGallery>;
className?: string;
hoverPlacement?: Placement;
}
export const TagLink: React.FC<IProps> = (props: IProps) => {
@@ -84,7 +86,7 @@ export const TagLink: React.FC<IProps> = (props: IProps) => {
}
return (
<Badge className={cx("tag-item", props.className)} variant="secondary">
<TagPopover id={id}>
<TagPopover id={id} placement={props.hoverPlacement}>
<Link to={link}>{title}</Link>
</TagPopover>
</Badge>