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

View File

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