Skip to content

Commit

Permalink
fix: code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Sep 10, 2024
1 parent 0533de2 commit 86c6f5e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
7 changes: 2 additions & 5 deletions src/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useMemo } from "react";
import propTypes from "@styled-system/prop-types";
import { Reference } from "react-popper";
import { IconicButton } from "../Button";
import { ComponentSize, useComponentSize } from "../NDSProvider/ComponentSizeContext";
import { Popper } from "../Popper";
Expand All @@ -9,6 +8,7 @@ import { StyledProps } from "../StyledProps";
import DropdownMenuContainer from "./DropdownMenuContainer";

type DropdownMenuProps = {
children?: React.ReactNode;
className?: string;
size?: ComponentSize;
id?: string;
Expand Down Expand Up @@ -47,10 +47,7 @@ const transformPropsToModifiers = ({ boundariesElement }) => ({
boundariesElement,
});

const DropdownMenu: React.FC<React.PropsWithChildren<DropdownMenuProps>> = React.forwardRef<
Reference,
DropdownMenuProps
>(
const DropdownMenu = React.forwardRef<React.Ref<unknown>, DropdownMenuProps>(
(
{
trigger = () => <IconicButton icon="more" />,
Expand Down
18 changes: 13 additions & 5 deletions src/List/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import React from "react";
import styled from "styled-components";
import { space, color, typography, SpaceProps, ColorProps, TypographyProps } from "styled-system";

type Props = React.ComponentPropsWithRef<"li"> & SpaceProps & ColorProps & TypographyProps;

const ListItem = styled.li<Props>(space, color, typography, {
"&:last-child": {
marginBottom: 0,
},
});
const ListItem = styled.li<Props>(
({ theme }) => ({
color: "currentcolor",
marginBottom: theme.space.x1,
"&:last-child": {
marginBottom: 0,
},
}),
space,
color,
typography
);

export default ListItem;
2 changes: 1 addition & 1 deletion src/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type PopperProps = {
closeAriaLabel?: string;
};

const Popper = React.forwardRef<LegacyRef, PopperProps>(
const Popper = React.forwardRef<React.Ref<unknown>, PopperProps>(
(
{
id,
Expand Down
4 changes: 2 additions & 2 deletions src/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { LegacyRef } from "react";
import { Popper } from "../Popper";
import { generateId } from "../utils";
import TooltipContainer from "./TooltipContainer";
Expand Down Expand Up @@ -26,7 +26,7 @@ export type TooltipProps = {
children?: React.ReactNode;
};

const Tooltip = React.forwardRef<any, TooltipProps>(
const Tooltip = React.forwardRef<React.Ref<unknown>, TooltipProps>(
(
{
showDelay = "100",
Expand Down

0 comments on commit 86c6f5e

Please sign in to comment.