| 1 |
import useGetFontsType from "../hooks/getFontsType"; |
| 2 |
import { BuilderDownArrow } from "../components/icons/builder"; |
| 3 |
import { SimplePlusIcon } from "../components/icons/ui"; |
| 4 |
import { useEffect, useState } from "@wordpress/element"; |
| 5 |
|
| 6 |
const CustomFront = () => { |
| 7 |
const [fontList, setFontList] = useState([]); |
| 8 |
const myAdminUrl = window.location.href.split("/wp-admin")[0].toString(); |
| 9 |
|
| 10 |
const fontData = useGetFontsType(myAdminUrl); |
| 11 |
useEffect(() => { |
| 12 |
setFontList(fontData); |
| 13 |
}, [fontData]); |
| 14 |
|
| 15 |
return ( |
| 16 |
<div className="sp-pcp-blocks-setting-custom-font-page"> |
| 17 |
<div className="sp-pcp-custom-font-wrapper"> |
| 18 |
<div className="sp-pcp-custom-font-header"> |
| 19 |
<div className="sp-pcp-header-left"> |
| 20 |
<form |
| 21 |
className="sp-pcp-header-custom-form" |
| 22 |
onSubmit={(e) => { |
| 23 |
e.preventDefault(); |
| 24 |
}} |
| 25 |
> |
| 26 |
<div className="sp-pcp-custom-select"> |
| 27 |
<select> |
| 28 |
<option>Bulk Action</option> |
| 29 |
<option>Publish</option> |
| 30 |
<option>Draft</option> |
| 31 |
<option>Delete</option> |
| 32 |
</select> |
| 33 |
<span className="sp-pcp-dropdown-arrow"> |
| 34 |
<BuilderDownArrow /> |
| 35 |
</span> |
| 36 |
</div> |
| 37 |
<input type="submit" value="Apply" /> |
| 38 |
</form> |
| 39 |
<input type="search" placeholder="Search.." /> |
| 40 |
</div> |
| 41 |
<div className="sp-pcp-header-right"> |
| 42 |
<a href={`${myAdminUrl}/wp-admin/post-new.php?post_type=sp_smart_post_font`} target="_blank"> |
| 43 |
<button className="sp-pcp-add-btn"> |
| 44 |
<span className="sp-pcp-plus-icon"> |
| 45 |
<SimplePlusIcon /> |
| 46 |
</span> |
| 47 |
Add New |
| 48 |
</button> |
| 49 |
</a> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<div className="sp-pcp-custom-font-content"> |
| 53 |
<div className="sp-pcp-content-box sp-pcp-builder-list-wrapper"> |
| 54 |
<ul> |
| 55 |
<li className="sp-pcp-builder-list-item list-heading"> |
| 56 |
<span className="sp-pcp-checkbox"> |
| 57 |
<input type="checkbox" /> |
| 58 |
</span> |
| 59 |
<span className="sp-pcp-font-list-heading sp-pcp-list-font-family">Font Family</span> |
| 60 |
<span className="sp-pcp-font-list-heading sp-pcp-list-preview">preview</span> |
| 61 |
<span className="sp-pcp-font-list-heading sp-pcp-list-file-type">file type</span> |
| 62 |
<span className="sp-pcp-font-list-heading sp-pcp-list-date">date</span> |
| 63 |
<span className="sp-pcp-font-list-heading sp-pcp-list-action">Action</span> |
| 64 |
</li> |
| 65 |
{fontList?.length === 0 ? ( |
| 66 |
<li className="sp-pcp-no-data">No Data Found</li> |
| 67 |
) : ( |
| 68 |
<li className="sp-pcp-content-list">Hello World!!</li> |
| 69 |
)} |
| 70 |
</ul> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
<div className="sp-pcp-custom-font-footer"></div> |
| 74 |
</div> |
| 75 |
</div> |
| 76 |
); |
| 77 |
}; |
| 78 |
|
| 79 |
export default CustomFront; |
| 80 |
|