Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: changed proptype from string/IconSubComponentProps to SubIcon #2026

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC } from "react";
import cx from "classnames";
import IconButton from "../../IconButton/IconButton";
import CloseSmall from "../../Icon/Icons/components/CloseSmall";
import Icon, { IconSubComponentProps } from "../../Icon/Icon";
import Icon from "../../Icon/Icon";
import VibeComponentProps from "../../../types/VibeComponentProps";
import { NOOP } from "../../../utils/function-utils";
import { ElementContent } from "src/types/ElementContent";
Expand All @@ -12,6 +12,7 @@ import Text from "../../Text/Text";
import Heading from "../../Heading/Heading";
import Flex from "../../Flex/Flex";
import styles from "./ModalHeader.module.scss";
import { SubIcon } from "src/types";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how it behaves
Can you, for the meantime, change it to a relative path? same as other imports in the file? (../../../types)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @YossiSaadi, allow me some time I'll raise another PR.


export interface ModalHeaderProps extends VibeComponentProps {
/**
Expand All @@ -29,7 +30,8 @@ export interface ModalHeaderProps extends VibeComponentProps {
/**
* Icon to be rendered before the title
*/
icon?: string | React.FunctionComponent<IconSubComponentProps> | null;
// icon?: string | React.FunctionComponent<IconSubComponentProps> | null;
icon?: SubIcon;
/**
* Class name for the wrapper
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/components/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import React, { FC, forwardRef, ReactElement, useRef } from "react";
import { noop as NOOP } from "lodash-es";
import useMergeRef from "../../../hooks/useMergeRef";
import { getStyle } from "../../../helpers/typesciptCssModulesHelper";
import Icon, { IconSubComponentProps } from "../../Icon/Icon";
import Icon from "../../Icon/Icon";
import VibeComponentProps from "../../../types/VibeComponentProps";
import { IconType } from "../../Icon/IconConstants";
import { ComponentDefaultTestId, getTestId } from "../../../tests/test-ids-utils";
import styles from "./Tab.module.scss";
import { SubIcon } from "src/types";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same
Can you change it to a relative path? same as other imports in the file? (../../../types)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @YossiSaadi, allow me some time I'll raise another PR.


export interface TabProps extends VibeComponentProps {
/**
Expand All @@ -22,7 +23,7 @@ export interface TabProps extends VibeComponentProps {
disabled?: boolean;
active?: boolean;
focus?: boolean;
icon?: string | React.FunctionComponent<IconSubComponentProps> | null;
icon?: SubIcon;
iconType?: IconType;
iconSide?: string;
onClick?: (value: number) => void;
Expand Down