done
This commit is contained in:
parent
1d113ad047
commit
6977912c7f
|
|
@ -11,7 +11,7 @@ export const getInitialValues = (objectToEdit: any | null = null): any => {
|
|||
key: objectToEdit?.key ,
|
||||
type: objectToEdit?.type ,
|
||||
value: objectToEdit?.value ,
|
||||
value_type: objectToEdit?.key === "home_main_image" ? "image" : "text" ,
|
||||
value_type: objectToEdit?.key === "home_main_image" || objectToEdit?.key === "portfolio" ? "image" : "text" ,
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import Actions from "../../Components/Ui/tables/Actions";
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import { useDeleteKey } from "../../api/Key";
|
||||
import ColumnsImage from "../../Components/Columns/ColumnsImage";
|
||||
import { FaFile } from "react-icons/fa";
|
||||
import { ImageBaseURL } from "../../api/config";
|
||||
|
||||
|
||||
const useTableColumns :any = () => {
|
||||
|
|
@ -39,7 +41,11 @@ const useTableColumns :any = () => {
|
|||
sortable: false,
|
||||
center: true,
|
||||
cell: (row:any) => {
|
||||
if (row?.value.startsWith("/")) {
|
||||
|
||||
if (row?.key === "portfolio") {
|
||||
let src = row?.value;
|
||||
return <a target="_blank" rel="noreferrer" href={ImageBaseURL + src}> <FaFile /> </a>
|
||||
} else if(row?.value.startsWith("/")){
|
||||
let src = row?.value;
|
||||
return <ColumnsImage src={src} />
|
||||
} else{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user