diff --git a/src/components/Inbox/DialogHeader.tsx b/src/components/Inbox/DialogHeader.tsx index 4766f053..166b61a7 100644 --- a/src/components/Inbox/DialogHeader.tsx +++ b/src/components/Inbox/DialogHeader.tsx @@ -9,12 +9,7 @@ type DialogHeader = { const DialogHeader = (props: DialogHeader) => { return ( - + ) } diff --git a/src/components/_shared/GrowingTextarea/GrowingTextarea.module.scss b/src/components/_shared/GrowingTextarea/GrowingTextarea.module.scss deleted file mode 100644 index c3cdb715..00000000 --- a/src/components/_shared/GrowingTextarea/GrowingTextarea.module.scss +++ /dev/null @@ -1,98 +0,0 @@ -.GrowingTextarea { - .wrapper { - border: 2px solid #e8e8e8; - border-radius: 8px; - padding: 3rem 1.6rem 1.6rem; - position: relative; - - .growArea { - display: grid; - width: 100%; - - &::after { - content: attr(data-replicated-value) ' '; - white-space: pre-wrap; - visibility: hidden; - transition: height 1.3s ease-in-out; - } - - textarea { - margin-bottom: 0; - font-family: inherit; - resize: none; - overflow: hidden; - border: none; - padding: 0; - background: transparent; - font-size: 15px; - line-height: 20px; - - &:focus, - &:focus-visible, - &:active { - border: none; - outline: none; - box-shadow: none; - } - } - - &::after, - textarea { - font-weight: 400; - font-size: 14px; - line-height: 20px; - padding: 0; - grid-area: 1 / 1 / 2 / 2; - width: 100%; - } - } - - .actions { - display: flex; - flex-direction: row; - overflow: hidden; - max-height: 0; - height: 0; - opacity: 1; - transition: all 0.3s ease-in-out; - &.visible { - max-height: 88px; - height: auto; - } - .buttons { - margin-top: 16px; - display: flex; - flex-direction: row; - gap: 12px; - margin-left: auto; - } - } - } - - .error { - color: red; - font-size: 12px; - } - - .loginMessage { - margin: 16px 0; - display: flex; - background: #f1f2f3; - border-radius: 8px; - padding: 16px; - text-align: center; - font-size: 20px; - - .link { - color: #2638d9; - text-decoration: none; - border: none; - transition: 0.3s ease-in-out; - - &:hover { - text-decoration: underline; - background: unset; - } - } - } -} diff --git a/src/components/_shared/GrowingTextarea/GrowingTextarea.tsx b/src/components/_shared/GrowingTextarea/GrowingTextarea.tsx deleted file mode 100644 index 38984a84..00000000 --- a/src/components/_shared/GrowingTextarea/GrowingTextarea.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import styles from './GrowingTextarea.module.scss' -import { showModal } from '../../../stores/ui' -import { createEffect, createSignal, Show } from 'solid-js' -import { t } from '../../../utils/intl' -import Button from '../Button' -import { clsx } from 'clsx' -import { useSession } from '../../../context/session' - -type Props = { - placeholder?: string - submit?: (value: string) => void - submitButtonText?: string - cancelButtonText?: string - loading?: boolean - errorMessage?: string - loginRequired?: boolean -} - -let growArea // textarea autoresize ghost element - -const GrowingTextarea = (props: Props) => { - const { session } = useSession() - const [inputText, setInputText] = createSignal('') - - const handleChangeMessage = (event) => { - setInputText(event.target.value) - } - createEffect(() => { - growArea.dataset.replicatedValue = inputText() - }) - - const handleSubmit = (event) => { - event.preventDefault() - props.submit(inputText()) - if (!props.errorMessage) { - setInputText('') - } - } - - return ( - handleSubmit(event)} class={styles.GrowingTextarea}> - - - handleChangeMessage(event)} - placeholder={props?.placeholder} - /> - {props?.placeholder} - - 0 })}> - - - setInputText('')} - value={props.cancelButtonText} - /> - - - - - - - - - {props.errorMessage} - - - - - {t('To write a comment, you must')} - { - evt.preventDefault() - showModal('auth') - }} - > - {t('sign up or sign in')} - - - - - - ) -} - -export default GrowingTextarea diff --git a/src/locales/ru.json b/src/locales/ru.json index a4335faa..04cda3b9 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -219,7 +219,7 @@ "It does not look like url": "Это не похоже на ссылку", "Something went wrong, please try again": "Что-то пошло не так, попробуйте еще раз", "To write a comment, you must": "Чтобы написать комментарий, необходимо", - "Write a comment...": "Написать комментарий..." + "Write a comment...": "Написать комментарий...", "Add comment": "Комментировать", "My subscriptions": "Подписки" }