添加主页拉取逻辑,改善主页结构,加入简易的媒体查询
此提交包含在:
@@ -8,10 +8,6 @@
|
||||
background-color: #9D0004;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.message-box {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
|
@@ -77,27 +77,37 @@ export class UploadContainer extends Component {
|
||||
/>
|
||||
</div>
|
||||
<div className="upload-box">
|
||||
{this.state.file ? (
|
||||
<UploadUnit
|
||||
file={this.state.file}
|
||||
onUpload={url => this.setState({ url })}
|
||||
onUploadError={this.handleUploadError}
|
||||
onCancel={() => this.setState({ file: null, url: "" })}
|
||||
upload={this.state.submitting}
|
||||
/>
|
||||
) : (
|
||||
<div className="upload-image-btn">
|
||||
<input type="file" accept="image/*" multiple={false} onChange={this.handleChange} />
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 54"><path d="M60.342,102.091l5.331-8a2.249,2.249,0,0,1,1.872-1h18a2.246,2.246,0,0,1,1.872,1l5.332,8h7.094a6.72,6.72,0,0,1,6.7,6.7v31.6a6.722,6.722,0,0,1-6.7,6.7h-46.6a6.722,6.722,0,0,1-6.7-6.7v-31.6a6.72,6.72,0,0,1,6.7-6.7h7.094Zm5.407,0H87.341l-3-4.5H68.751l-3,4.5Zm10.8,35.25a12.75,12.75,0,1,0-12.75-12.75A12.764,12.764,0,0,0,76.545,137.341Zm0-21a8.25,8.25,0,1,1-8.25,8.25A8.261,8.261,0,0,1,76.545,116.341Z" transform="translate(-46.546 -93.091)" fill="#8A8A8A"/></svg>
|
||||
<div className="upload-image-btn-text">添加图片</div>
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
this.state.file
|
||||
? (
|
||||
<UploadUnit
|
||||
file={this.state.file}
|
||||
onUpload={url => this.setState({ url })}
|
||||
onUploadError={this.handleUploadError}
|
||||
onCancel={() => this.setState({ file: null, url: "" })}
|
||||
upload={this.state.submitting}
|
||||
/>
|
||||
)
|
||||
: (
|
||||
<div className="upload-image-btn">
|
||||
<input type="file" accept="image/*" multiple={false} onChange={this.handleChange} />
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 54"><path d="M60.342,102.091l5.331-8a2.249,2.249,0,0,1,1.872-1h18a2.246,2.246,0,0,1,1.872,1l5.332,8h7.094a6.72,6.72,0,0,1,6.7,6.7v31.6a6.722,6.722,0,0,1-6.7,6.7h-46.6a6.722,6.722,0,0,1-6.7-6.7v-31.6a6.72,6.72,0,0,1,6.7-6.7h7.094Zm5.407,0H87.341l-3-4.5H68.751l-3,4.5Zm10.8,35.25a12.75,12.75,0,1,0-12.75-12.75A12.764,12.764,0,0,0,76.545,137.341Zm0-21a8.25,8.25,0,1,1-8.25,8.25A8.261,8.261,0,0,1,76.545,116.341Z" transform="translate(-46.546 -93.091)" fill="#8A8A8A"/></svg>
|
||||
<div className="upload-image-btn-text">添加图片</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<button
|
||||
className="btn btn-sdu btn-straight btn-upload"
|
||||
onClick={this.handleSubmit}
|
||||
disabled={(this.state.msg === "" && this.state.file === null) || this.state.submitting}
|
||||
>{this.state.submitting ? (<Spinner />) : '提交'}</button>
|
||||
>
|
||||
{
|
||||
this.state.submitting
|
||||
? (<Spinner />)
|
||||
: '提交'
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
新增問題並參考
封鎖使用者