mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 05:29:33 +00:00
improvement: allow users to expand collapsed environment view header
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { MouseEventHandler } from "react";
|
||||
|
||||
export const HeaderResizer = ({
|
||||
onMouseDown,
|
||||
isActive
|
||||
}: {
|
||||
onMouseDown: MouseEventHandler<HTMLDivElement>;
|
||||
isActive: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
tabIndex={-1}
|
||||
role="button"
|
||||
className={`absolute bottom-[0.02rem] left-0 z-40 h-0.5 w-full cursor-ns-resize hover:bg-blue-400/20 ${
|
||||
isActive ? "bg-blue-400/75" : "bg-transparent"
|
||||
}`}
|
||||
onMouseDown={onMouseDown}
|
||||
style={{
|
||||
transform: "translateY(50%)"
|
||||
}}
|
||||
/>
|
||||
<div className="pointer-events-none absolute -bottom-[0.1rem] left-1/2 z-30 -translate-x-1/2">
|
||||
<div className="h-1 w-8 rounded bg-gray-400 opacity-50" />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -45,10 +45,14 @@ export const Table = ({ children, className }: TableProps): JSX.Element => (
|
||||
export type THeadProps = {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
};
|
||||
|
||||
export const THead = ({ children, className }: THeadProps): JSX.Element => (
|
||||
<thead className={twMerge("bg-mineshaft-800 text-xs uppercase text-bunker-300", className)}>
|
||||
export const THead = ({ children, className, style }: THeadProps): JSX.Element => (
|
||||
<thead
|
||||
className={twMerge("bg-mineshaft-800 text-xs uppercase text-bunker-300", className)}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</thead>
|
||||
);
|
||||
@@ -96,14 +100,16 @@ export const Tr = ({
|
||||
export type ThProps = {
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
};
|
||||
|
||||
export const Th = ({ children, className }: ThProps): JSX.Element => (
|
||||
export const Th = ({ children, className, style }: ThProps): JSX.Element => (
|
||||
<th
|
||||
className={twMerge(
|
||||
"border-b-2 border-mineshaft-600 bg-mineshaft-800 px-5 pb-3.5 pt-4 font-semibold",
|
||||
className
|
||||
)}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</th>
|
||||
|
||||
Reference in New Issue
Block a user