-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement foundation for LoggingView * Move stop tag to opmode types * Add LoggingLayout to ViewPicker and layout enum * Install libs * Add col-resize cursor to tailwind config * Progress on the logging view * Finalize logging view functionality * Slight styling tweaks * Install headless ui * Implement logging view column visibility * Fix typescript complaint
- Loading branch information
Showing
22 changed files
with
2,288 additions
and
1,439 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,51 @@ | ||
import { useRef, FunctionComponent, RefObject, ReactNode } from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
|
||
import styled from 'styled-components'; | ||
|
||
interface ToolTipElProps { | ||
isShowing: boolean; | ||
top: string; | ||
left: string; | ||
} | ||
|
||
export const ToolTipEl = styled.span.attrs<ToolTipElProps>((props) => ({ | ||
className: `fixed rounded-md px-3 py-1 w-max bg-gray-800 bg-opacity-80 text-white text-sm pointer-events-none transform transition ${ | ||
props.isShowing ? '-translate-y-11 opacity-100' : '-translate-y-9 opacity-0' | ||
}`, | ||
}))<ToolTipElProps>` | ||
top: ${(props) => props.top}; | ||
left: ${(props) => props.left}; | ||
`; | ||
|
||
interface ToolTipProps { | ||
children: ReactNode; | ||
hoverRef: RefObject<HTMLElement | null>; | ||
isShowing: boolean; | ||
} | ||
|
||
const ToolTip: FunctionComponent<ToolTipProps> = ({ | ||
children, | ||
hoverRef, | ||
isShowing, | ||
}: ToolTipProps) => { | ||
const tooltipRef = useRef<HTMLSpanElement | null>(null); | ||
|
||
return createPortal( | ||
<ToolTipEl | ||
ref={tooltipRef} | ||
isShowing={isShowing} | ||
top={`${hoverRef.current?.getBoundingClientRect().top}px`} | ||
left={`${ | ||
(hoverRef.current?.getBoundingClientRect().left ?? 0) + | ||
(hoverRef.current?.clientWidth ?? 0) / 2 - | ||
(tooltipRef.current?.clientWidth ?? 0) / 2 | ||
}px`} | ||
> | ||
{children} | ||
</ToolTipEl>, | ||
document.body, | ||
); | ||
}; | ||
|
||
export default ToolTip; |
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
Oops, something went wrong.