Skip to content

Commit 091a97d

Browse files
committed
go back to a tooltip
1 parent 2b8cd51 commit 091a97d

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

site/src/components/RichParameterInput/RichParameterInput.stories.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,29 @@ export const OptionsWithDescriptions: Story = {
113113
{
114114
name: "First option",
115115
value: "first_option",
116-
description: "This is option 1",
116+
description: "This is a short description.",
117117
icon: "/icon/fedora.svg",
118118
},
119119
{
120120
name: "Second option",
121121
value: "second_option",
122-
description: "This is option 2",
122+
description:
123+
"This description is a little bit longer, but still not very long.",
123124
icon: "/icon/database.svg",
124125
},
125126
{
126127
name: "Third option",
127128
value: "third_option",
128-
description: "This is option 3",
129+
description: `
130+
In this description, we will explore the various ways in which this description
131+
is a big long boy. We'll discuss such things as, lots of words wow it's long, and
132+
boy howdy that's a number of sentences that this description contains. By the conclusion
133+
of this essay, I hope to reveal to you, the reader, that this description is just an
134+
absolute chonker. Just way longer than it actually needs to be. Absolutely massive.
135+
Very big.
136+
137+
> Wow, that description is straight up large. –Some guy, probably
138+
`,
129139
icon: "/icon/aws.png",
130140
},
131141
],

site/src/components/RichParameterInput/RichParameterInput.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import RadioGroup from "@mui/material/RadioGroup";
44
import { makeStyles } from "@mui/styles";
55
import TextField, { TextFieldProps } from "@mui/material/TextField";
66
import { Stack } from "components/Stack/Stack";
7-
import { FC } from "react";
7+
import { type FC } from "react";
88
import { TemplateVersionParameter } from "api/typesGenerated";
99
import { colors } from "theme/colors";
1010
import { MemoizedMarkdown } from "components/Markdown/Markdown";
1111
import { MultiTextField } from "./MultiTextField";
1212
import Box from "@mui/material/Box";
1313
import { Theme } from "@mui/material/styles";
14-
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip";
1514
import { useTheme } from "@emotion/react";
15+
import Tooltip from "@mui/material/Tooltip";
16+
import InfoIcon from "@mui/icons-material/InfoOutlined";
1617

1718
const isBoolean = (parameter: TemplateVersionParameter) => {
1819
return parameter.type === "bool";
@@ -162,10 +163,24 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
162163
css={{ padding: `${theme.spacing(0.5)} 0` }}
163164
direction={small ? "row" : "column"}
164165
>
165-
<span>{option.name}</span>
166-
<MemoizedMarkdown className={styles.labelCaption}>
167-
{option.description}
168-
</MemoizedMarkdown>
166+
{small ? (
167+
<Tooltip
168+
title={
169+
<MemoizedMarkdown>
170+
{option.description}
171+
</MemoizedMarkdown>
172+
}
173+
>
174+
<Box>{option.name}</Box>
175+
</Tooltip>
176+
) : (
177+
<>
178+
<span>{option.name}</span>
179+
<MemoizedMarkdown className={styles.labelCaption}>
180+
{option.description}
181+
</MemoizedMarkdown>
182+
</>
183+
)}
169184
</Stack>
170185
) : (
171186
option.name

0 commit comments

Comments
 (0)