Browse Source

fixed tsc errors

pull/649/head
Dan Ditomaso 1 year ago
parent
commit
23c75a34ee
  1. 2
      src/components/PageComponents/Messages/TraceRoute.test.tsx
  2. 14
      src/components/UI/Button.tsx
  3. 6
      src/components/UI/Typography/Link.tsx
  4. 4
      src/pages/Nodes/index.tsx

2
src/components/PageComponents/Messages/TraceRoute.test.tsx

@ -104,10 +104,8 @@ describe("TraceRoute", () => {
/>, />,
); );
// Check for the translated title
expect(screen.getByText("Route back:")).toBeInTheDocument(); expect(screen.getByText("Route back:")).toBeInTheDocument();
// With route back, both names appear twice
expect(screen.getAllByText("Source Node")).toHaveLength(2); expect(screen.getAllByText("Source Node")).toHaveLength(2);
expect(screen.getAllByText("Destination Node")).toHaveLength(2); expect(screen.getAllByText("Destination Node")).toHaveLength(2);

14
src/components/UI/Button.tsx

@ -46,9 +46,7 @@ export interface ButtonProps
iconAlignment?: "left" | "right"; iconAlignment?: "left" | "right";
} }
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( const Button = ({
(
{
className, className,
variant, variant,
size, size,
@ -57,9 +55,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
iconAlignment = "left", iconAlignment = "left",
children, children,
...props ...props
}, }: ButtonProps) => {
ref,
) => {
return ( return (
<button <button
type="button" type="button"
@ -68,7 +64,6 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
{ "cursor-not-allowed": disabled }, { "cursor-not-allowed": disabled },
"inline-flex items-center", "inline-flex items-center",
)} )}
ref={ref}
disabled={disabled} disabled={disabled}
{...props} {...props}
> >
@ -76,14 +71,11 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
<span className={cn({ "mr-2": !!children })}>{icon}</span> <span className={cn({ "mr-2": !!children })}>{icon}</span>
)} )}
{children} {children}
{icon && iconAlignment === "right" && ( {icon && iconAlignment === "right" && (
<span className={cn({ "ml-2": !!children })}>{icon}</span> <span className={cn({ "ml-2": !!children })}>{icon}</span>
)} )}
</button> </button>
); );
}, };
);
Button.displayName = "Button";
export { Button, buttonVariants }; export { Button, buttonVariants };

6
src/components/UI/Typography/Link.tsx

@ -6,7 +6,11 @@ import {
export interface LinkProps extends RouterLinkProps { export interface LinkProps extends RouterLinkProps {
href: string; href: string;
children?: React.ReactNode; children?:
| React.ReactNode
| ((
state: { isActive: boolean; isTransitioning: boolean },
) => React.ReactNode);
className?: string; className?: string;
} }

4
src/pages/Nodes/index.tsx

@ -1,5 +1,5 @@
import { LocationResponseDialog } from "@app/components/Dialog/LocationResponseDialog.tsx"; import { LocationResponseDialog } from "@components/Dialog/LocationResponseDialog.tsx";
import { TracerouteResponseDialog } from "@app/components/Dialog/TracerouteResponseDialog.tsx"; import { TracerouteResponseDialog } from "@components/Dialog/TracerouteResponseDialog.tsx";
import { Sidebar } from "@components/Sidebar.tsx"; import { Sidebar } from "@components/Sidebar.tsx";
import { Avatar } from "@components/UI/Avatar.tsx"; import { Avatar } from "@components/UI/Avatar.tsx";
import { Mono } from "@components/generic/Mono.tsx"; import { Mono } from "@components/generic/Mono.tsx";

Loading…
Cancel
Save