Skip to content

Commit

Permalink
Add warning to pin to frontpage
Browse files Browse the repository at this point in the history
  • Loading branch information
emillub committed Sep 25, 2024
1 parent 932b29f commit 15af74b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/routes/articles/components/ArticleEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Button,
ButtonGroup,
Card,
ConfirmModal,
Icon,
LinkButton,
Expand Down Expand Up @@ -158,7 +159,7 @@ const ArticleEditor = () => {
validate={validate}
initialValues={initialValues}
>
{({ handleSubmit }) => (
{({ handleSubmit, values }) => (
<Form onSubmit={handleSubmit}>
<Field
name="cover"
Expand All @@ -179,6 +180,15 @@ const ArticleEditor = () => {
type="checkbox"
component={CheckBox.Field}
/>
{values.pinned && (
<Card style={{ marginTop: 0 }} severity="warning">
<span>
OBS! Du må ha godkjenning fra ledelsen for å feste til
forsiden.
</span>
</Card>
)}

<Field
placeholder="Title"
name="title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Icon,
Modal,
Image,
Card,
} from '@webkom/lego-bricks';
import { FolderOpen, Trash2 } from 'lucide-react';
import { Field } from 'react-final-form';
Expand Down Expand Up @@ -65,6 +66,14 @@ const Header = ({
className={styles.formField}
/>

{values.pinned && (
<Card style={{ marginTop: 0 }} severity="warning">
<span>
OBS! Du må ha godkjenning fra ledelsen for å feste til forsiden.
</span>
</Card>
)}

<Field
label="Cover"
name="cover"
Expand Down

0 comments on commit 15af74b

Please sign in to comment.