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

Support hints for inline labels #2569

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions src/renderer/components/inputs/InputContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const WithoutLabel = memo(
export const InlineLabel = memo(({ input, children }: React.PropsWithChildren<WithLabelProps>) => {
const { conditionallyInactive } = useContext(InputContext);

const { hasHandle = false } = input;
const { hasHandle = false, hint = false, description } = input;

return (
<WithoutLabel>
Expand All @@ -231,12 +231,27 @@ export const InlineLabel = memo(({ input, children }: React.PropsWithChildren<Wi
>
{input.label}
</Text>
{/* <Center>
<TypeTags
isOptional={input.optional}
type={definitionType}
/>
</Center> */}
{hint && description && (
<Tooltip
hasArrow
borderRadius={8}
label={<Markdown nonInteractive>{description}</Markdown>}
openDelay={500}
px={2}
py={1}
>
<Center
h="auto"
m={0}
p={0}
>
<QuestionIcon
boxSize={3}
ml={1}
/>
</Center>
</Tooltip>
)}
</Box>

<Box flexGrow={1}>{children}</Box>
Expand Down
Loading