This commit is contained in:
caishi 2021-09-30 16:51:53 +08:00
parent d51bea4928
commit 1a5f81887a
2 changed files with 31 additions and 36 deletions

View File

@ -128,7 +128,7 @@ function CoderDepot(props){
useEffect(()=>{ useEffect(()=>{
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
if(result && result.data && result.data.releases){ if(result && result.data){
const release = { const release = {
"list":result.data.releases, "list":result.data.releases,
"total_count":result.data.releases.length "total_count":result.data.releases.length
@ -136,7 +136,7 @@ function CoderDepot(props){
setReleaseVersions(release); setReleaseVersions(release);
} }
}) })
},[releaseVersions]) },[])
// //
function getDirInfo(branch){ function getDirInfo(branch){

View File

@ -4,7 +4,6 @@ import UserSubmitComponent from "./UserSubmitComponent";
import "./index.css"; import "./index.css";
import "./editor.css"; import "./editor.css";
import { edit } from "marked/src/helpers";
class m_editor extends Component { class m_editor extends Component {
constructor(props) { constructor(props) {
@ -76,7 +75,7 @@ class m_editor extends Component {
padding; padding;
if (this.state.prevHeight !== height) { if (this.state.prevHeight !== height) {
this.serState({ this.setState({
prevHeight:height prevHeight:height
}) })
// setPrevHeight(height); // setPrevHeight(height);
@ -87,38 +86,34 @@ class m_editor extends Component {
}; };
return ( return (
<div>
<div className="">
<React.Fragment> <Editor
<div> height="400px"
<div className=""> language={language ? language : "plaintext"}
<Editor theme={"vs-grey"}
// height={this.state.x} placeholder="请输入内容"
language={language ? language : "plaintext"} value={editorValue}
theme={"vs-grey"} options={editor_options}
placeholder="请输入内容" onChange={this.changeEditor}
value={editorValue} editorWillMount={this.editorWillMount}
options={editor_options} editorDidMount={handleEditorMount}
onChange={this.changeEditor} />
editorWillMount={this.editorWillMount} </div>
editorDidMount={handleEditorMount} {!readOnly && (
/> <div style={{marginTop:"20px",padding:"20px"}}>
</div> <UserSubmitComponent
{!readOnly && ( {...this.props}
<div style={{marginTop:"20px",padding:"20px"}}> {...this.state}
<UserSubmitComponent filepath={`${this.props.filepath}`}
{...this.props} content={editorValue}
{...this.state} editor_type={editorType}
filepath={`${this.props.filepath}`} currentBranch={currentBranch}
content={editorValue} descName={descName}
editor_type={editorType} ></UserSubmitComponent>
currentBranch={currentBranch} </div>
descName={descName} )}
></UserSubmitComponent> </div>
</div>
)}
</div>
</React.Fragment>
); );
} }
} }