-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpatch-input-width.js
More file actions
13 lines (10 loc) · 918 Bytes
/
patch-input-width.js
File metadata and controls
13 lines (10 loc) · 918 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 width calculation
inputSrc = inputSrc.replace(
/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\}/g,
`borderLeft={messages.length === 0 ? true : false} borderRight={messages.length === 0 ? true : false} borderBottom width={messages.length === 0 ? Math.floor(columns * 0.5) : "100%"} alignSelf="center" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined}`
);
fs.writeFileSync(inputPath, inputSrc);
console.log("Patched PromptInput width!");