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 ,
|
key: objectToEdit?.key ,
|
||||||
type: objectToEdit?.type ,
|
type: objectToEdit?.type ,
|
||||||
value: objectToEdit?.value ,
|
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 { useNavigate } from "react-router-dom";
|
||||||
import { useDeleteKey } from "../../api/Key";
|
import { useDeleteKey } from "../../api/Key";
|
||||||
import ColumnsImage from "../../Components/Columns/ColumnsImage";
|
import ColumnsImage from "../../Components/Columns/ColumnsImage";
|
||||||
|
import { FaFile } from "react-icons/fa";
|
||||||
|
import { ImageBaseURL } from "../../api/config";
|
||||||
|
|
||||||
|
|
||||||
const useTableColumns :any = () => {
|
const useTableColumns :any = () => {
|
||||||
|
|
@ -39,10 +41,14 @@ const useTableColumns :any = () => {
|
||||||
sortable: false,
|
sortable: false,
|
||||||
center: true,
|
center: true,
|
||||||
cell: (row:any) => {
|
cell: (row:any) => {
|
||||||
if (row?.value.startsWith("/")) {
|
|
||||||
|
if (row?.key === "portfolio") {
|
||||||
let src = row?.value;
|
let src = row?.value;
|
||||||
return <ColumnsImage src={src} />
|
return <a target="_blank" rel="noreferrer" href={ImageBaseURL + src}> <FaFile /> </a>
|
||||||
} else {
|
} else if(row?.value.startsWith("/")){
|
||||||
|
let src = row?.value;
|
||||||
|
return <ColumnsImage src={src} />
|
||||||
|
} else{
|
||||||
return <div className="single-line-div">{row?.value} </div> ;
|
return <div className="single-line-div">{row?.value} </div> ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user