From 39c99091f9d5f2721a6f972b33db61fbbbee96f4 Mon Sep 17 00:00:00 2001
From: ilya-bkv
Date: Mon, 8 May 2023 21:23:51 +0300
Subject: [PATCH 1/5] [WIP] init
---
public/locales/en/translation.json | 6 +++-
public/locales/ru/translation.json | 8 ++++--
src/components/Editor/TopicSelect/index.ts | 1 +
src/components/Editor/index.ts | 3 ++
src/components/Views/Edit.module.scss | 31 +++++++++++++++++++-
src/components/Views/Edit.tsx | 33 ++++++++++++++--------
6 files changed, 66 insertions(+), 16 deletions(-)
create mode 100644 src/components/Editor/TopicSelect/index.ts
create mode 100644 src/components/Editor/index.ts
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index 5d9b89ff..056ac76e 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -3,6 +3,7 @@
"About myself": "About myself",
"About the project": "About the project",
"Add comment": "Comment",
+ "Add image": "Add image",
"Address on Discourse": "Address on Discourse",
"All": "All",
"All authors": "All authors",
@@ -32,6 +33,7 @@
"By views": "By views",
"Characters": "Знаков",
"Chat Title": "Chat Title",
+ "Choose a title image for the article. You can immediately see how the publication card will look like.": "Choose a title image for the article. You can immediately see how the publication card will look like.",
"Choose who you want to write to": "Choose who you want to write to",
"Collaborate": "Help Edit",
"Comments": "Comments",
@@ -119,6 +121,7 @@
"Logout": "Logout",
"Manifest": "Manifest",
"Many files, choose only one": "Many files, choose only one",
+ "Material card": "Material card",
"More": "More",
"Most commented": "Commented",
"Most read": "Readable",
@@ -162,6 +165,7 @@
"Recent": "Fresh",
"Reply": "Reply",
"Report": "Complain",
+ "Required": "Required",
"Resend code": "Send confirmation",
"Restore password": "Restore password",
"Save draft": "Save draft",
@@ -272,5 +276,5 @@
"user already exist": "user already exists",
"view": "view",
"zine": "zine",
- "Required": "Required"
+ "Publish Settings": "Publish Settings"
}
diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json
index 0d00d8eb..f4839adf 100644
--- a/public/locales/ru/translation.json
+++ b/public/locales/ru/translation.json
@@ -4,6 +4,7 @@
"About myself": "О себе",
"About the project": "О проекте",
"Add comment": "Комментировать",
+ "Add image": "Добавить изображение",
"Add to bookmarks": "Добавить в закладки",
"Address on Discourse": "Адрес на Дискурсе",
"All": "Все",
@@ -34,6 +35,7 @@
"By views": "По просмотрам",
"Characters": "Знаков",
"Chat Title": "Тема дискурса",
+ "Choose a title image for the article. You can immediately see how the publication card will look like.": "Выберите заглавное изображение для статьи. Тут же сразу можно увидеть как будет выглядеть карточка публикации.",
"Choose who you want to write to": "Выберите кому хотите написать",
"Collaborate": "Помочь редактировать",
"Comments": "Комментарии",
@@ -126,6 +128,7 @@
"Logout": "Выход",
"Manifest": "Манифест",
"Many files, choose only one": "Много файлов, выберете один",
+ "Material card": "Карточка материала",
"More": "Ещё",
"Most commented": "Комментируемое",
"Most read": "Читаемое",
@@ -173,11 +176,13 @@
"Recent": "Свежее",
"Reply": "Ответить",
"Report": "Пожаловаться",
+ "Required": "Поле обязательно для заполнения",
"Resend code": "Выслать подтверждение",
"Restore password": "Восстановить пароль",
"Save": "Сохранить",
"Save draft": "Сохранить черновик",
"Save settings": "Сохранить настройки",
+ "Scroll up": "Наверх",
"Search": "Поиск",
"Search author": "Поиск автора",
"Search topic": "Поиск темы",
@@ -187,7 +192,6 @@
"Send": "Отправить",
"Send link again": "Прислать ссылку ещё раз",
"Settings": "Настройки",
- "Scroll up": "Наверх",
"Share": "Поделиться",
"Short opening": "Небольшое вступление, чтобы заинтересовать читателя",
"Show": "Показать",
@@ -293,5 +297,5 @@
"user already exist": "пользователь уже существует",
"view": "просмотр",
"zine": "журнал",
- "Required": "Поле обязательно для заполнения"
+ "Publish Settings": "Настройки публикации"
}
diff --git a/src/components/Editor/TopicSelect/index.ts b/src/components/Editor/TopicSelect/index.ts
new file mode 100644
index 00000000..e2250eef
--- /dev/null
+++ b/src/components/Editor/TopicSelect/index.ts
@@ -0,0 +1 @@
+export { TopicSelect } from './TopicSelect'
diff --git a/src/components/Editor/index.ts b/src/components/Editor/index.ts
new file mode 100644
index 00000000..dc91dc70
--- /dev/null
+++ b/src/components/Editor/index.ts
@@ -0,0 +1,3 @@
+export { Editor } from './Editor'
+export { Panel } from './Panel'
+export { TopicSelect } from './TopicSelect'
diff --git a/src/components/Views/Edit.module.scss b/src/components/Views/Edit.module.scss
index 37c78486..80091c8f 100644
--- a/src/components/Views/Edit.module.scss
+++ b/src/components/Views/Edit.module.scss
@@ -4,8 +4,37 @@
.articlePreview {
border: 2px solid #e8e8e8;
- min-height: 10em;
padding: 1rem 1.2rem;
+ display: flex;
+ flex-direction: column;
+ min-height: 300px;
+ align-items: flex-start;
+ box-sizing: border-box;
+
+ .shoutCardTitle {
+ @include font-size(2.2rem);
+
+ font-weight: 700;
+ line-height: 1.25;
+ margin: auto 0 0.8rem;
+ }
+
+ .shoutCardSubtitle {
+ @include font-size(1.7rem);
+
+ color: #696969;
+ font-weight: 400;
+ line-height: 1.3;
+ margin-bottom: 0.8rem;
+ transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
+ }
+
+ .shoutAuthor {
+ @include font-size(1.2rem);
+
+ margin-right: 1.6rem;
+ color: rgb(0 0 0 / 70%);
+ }
}
.formHolder {
diff --git a/src/components/Views/Edit.tsx b/src/components/Views/Edit.tsx
index a492dd29..a5ac1ab8 100644
--- a/src/components/Views/Edit.tsx
+++ b/src/components/Views/Edit.tsx
@@ -1,16 +1,16 @@
import { createSignal, onCleanup, onMount, Show } from 'solid-js'
import { useLocalize } from '../../context/localize'
import { clsx } from 'clsx'
-import styles from './Edit.module.scss'
import { Title } from '@solidjs/meta'
import type { Shout, Topic } from '../../graphql/types.gen'
import { apiClient } from '../../utils/apiClient'
-import { TopicSelect } from '../Editor/TopicSelect/TopicSelect'
import { useRouter } from '../../stores/router'
-import { Editor } from '../Editor/Editor'
-import { Panel } from '../Editor/Panel'
import { useEditorContext } from '../../context/editor'
+import { Editor, Panel, TopicSelect } from '../Editor'
import { Icon } from '../_shared/Icon'
+import { Button } from '../_shared/Button'
+import styles from './Edit.module.scss'
+import { useSession } from '../../context/session'
type EditViewProps = {
shout: Shout
@@ -18,6 +18,7 @@ type EditViewProps = {
export const EditView = (props: EditViewProps) => {
const { t } = useLocalize()
+ const { user } = useSession()
const [isScrolled, setIsScrolled] = createSignal(false)
const [topics, setTopics] = createSignal(null)
@@ -87,7 +88,7 @@ export const EditView = (props: EditViewProps) => {
behavior: 'smooth'
})
}
-
+ console.log('!!! :')
return (
<>
+
ЙФЙФЙФЙФЙЫЙ
{t('Write an article')}
From 2ea3216bff663a5cb39677e8b54507c513c7c42f Mon Sep 17 00:00:00 2001
From: ilya-bkv
Date: Tue, 9 May 2023 07:58:00 +0300
Subject: [PATCH 2/5] Card upload
---
public/locales/en/translation.json | 1 +
public/locales/ru/translation.json | 1 +
.../EditorFloatingMenu/EditorFloatingMenu.tsx | 24 +++++++++++---
.../Editor/InlineForm/InlineForm.tsx | 3 ++
.../UploadModalContent.module.scss | 0
.../UploadModalContent.tsx | 21 +++---------
.../index.ts | 0
src/components/Editor/index.ts | 1 +
src/components/Views/Edit.module.scss | 28 +++++++++++++++-
src/components/Views/Edit.tsx | 33 +++++++++++++++----
10 files changed, 84 insertions(+), 28 deletions(-)
rename src/components/Editor/{UploadModal => UploadModalContent}/UploadModalContent.module.scss (100%)
rename src/components/Editor/{UploadModal => UploadModalContent}/UploadModalContent.tsx (89%)
rename src/components/Editor/{UploadModal => UploadModalContent}/index.ts (100%)
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index 056ac76e..21d7627c 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -4,6 +4,7 @@
"About the project": "About the project",
"Add comment": "Comment",
"Add image": "Add image",
+ "Add another image": "Add another image",
"Address on Discourse": "Address on Discourse",
"All": "All",
"All authors": "All authors",
diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json
index f4839adf..49180f3e 100644
--- a/public/locales/ru/translation.json
+++ b/public/locales/ru/translation.json
@@ -5,6 +5,7 @@
"About the project": "О проекте",
"Add comment": "Комментировать",
"Add image": "Добавить изображение",
+ "Add another image": "Добавить другое изображение",
"Add to bookmarks": "Добавить в закладки",
"Address on Discourse": "Адрес на Дискурсе",
"All": "Все",
diff --git a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx
index d74c637d..7552d18f 100644
--- a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx
+++ b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx
@@ -8,9 +8,10 @@ import { useLocalize } from '../../../context/localize'
import { Modal } from '../../Nav/Modal'
import { Menu } from './Menu'
import type { MenuItem } from './Menu/Menu'
-import { showModal } from '../../../stores/ui'
-import { UploadModalContent } from '../UploadModal'
+import { hideModal, showModal } from '../../../stores/ui'
+import { UploadModalContent } from '../UploadModalContent'
import { useOutsideClickHandler } from '../../../utils/useOutsideClickHandler'
+import { imageProxy } from '../../../utils/imageProxy'
type FloatingMenuProps = {
editor: Editor
@@ -35,6 +36,7 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => {
const { t } = useLocalize()
const [selectedMenuItem, setSelectedMenuItem] = createSignal
-
+
+ handleSetCover(value)} />
+
>
)
From 7332e3ebadc5de8163becbfe965e2027b05727c4 Mon Sep 17 00:00:00 2001
From: ilya-bkv
Date: Tue, 9 May 2023 08:05:06 +0300
Subject: [PATCH 3/5] remove trash word
---
src/components/Views/Edit.tsx | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/components/Views/Edit.tsx b/src/components/Views/Edit.tsx
index caaf6503..f4c276c0 100644
--- a/src/components/Views/Edit.tsx
+++ b/src/components/Views/Edit.tsx
@@ -18,6 +18,13 @@ type EditViewProps = {
shout: Shout
}
+const scrollTop = () => {
+ window.scrollTo({
+ top: 0,
+ behavior: 'smooth'
+ })
+}
+
export const EditView = (props: EditViewProps) => {
const { t } = useLocalize()
const { user } = useSession()
@@ -83,13 +90,6 @@ export const EditView = (props: EditViewProps) => {
setForm('slug', slug)
}
- const scrollTop = () => {
- window.scrollTo({
- top: 0,
- behavior: 'smooth'
- })
- }
-
const handleSetCover = (imgUrl: string) => {
hideModal()
console.log('!!! imgUrl:', imgUrl)
@@ -110,7 +110,6 @@ export const EditView = (props: EditViewProps) => {
-
ЙФЙФЙФЙФЙЫЙ
{t('Write an article')}
- handleSetCover(value)} />
+ handleUploadModalContentCloseSetCover(value)} />
>