Skip to content

Commit

Permalink
feat(pipeline-builder): implement the new array data type label design (
Browse files Browse the repository at this point in the history
#957)

Because

- We have new label design for array type. To better visualize the
different array and non-array type

This commit

-  implement the new array data type label design
  • Loading branch information
EiffelFly committed Feb 14, 2024
1 parent 23ce0eb commit 0c6ef4e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
22 changes: 20 additions & 2 deletions packages/toolkit/src/components/ReferenceHintDataTypeTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,32 @@ import cn from "clsx";
export const ReferenceHintDataTypeTag = ({
className,
label,
isArray,
}: {
className?: string;
label: string;
isArray?: boolean;
}) => {
return (
return isArray ? (
<div
className={cn(
"flex h-5 flex-row items-center gap-x-1 rounded bg-semantic-success-bg px-2 py-1",
"flex flex-row gap-x-[3px] rounded bg-[#D1FAED] px-[6px] py-[1.5px]",
className
)}
>
<p className="my-auto align-middle font-sans text-[11px] font-medium text-semantic-success-default ">
Array
</p>
<div className="flex flex-row items-center rounded bg-semantic-success-bg px-[6px] py-[1.5px]">
<p className="my-auto align-middle font-sans text-[9px] font-medium text-semantic-success-default">
{label}
</p>
</div>
</div>
) : (
<div
className={cn(
"flex h-5 flex-row items-center rounded bg-semantic-success-bg px-2 py-1",
className
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export const GroupByFormatField = ({
return (
<div className="flex w-full flex-col gap-y-2">
<div className="flex">
<ReferenceHintDataTypeTag label={instillFormat} />
<ReferenceHintDataTypeTag
isArray={instillFormat.includes("array:")}
label={instillFormat.replace("array:", "")}
/>
</div>
<div className="flex w-full flex-row flex-wrap gap-2">
{hints.map((hint) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ export const FieldHead = ({
className="!max-w-[160px] text-semantic-accent-default"
/>
</ReferenceHintTag.Root>
<ReferenceHintDataTypeTag label={instillFormat} />
<ReferenceHintDataTypeTag
isArray={instillFormat.includes("array:")}
label={instillFormat.replace("array:", "")}
/>
</div>
</div>
</div>
Expand Down

0 comments on commit 0c6ef4e

Please sign in to comment.