mirror of
https://github.com/woodchen-ink/CoverView.git
synced 2025-07-18 05:51:56 +08:00
feat: display icons with label in options
This commit is contained in:
parent
d851553d6f
commit
a0036534e3
@ -41,7 +41,14 @@ class Editor extends React.Component {
|
||||
this.setState({ bgColor: theme.bgColor, borderColor: theme.bdColor, pattern: Pattern });
|
||||
}
|
||||
|
||||
|
||||
formatOptionLabel = ({ value, label }) => (
|
||||
<div className="flex">
|
||||
<span className="mr-2">{label}</span>
|
||||
<div className="ml-auto mr-2">
|
||||
<i className={`devicon-${value}-plain dev-icon text-2xl`}></i>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
render() {
|
||||
@ -124,6 +131,7 @@ class Editor extends React.Component {
|
||||
<Select value={this.state.icon}
|
||||
onChange={(selectedOption) => this.setState({ icon: selectedOption })}
|
||||
options={this.state.devIconOptions}
|
||||
formatOptionLabel={this.formatOptionLabel}
|
||||
className="text-xl text-gray-700"
|
||||
/>
|
||||
</div>
|
||||
@ -195,8 +203,8 @@ class Editor extends React.Component {
|
||||
</select>
|
||||
</div> */}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div className="m-2 items-center justify-center flex flex-col">
|
||||
@ -210,8 +218,8 @@ class Editor extends React.Component {
|
||||
|
||||
<div className="flex flex-col items-center justify-center ">
|
||||
<div className="flex mb-4 items-center bg-white p-2 mt-2 rounded justify-center w-full">
|
||||
<span className="mx-4 text-md font-semibold">Coverview is live on Product Hunt today.</span>
|
||||
<a href="https://www.producthunt.com/posts/coverview-2?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-coverview-2" target="_blank" rel="noreferrer"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=343671&theme=light" alt="Coverview - Creating cover images for your blog is now super easy | Product Hunt" className="w-2/3" /></a>
|
||||
<span className="mx-4 text-md font-semibold">Coverview is live on Product Hunt Today.</span>
|
||||
<a href="https://www.producthunt.com/posts/coverview-2?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-coverview-2" target="_blank" rel="noreferrer"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=343671&theme=light" alt="Coverview - Creating cover images for your blog is now super easy | Product Hunt" className="w-2/3" /></a>
|
||||
|
||||
</div>
|
||||
<ComponentToImg downloadAs={this.state.download}>
|
||||
|
@ -20,7 +20,7 @@ const BasicTheme = ({ config }) => {
|
||||
|
||||
<div className=" flex mx-4 mt-10 p-4 rounded-xl items-center bg-white">
|
||||
<i className={`devicon-${icon.value}-plain dev-icon text-4xl`}></i>
|
||||
<h2 className="text-xl ml-auto mr-2 font-semibold"> - {author}</h2>
|
||||
<h2 className="text-xl ml-auto mr-2 font-semibold">{author}</h2>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@ const ModernTheme = ({ config }) => {
|
||||
<div className="h-full w-2/3">
|
||||
<div className={`${font} bg-white px-12 justify-center text-left rounded-xl h-full p-4 flex flex-col`}>
|
||||
<h1 className="text-3xl md:text-5xl font-bold ">{title}</h1>
|
||||
<h2 className="text-xl mt-10 font-semibold text-left "> - {author}</h2>
|
||||
<h2 className="text-xl mt-10 font-semibold text-left ">{author}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@ const OutlineTheme = ({ config }) => {
|
||||
|
||||
<div className={`${font} w-full border-gray-800 border-t-4 flex mt-10 p-2 px-6 items-center bg-white`}>
|
||||
<i className={`devicon-${icon.value}-plain dev-icon text-4xl`}></i>
|
||||
<h2 className="text-xl ml-auto mr-2 font-semibold"> - {author}</h2>
|
||||
<h2 className="text-xl ml-auto mr-2 font-semibold">{author}</h2>
|
||||
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user