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

fix: icon visibility and add up and down icons #15543

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const TimeTimeUnitInput = (props: Props) => {
const timeUnitOptions = getWorkflowTimeUnitOptions(t);

const [timeUnit, setTimeUnit] = useState(form.getValues("timeUnit"));
const [isDropdownOpen, setIsDropdownOpen] = useState(false);

return (
<div className="flex">
Expand All @@ -39,14 +40,14 @@ export const TimeTimeUnitInput = (props: Props) => {
className="-mt-2 rounded-r-none text-sm focus:ring-0"
{...form.register("time", { valueAsNumber: true })}
addOnSuffix={
<Dropdown>
<Dropdown onOpenChange={setIsDropdownOpen}>
<DropdownMenuTrigger asChild>
<button className="flex items-center">
<div className="mr-1 w-3/4">
<div className="mr-1 w-3/5">
{timeUnit ? t(`${timeUnit.toLowerCase()}_timeUnit`) : "undefined"}{" "}
</div>
<div className="w-1/4 pt-1">
Copy link
Contributor

@Ryukemeister Ryukemeister Jun 23, 2024

Choose a reason for hiding this comment

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

@Sahillather002 you can keep the width here as w=1/4, no need to change it to 2/5

Copy link
Author

Choose a reason for hiding this comment

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

@Ryukemeister i did it because icon was hiding to that width so gives larger width, or i can reduce the size of icon

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked using w=1/4 and it was looking good for me.

<Icon name="chevron-down" />
<div className="w-2/5 pt-1">
{isDropdownOpen ? <Icon name="chevron-up" /> : <Icon name="chevron-down" />}
</div>
</button>
</DropdownMenuTrigger>
Expand Down
Loading