Closed therealjr closed 4 years ago
Try using gist or Markdown code blocks for linking to/displaying your modifications, please. Code put directly as regular text is a little hard to read (and can often display incorrectly, see the Captchouli
function), unfortunately.
Sorry I thought I did that originally lol. I hope this makes things a bit more clear!
The functions that I made modifications to are
import React from 'react';
function NewThreadForm(props) {
return (<React.Fragment>
<PostFormBase tag_entry={true} {...props}/>
<div className="form-group">
<label htmlFor="postToScrape">Post to Scrape</label>
<textarea className="form-control" id="postToScrape" name="postToScrape"/>
</div>
<input type="hidden" form="postForm" name="board" value={props.board_id}/>
</React.Fragment>);
}
function NewPostForm(props) {
return (<React.Fragment>
<PostFormBase tag_entry={false} {...props}/>
<div className="form-group">
<label htmlFor="postToScrape">Post to Scrape</label>
<textarea className="form-control" id="postToScrape" name="postToScrape"/>
</div>
<input type="hidden" form="postForm" name="thread" value={props.thread_id}/>
</React.Fragment>);
}
I think for that kind of modification, you might want to add your textarea
to PostFormBase
instead. That has the added benefit of adding your field to both new thread and new post forms in one place without having to duplicate code.
I did that originally but got the same results.
For whatever reason it's working now. Idk what I did wrong before.
If I directly go to the url where I could make a new post the new field appears, but if I simply click "new thread" my extra field doesn't show up. I realize that what I have done isn't pretty but please just ignore that: