Skip to content

Commit

Permalink
fix(compatibility): re-introduce props
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Apr 11, 2024
2 parents 58edf4d + f3a4130 commit 6eabb0c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.4

- Re-introduce some props for backward compatibility

## 3.0.3

- Add button disabled and tooltip in table
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "3.0.3",
"version": "3.0.4",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down Expand Up @@ -91,10 +91,10 @@
"pretty": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,sass,scss,xml,md}\"",
"test": "jest",
"test:ci": "CI=true jest",
"start": "yarn start:storybook",
"start:dev": "vite",
"start:storybook": "storybook dev -p 3006",
"build:storybook": "storybook build -o ./storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"storybook": "storybook dev -p 6006"
}
}
10 changes: 10 additions & 0 deletions src/components/content/Cards/CardHorizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ interface CardHorizontalProps extends CardChipProps {
subTitle?: string
borderRadius: number
imagePath: string
imageAlt?: string
description?: string
backgroundColor?: string
buttonText?: string
onBtnClick?: React.MouseEventHandler
expandOnHover?: boolean
}

export const CardHorizontal = ({
Expand All @@ -43,10 +45,18 @@ export const CardHorizontal = ({
subTitle,
borderRadius = 0,
imagePath,
// @ts-expect-error keep for backward compatibility
imageAlt,
description,
// @ts-expect-error keep for backward compatibility
status,
// @ts-expect-error keep for backward compatibility
statusText,
buttonText,
onBtnClick,
backgroundColor,
// @ts-expect-error keep for backward compatibility
expandOnHover = false,
}: CardHorizontalProps) => {
const theme = useTheme()
const boxRef = useRef<HTMLDivElement>(null)
Expand Down
8 changes: 7 additions & 1 deletion src/components/content/Cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@ interface CardsProps {
imageShape?: CardProps['imageShape']
imageLoader?: CardProps['imageLoader']
imageElement?: CardProps['imageElement']
columns?: number
readMoreText?: CardProps['readMoreText']
readMoreLink?: CardProps['readMoreLink']
addButtonClicked?: boolean
showAddNewCard?: boolean
newButtonText?: string
onNewCardButton?: React.MouseEventHandler
onCardClick?: (item: CardItems) => void
subMenu?: boolean
activeSubmenuOptions?: SubItems[]
inactiveSubmenuOptions?: SubItems[]
submenuClick?: (sortMenu: string, id: string | undefined) => undefined
submenuClick?: (sortMenu: string, id?: string) => undefined
tooltipText?: string
showStatus?: boolean
status?: string
Expand All @@ -69,9 +71,13 @@ export const Cards = ({
imageSize,
imageShape,
imageLoader,
// @ts-expect-error keep for backward compatibility
columns = 6,
expandOnHover,
filledBackground,
addButtonClicked = false,
// @ts-expect-error keep for backward compatibility
showAddNewCard = false,
newButtonText,
onNewCardButton,
onCardClick = () => {
Expand Down

0 comments on commit 6eabb0c

Please sign in to comment.