CMS refactor
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
const BooleanPreview = ({ value }) =>
|
||||
h("i", {
|
||||
className: value ? "mdi mdi-check" : "mdi mdi-close",
|
||||
});
|
||||
h("i", {
|
||||
className: value ? "mdi mdi-check" : "mdi mdi-close",
|
||||
});
|
||||
|
||||
export default BooleanPreview;
|
||||
|
@ -1,9 +1,9 @@
|
||||
function truncate(str, num) {
|
||||
if (str.length > num) {
|
||||
return str.slice(0, num) + "...";
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
if (str.length > num) {
|
||||
return str.slice(0, num) + "...";
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
export default truncate;
|
||||
|
@ -1,13 +1,13 @@
|
||||
const DatePreview = ({ value }) =>
|
||||
h(
|
||||
"p",
|
||||
{},
|
||||
new Intl.DateTimeFormat("de-DE", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour12: false,
|
||||
}).format(new Date(value))
|
||||
);
|
||||
h(
|
||||
"p",
|
||||
{},
|
||||
new Intl.DateTimeFormat("de-DE", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour12: false,
|
||||
}).format(new Date(value))
|
||||
);
|
||||
|
||||
export default DatePreview;
|
||||
|
@ -1,21 +1,21 @@
|
||||
const DraftPreview = ({ value }) =>
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
|
||||
color: "white",
|
||||
border: "none",
|
||||
padding: "2px 6px",
|
||||
textAlign: "center",
|
||||
textDecoration: "none",
|
||||
display: "inline-block",
|
||||
cursor: "pointer",
|
||||
borderRadius: "4px",
|
||||
fontSize: "14px",
|
||||
},
|
||||
},
|
||||
value ? "Entwurf" : "Veröffentlicht"
|
||||
);
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
|
||||
color: "white",
|
||||
border: "none",
|
||||
padding: "2px 6px",
|
||||
textAlign: "center",
|
||||
textDecoration: "none",
|
||||
display: "inline-block",
|
||||
cursor: "pointer",
|
||||
borderRadius: "4px",
|
||||
fontSize: "14px",
|
||||
},
|
||||
},
|
||||
value ? "Entwurf" : "Veröffentlicht"
|
||||
);
|
||||
|
||||
export default DraftPreview;
|
||||
|
@ -4,10 +4,4 @@ import CountPreview from "./count-preview.js";
|
||||
import BodyPreview from "./body-preview.js";
|
||||
import DatePreview from "./date-preview.js";
|
||||
|
||||
export {
|
||||
BooleanPreview,
|
||||
DraftPreview,
|
||||
CountPreview,
|
||||
BodyPreview,
|
||||
DatePreview,
|
||||
};
|
||||
export { BooleanPreview, DraftPreview, CountPreview, BodyPreview, DatePreview };
|
||||
|
Reference in New Issue
Block a user