Skip to content

Commit

Permalink
feat: convert customTagRender to component
Browse files Browse the repository at this point in the history
  • Loading branch information
rianmandala committed Jan 23, 2025
1 parent f960306 commit 453e023
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.11.5-alpha.0",
"version": "0.11.5-alpha.1",
"command": {
"version": {
"message": "chore(release): publish %s"
Expand Down
2 changes: 1 addition & 1 deletion packages/apsara-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goto-company/icons",
"version": "0.11.5-alpha.0",
"version": "0.11.5-alpha.1",
"description": "Apsara icons",
"scripts": {
"build": "node scripts/build.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/apsara-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goto-company/apsara",
"version": "0.11.5-alpha.0",
"version": "0.11.5-alpha.1",
"description": "A list of base components for apsara",
"author": "Praveen Yadav <[email protected]>",
"license": "Apache-2.0",
Expand Down
11 changes: 9 additions & 2 deletions packages/apsara-ui/src/Combobox/Combobox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { SelectProps } from "rc-select";

import Combobox, { customTagRender } from "./Combobox";
import Combobox, { CustomTagRender } from "./Combobox";

export default {
title: "General/Combobox",
Expand All @@ -25,7 +25,14 @@ const options: SelectOptionType = [
];

const Template = (args: SelectProps) => (
<Combobox tagRender={(props) => customTagRender({ ...props, className: "testing" })} {...args} />
<Combobox
tagRender={(props) => (
<div>
<CustomTagRender {...props} isError className="testing" />{" "}
</div>
)}
{...args}
/>
);

export const MultiSelectWithSearch = Template.bind({});
Expand Down
2 changes: 1 addition & 1 deletion packages/apsara-ui/src/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CustomTagRenderProps = CustomTagProps &
isError?: boolean;
};

export const customTagRender = (props: CustomTagRenderProps) => {
export const CustomTagRender = (props: CustomTagRenderProps) => {
const { label, closable, onClose, isError, className = "", ...restProps } = props;

return (
Expand Down

0 comments on commit 453e023

Please sign in to comment.