add autofocus, update themes, translate 'submit'

This commit is contained in:
plebeius.eth
2024-04-29 14:53:46 +02:00
parent 916eeedb68
commit 5a45e27841
42 changed files with 107 additions and 49 deletions
-1
View File
@@ -128,7 +128,6 @@ const PostFormTable = () => {
useEffect(() => {
if (typeof replyIndex === 'number') {
resetContent();
window.scrollTo(0, document.body.scrollHeight);
}
}, [replyIndex, resetContent]);
+9 -1
View File
@@ -89,7 +89,15 @@ const ReplyModal = ({ closeModal, parentCid }: ReplyModalProps) => {
<input type='text' ref={urlRef} placeholder={_.capitalize(t('link'))} onChange={(e) => setContent.link(e.target.value)} />
</div>
<div className={styles.content}>
<textarea cols={48} rows={4} wrap='soft' ref={textRef} placeholder={_.capitalize(t('comment'))} onChange={(e) => setContent.content(e.target.value)} />
<textarea
cols={48}
rows={4}
wrap='soft'
ref={textRef}
placeholder={_.capitalize(t('comment'))}
onChange={(e) => setContent.content(e.target.value)}
autoFocus
/>
</div>
<div className={styles.footer}>
<button onClick={onPublishReply}>{t('reply')}</button>
@@ -2,14 +2,15 @@ import Post from '../post';
import { useTranslation } from 'react-i18next';
interface DescriptionPostProps {
subplebbitAddress: string | undefined;
avatarUrl?: string;
createdAt: number;
description: string;
avatarUrl?: string;
shortAddress: string;
subplebbitAddress: string | undefined;
title: string;
}
const SubplebbitDescription = ({ subplebbitAddress, createdAt, description, avatarUrl, title }: DescriptionPostProps) => {
const SubplebbitDescription = ({ avatarUrl, createdAt, description, shortAddress, subplebbitAddress, title }: DescriptionPostProps) => {
const { t } = useTranslation();
const post = {
isDescription: true,
@@ -18,7 +19,7 @@ const SubplebbitDescription = ({ subplebbitAddress, createdAt, description, avat
author: { displayName: '## Board Mods' },
content: description,
link: avatarUrl,
title: t('welcome_to_board', { board: title }),
title: t('welcome_to_board', { board: title || `p/${shortAddress}` }),
pinned: true,
locked: true,
};