Skip to content

Commit

Permalink
refactor(app-headless-cms): confirmation and information messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric committed Dec 19, 2024
1 parent ea2e60c commit 35564dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const errorClassName = css({
display: "block"
});

const deleteClassName = css({
fontWeight: "bold"
});

export interface IConfirmationProps {
model: CmsModel;
confirmation: string;
Expand All @@ -35,7 +39,10 @@ export const Confirmation = (props: IConfirmationProps) => {
return (
<>
<p>Are you sure you want to delete this content model and all of its entries?</p>
<p>If yes, please write &quot;{placeholder}&quot; in the confirmation input:</p>
<p>
If yes, please write <span className={deleteClassName}>{placeholder}</span> in the
confirmation input:
</p>
<p>
<br />
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from "react";
import type { CmsModel } from "~/types";
import { css } from "emotion";

export interface IInformationProps {
model: Pick<CmsModel, "plugin">;
}

const warningClassName = css({
color: "var(--mdc-theme-error)"
});

export const Information = (props: IInformationProps) => {
const { model } = props;
return (
Expand All @@ -23,7 +28,8 @@ export const Information = (props: IInformationProps) => {
<p>- This action will permanently delete the model and all its associated data.</p>
<p>- References to this model in other parts of the system will be emptied.</p>
<p>- This action cannot be undone.</p>
<p>- Lifecycle events will be triggered.</p>
<p>- All relevant lifecycle events will be triggered.</p>
<p className={warningClassName}> - This action cannot be undone!</p>
</>
);
};

0 comments on commit 35564dc

Please sign in to comment.