Skip to content

Commit

Permalink
use tooltip instead of title + grey background
Browse files Browse the repository at this point in the history
fix eslint rule
  • Loading branch information
Pascal-Delange authored and balzdur committed Jul 12, 2023
1 parent f91535e commit d262b43
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DevTool } from '@hookform/devtools';
import { zodResolver } from '@hookform/resolvers/zod';
import { type ActionArgs, json } from '@remix-run/node';
import { useSubmit } from '@remix-run/react';
import { Button, Input } from '@ui-design-system';
import { Button, Input, Tooltip } from '@ui-design-system';
import { type Namespace } from 'i18next';
import { Form, useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -125,13 +125,17 @@ export default function Decision() {
<Outcome border="square" size="big" outcome="approve" />
<div className="flex flex-row items-center gap-1 lg:gap-2">
{t('scenarios:decision.score_based.approve_condition')}
<Input
title={hoverLabel}
{...register('thresholds.0')}
type="number"
className="relative w-fit"
disabled={!isEditable}
/>
<Tooltip.Default
content={hoverLabel}
open={isEditable ? false : undefined}
>
<Input
{...register('thresholds.0')}
type="number"
className="relative w-fit"
disabled={!isEditable}
/>
</Tooltip.Default>
</div>

<Outcome border="square" size="big" outcome="review" />
Expand All @@ -140,17 +144,26 @@ export default function Decision() {
<Outcome border="square" size="big" outcome="decline" />
<div className="flex flex-row items-center gap-1 lg:gap-2">
{t('scenarios:decision.score_based.decline_condition')}
<Input
title={hoverLabel}
className="relative w-fit"
{...register('thresholds.1')}
type="number"
disabled={!isEditable}
/>
<Tooltip.Default
content={hoverLabel}
open={isEditable ? false : undefined}
>
<Input
className="relative w-fit"
{...register('thresholds.1')}
type="number"
disabled={!isEditable}
/>
</Tooltip.Default>
</div>
<Button type="submit" title={hoverLabel} disabled={!isEditable}>
Submit
</Button>
<Tooltip.Default
content={hoverLabel}
open={isEditable ? false : undefined}
>
<Button type="submit" title={hoverLabel} disabled={!isEditable}>
Submit
</Button>
</Tooltip.Default>
{errors.thresholds?.message && (
<div className="bg-grey-00 text-s text-red-100">
{errors.thresholds?.message}
Expand Down
3 changes: 2 additions & 1 deletion packages/app-builder/src/services/editor/identifiers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { createSimpleContext } from '@app-builder/utils/create-context';

function getIdentifierDisplayName(identifiers: AstNode) {
switch (identifiers.name) {
case 'DatabaseAccess':
case 'DatabaseAccess': {
const { path, fieldName } = identifiers.namedChildren;
return [...path.constant, fieldName.constant].join('.');
}
default:
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-design-system/src/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
<input
ref={ref}
className={clsx(
'bg-grey-00 border-grey-10 text-s text-grey-100 placeholder:text-grey-50 peer block h-full w-full rounded border px-2 font-medium outline-none focus:border-purple-100',
'bg-grey-00 border-grey-10 text-s text-grey-100 placeholder:text-grey-50 disabled:bg-grey-02 peer block h-full w-full rounded border px-2 font-medium outline-none focus:border-purple-100',
startAdornment && 'pl-10',
endAdornment && 'pr-10'
)}
Expand Down

0 comments on commit d262b43

Please sign in to comment.