-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[YW][#4578] Fixes and improvements for redesigned create/edit univers…
…e page Summary: - group instance types in a dropdown list - rearrange DB Config step and change ports override component as discussed - tune the toggle component as per design - finalize the tooltip component - refactor common styles and introduce `clsx` lib - modify general page layout to occupy more space and add scroll inside the form area - always show universe name in the header - style `Summary` widget as per design - fix bugs for edit universe logic {F14500} {F14501} {F14502} Test Plan: Run UI, access creation of a new universe at `http://<host>/universe/create` Edit universe - `http://<host>/universe/<universe-uuid>/edit/primary` Reviewers: andrew Reviewed By: andrew Subscribers: ui Differential Revision: https://phabricator.dev.yugabyte.com/D9918
- Loading branch information
Showing
48 changed files
with
541 additions
and
430 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
} | ||
|
||
&__input { | ||
width: 350px; | ||
width: 400px; | ||
|
||
&:first-child { | ||
margin-right: 20px; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
import React, { FC } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import React, { FC, useLayoutEffect, useRef, useState } from 'react'; | ||
import { useHoverDirty } from 'react-use'; | ||
import './Tooltip.scss'; | ||
|
||
// TODO: put tooltip element outside of parent component (use portal?) + use popper.js to properly position it | ||
const docBody = document.body; | ||
|
||
export const Tooltip: FC = ({ children }) => { | ||
const handle = useRef<HTMLDivElement>(null); | ||
const isHovering = useHoverDirty(handle); | ||
const [top, setTop] = useState<number>(0); | ||
const [left, setLeft] = useState<number>(0); | ||
|
||
// update tooltip position to show it right below the tooltip handle | ||
useLayoutEffect(() => { | ||
if (isHovering && handle.current) { | ||
const handleRect = handle.current.getBoundingClientRect(); | ||
setTop(handleRect.bottom); | ||
setLeft(handleRect.left); | ||
} | ||
}, [isHovering]); | ||
|
||
// render tooltip popup via portal to properly show it when any parent element has "overflow: hidden" | ||
return ( | ||
<> | ||
<div className="yb-uikit-tooltip"> | ||
<div className="yb-uikit-tooltip__handler" /> | ||
<div className="yb-uikit-tooltip__content">{children}</div> | ||
</div> | ||
</> | ||
<div className="yb-uikit-tooltip"> | ||
<div className="yb-uikit-tooltip__handle" ref={handle} /> | ||
{ReactDOM.createPortal( | ||
<div className="yb-uikit-tooltip-popup" style={{ left, top, opacity: isHovering ? 1 : 0 }}> | ||
{children} | ||
</div>, | ||
docBody | ||
)} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.