mirror of
https://github.com/woodchen-ink/CoverView.git
synced 2025-07-18 14:01:56 +08:00
Merge pull request #37 from rutikwankhade/fix-custom-icon
Fix custom icon order
This commit is contained in:
commit
7623b2f8a9
@ -14,7 +14,7 @@ Creating cover images for your blogs is now super easy.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<img src="https://gist.github.com/user-attachments/assets/5b57a9fb-4791-4681-8982-9e47d7ba8ee1.png
|
<img src="https://gist.github.com/user-attachments/assets/1d1c1833-29bc-45d6-97dd-e26c2d1019cb
|
||||||
" height="auto" width="800px" margin="20px">
|
" height="auto" width="800px" margin="20px">
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class Editor extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// console.log("Mount")
|
// console.log("Mount")
|
||||||
fetch(devIconsUrl).then(r => r.json()).then(data => {
|
fetch(devIconsUrl).then(r => r.json()).then(data => {
|
||||||
data.push({ name: 'custom' })
|
data.unshift({ name: 'upload your own' })
|
||||||
this.setState({ devIconOptions: data.map(item => ({ 'value': item.name, 'label': item.name })) })
|
this.setState({ devIconOptions: data.map(item => ({ 'value': item.name, 'label': item.name })) })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -111,10 +111,10 @@ class Editor extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
|
|
||||||
{this.state.icon.label === 'custom' ?
|
{this.state.icon.label === 'upload your own' ?
|
||||||
<div className="flex items-center justify-center w-72 mx-auto">
|
<div className="flex items-center justify-center w-64 mx-auto">
|
||||||
<input type="file"
|
<input type="file"
|
||||||
className="focus:outline-none w-full text-lg cursor-pointer bg-white rounded border"
|
className="focus:outline-none w-full text-sm cursor-pointer bg-white rounded border"
|
||||||
onChange={(e) => this.setState({ 'customIcon': URL.createObjectURL(e.target.files[0]) })}
|
onChange={(e) => this.setState({ 'customIcon': URL.createObjectURL(e.target.files[0]) })}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user