mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added custom icons
This commit is contained in:
parent
dd7524385e
commit
0634e24b8c
@ -1,22 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
|
|
||||||
// import icons lib
|
|
||||||
import * as lib1 from "feather-reactjs"
|
|
||||||
import * as lib2 from "react-icons/md"
|
|
||||||
import * as lib3 from "@ant-design/icons"
|
|
||||||
|
|
||||||
export const Icons = {
|
|
||||||
...lib1,
|
|
||||||
...lib2,
|
|
||||||
...lib3,
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createIconRender(icon, props) {
|
|
||||||
if (typeof Icons[icon] !== "undefined") {
|
|
||||||
return React.createElement(Icons[icon], props)
|
|
||||||
}
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Icons
|
|
29
packages/app/src/components/Icons/index.jsx
Normal file
29
packages/app/src/components/Icons/index.jsx
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import React from "react"
|
||||||
|
|
||||||
|
// import icons lib
|
||||||
|
import * as lib1 from "feather-reactjs"
|
||||||
|
import * as lib2 from "react-icons/md"
|
||||||
|
import * as lib3 from "@ant-design/icons"
|
||||||
|
|
||||||
|
const marginedStyle = { width: "1em", height: "1em", marginRight: "10px", verticalAlign: "-0.125em" }
|
||||||
|
|
||||||
|
const customs = {
|
||||||
|
verifiedBadge: () => <svg style={marginedStyle} xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"> <path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12m-13 5l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z"></path></svg>,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Icons = {
|
||||||
|
...customs,
|
||||||
|
...lib1,
|
||||||
|
...lib2,
|
||||||
|
...lib3,
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createIconRender(icon, props) {
|
||||||
|
if (typeof Icons[icon] !== "undefined") {
|
||||||
|
return React.createElement(Icons[icon], props)
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Icons
|
Loading…
x
Reference in New Issue
Block a user