+ <>
+
- {editMode && <>
-
-
-
(
-
- )}
- />
-
-
-
-
+ getValues().body}
+ placeholder="Write your story content here..."
+ name="body"
/>
-
getValues().body}
- placeholder="Write your story content here..."
- name="body"
- />
-
-
- >}
- {!editMode &&
}
-
-
- {!props.isPublished &&
+ >}
+ {!editMode &&
}
+
}
-
-
+ {props.isUpdating ?
+ "Update" :
+ "Publish"
+ }
+
+ {!props.isPublished &&
+
}
+
+
+ >
)
}
diff --git a/src/features/Posts/pages/CreatePostPage/CreateStoryPage/CreateStoryPage.tsx b/src/features/Posts/pages/CreatePostPage/CreateStoryPage/CreateStoryPage.tsx
index fdd2a97..d5f8b51 100644
--- a/src/features/Posts/pages/CreatePostPage/CreateStoryPage/CreateStoryPage.tsx
+++ b/src/features/Posts/pages/CreatePostPage/CreateStoryPage/CreateStoryPage.tsx
@@ -87,22 +87,18 @@ export default function CreateStoryPage() {
-
- resetForm()}
- onValidationError={() => errorsContainerRef.current.scrollIntoView({ behavior: 'smooth', block: "center" })}
- />
-
+
resetForm()}
+ onValidationError={() => errorsContainerRef.current.scrollIntoView({ behavior: 'smooth', block: "center" })}
+ />
+
+
+
+
-
-
-
-
-
-
)
diff --git a/src/features/Posts/pages/CreatePostPage/CreateStoryPage/styles.module.scss b/src/features/Posts/pages/CreatePostPage/CreateStoryPage/styles.module.scss
index fc18f19..55e103a 100644
--- a/src/features/Posts/pages/CreatePostPage/CreateStoryPage/styles.module.scss
+++ b/src/features/Posts/pages/CreatePostPage/CreateStoryPage/styles.module.scss
@@ -1,9 +1,12 @@
@import "/src/styles/mixins/index.scss";
.grid {
+ --gap: 32px;
display: grid;
grid-template-columns: 1fr;
- gap: 32px;
+
+ column-gap: var(--gap);
+ row-gap: var(--gap);
& > * {
min-width: 0;
@@ -11,26 +14,42 @@
grid-template-areas:
"errors"
+ "preview-switch"
"form"
"drafts";
:global {
- #errors {
- grid-area: errors;
+ #preview-switch {
+ grid-area: preview-switch;
}
#form {
grid-area: form;
}
+ #errors {
+ grid-area: errors;
+ }
#drafts {
grid-area: drafts;
}
}
@include gt-xl {
+ row-gap: unset;
+
grid-template-columns: 1fr calc(min(326px, 25%));
grid-template-areas:
+ "preview-switch preview-switch"
"form errors"
"form drafts"
"form .";
+
+ :global {
+ #preview-switch {
+ margin-bottom: var(--gap);
+ }
+ #errors {
+ margin-bottom: var(--gap);
+ }
+ }
}
}