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 cb645c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
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;
3 changes: 2 additions & 1 deletion src/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ type PopperProps = {
closeAriaLabel?: string;
};

const Popper = React.forwardRef<LegacyRef, PopperProps>(
// We can't get rid of the any here because Popper types are loose too
const Popper = React.forwardRef<React.Ref<any>, PopperProps>(
(
{
id,
Expand Down
5 changes: 3 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,8 @@ export type TooltipProps = {
children?: React.ReactNode;
};

const Tooltip = React.forwardRef<any, TooltipProps>(
// We can't get rid of the any type here because Popper types are loose too
const Tooltip = React.forwardRef<React.Ref<any>, TooltipProps>(
(
{
showDelay = "100",
Expand Down

0 comments on commit cb645c2

Please sign in to comment.