-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpatch3.js
More file actions
13 lines (10 loc) · 790 Bytes
/
patch3.js
File metadata and controls
13 lines (10 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
const fs = require('fs');
const inputPath = 'components/PromptInput/PromptInput.tsx';
let inputSrc = fs.readFileSync(inputPath, 'utf8');
// Replace the previous incorrect width="80%" alignSelf="center" with conditional borders
inputSrc = inputSrc.replace(
/width="80%" alignSelf="center" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 2 : undefined\}/g,
`borderLeft={messages.length === 0 ? true : false} borderRight={messages.length === 0 ? true : false} borderBottom width="100%" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined}`
);
fs.writeFileSync(inputPath, inputSrc);
console.log("Fixed PromptInput!");