Fix the textfield exampls

This commit is contained in:
Made4Uo
2024-06-24 21:00:42 -07:00
parent 865bd23e03
commit 05fa995073
6 changed files with 26 additions and 21 deletions

View File

@@ -165,6 +165,16 @@ export default function JoinText() {
return null;
};
function changeInputResult(input: string, result: string) {
setInput(input);
setResult(result);
const toolsElement = document.getElementById('tool');
if (toolsElement) {
toolsElement.scrollIntoView({ behavior: 'smooth' });
}
}
return (
<Box>
<Grid container spacing={2}>
@@ -203,9 +213,9 @@ export default function JoinText() {
<Typography fontSize={22}>
Blank Lines and Trailing Spaces
</Typography>
{blankTrailingOptions.map((option) => (
{blankTrailingOptions.map((option, index) => (
<CheckboxWithDesc
key={option.accessor}
key={index}
title={option.title}
checked={!!values[option.accessor]}
onChange={(value) => setFieldValue(option.accessor, value)}
@@ -225,7 +235,10 @@ export default function JoinText() {
<Examples
title="Text Joiner Examples"
subtitle="Click to try!"
exampleCards={exampleCards}
exampleCards={exampleCards.map((card) => ({
...card,
changeInputResult
}))}
/>
<Separator backgroundColor="#5581b5" margin="50px" />
<AllTools title="All Text Tools" toolCards={toolCards} />