mirror of
https://github.com/plebbit/seedit.git
synced 2026-05-19 22:27:35 -04:00
@@ -130,7 +130,13 @@
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"prepare-commit-msg": "exec < /dev/tty && cz --hook || true",
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "تعليق",
|
||||
"post_comments": "تعليقات",
|
||||
"post_share": "مشاركة",
|
||||
"post_save": "حفظ",
|
||||
"post_unsave": "إلغاء الحفظ",
|
||||
"save": "حفظ",
|
||||
"unsave": "إلغاء الحفظ",
|
||||
"post_hide": "إخفاء",
|
||||
"post_report": "الإبلاغ",
|
||||
"post_crosspost": "نشر متقاطع",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "মন্তব্য",
|
||||
"post_comments": "মন্তব্যগুলি",
|
||||
"post_share": "শেয়ার",
|
||||
"post_save": "সংরক্ষণ",
|
||||
"post_unsave": "অসংরক্ষণ",
|
||||
"save": "সংরক্ষণ",
|
||||
"unsave": "অসংরক্ষণ",
|
||||
"post_hide": "লুকান",
|
||||
"post_report": "রিপোর্ট",
|
||||
"post_crosspost": "ক্রসপোস্ট",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Komentář",
|
||||
"post_comments": "Komentáře",
|
||||
"post_share": "Sdílet",
|
||||
"post_save": "Uložit",
|
||||
"post_unsave": "Zrušit uložení",
|
||||
"save": "Uložit",
|
||||
"unsave": "Zrušit uložení",
|
||||
"post_hide": "Skrýt",
|
||||
"post_report": "Nahlásit",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Kommentar",
|
||||
"post_comments": "Kommentarer",
|
||||
"post_share": "Del",
|
||||
"post_save": "Gem",
|
||||
"post_unsave": "Fjern gem",
|
||||
"save": "Gem",
|
||||
"unsave": "Fjern gem",
|
||||
"post_hide": "Skjul",
|
||||
"post_report": "Rapporter",
|
||||
"post_crosspost": "Krydspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Kommentar",
|
||||
"post_comments": "Kommentare",
|
||||
"post_share": "Weitersagen",
|
||||
"post_save": "Speichern",
|
||||
"post_unsave": "Nicht speichern",
|
||||
"save": "Speichern",
|
||||
"unsave": "Nicht speichern",
|
||||
"post_hide": "Ausblenden",
|
||||
"post_report": "melden",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Σχόλιο",
|
||||
"post_comments": "Σχόλια",
|
||||
"post_share": "Μοιραστείτε",
|
||||
"post_save": "Αποθήκευση",
|
||||
"post_unsave": "Αφαίρεση αποθήκευσης",
|
||||
"save": "Αποθήκευση",
|
||||
"unsave": "Αφαίρεση αποθήκευσης",
|
||||
"post_hide": "Απόκρυψη",
|
||||
"post_report": "Αναφορά",
|
||||
"post_crosspost": "Διασταυρούμενη δημοσίευση",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "comment",
|
||||
"post_comments": "comments",
|
||||
"post_share": "share",
|
||||
"post_save": "save",
|
||||
"post_unsave": "unsave",
|
||||
"save": "save",
|
||||
"unsave": "unsave",
|
||||
"post_hide": "hide",
|
||||
"post_report": "report",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "comentario",
|
||||
"post_comments": "comentarios",
|
||||
"post_share": "compartir",
|
||||
"post_save": "guardar",
|
||||
"post_unsave": "desguardar",
|
||||
"save": "guardar",
|
||||
"unsave": "desguardar",
|
||||
"post_hide": "ocultar",
|
||||
"post_report": "reportar",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "نظر",
|
||||
"post_comments": "نظرات",
|
||||
"post_share": "اشتراک گذاری",
|
||||
"post_save": "ذخیره",
|
||||
"post_unsave": "حذف از ذخیره",
|
||||
"save": "ذخیره",
|
||||
"unsave": "حذف از ذخیره",
|
||||
"post_hide": "پنهان کردن",
|
||||
"post_report": "گزارش",
|
||||
"post_crosspost": "پست مشترک",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Kommentti",
|
||||
"post_comments": "Kommentit",
|
||||
"post_share": "Jaa",
|
||||
"post_save": "Tallenna",
|
||||
"post_unsave": "Poista tallennus",
|
||||
"save": "Tallenna",
|
||||
"unsave": "Poista tallennus",
|
||||
"post_hide": "Piilota",
|
||||
"post_report": "Ilmoita",
|
||||
"post_crosspost": "Ristipostitus",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Komento",
|
||||
"post_comments": "Mga Komento",
|
||||
"post_share": "Ibahagi",
|
||||
"post_save": "I-save",
|
||||
"post_unsave": "Huwag I-save",
|
||||
"save": "I-save",
|
||||
"unsave": "Huwag I-save",
|
||||
"post_hide": "Itago",
|
||||
"post_report": "I-ulat",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "commentaire",
|
||||
"post_comments": "commentaires",
|
||||
"post_share": "partager",
|
||||
"post_save": "enregistrer",
|
||||
"post_unsave": "libérer",
|
||||
"save": "enregistrer",
|
||||
"unsave": "libérer",
|
||||
"post_hide": "masquer",
|
||||
"post_report": "signaler",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "תגובה",
|
||||
"post_comments": "תגובות",
|
||||
"post_share": "שתף",
|
||||
"post_save": "שמור",
|
||||
"post_unsave": "בטל שמירה",
|
||||
"save": "שמור",
|
||||
"unsave": "בטל שמירה",
|
||||
"post_hide": "הסתר",
|
||||
"post_report": "דווח",
|
||||
"post_crosspost": "פוסט משולב",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "टिप्पणी",
|
||||
"post_comments": "टिप्पणियां",
|
||||
"post_share": "शेयर करें",
|
||||
"post_save": "सहेजें",
|
||||
"post_unsave": "असहेजें",
|
||||
"save": "सहेजें",
|
||||
"unsave": "असहेजें",
|
||||
"post_hide": "छिपाएं",
|
||||
"post_report": "रिपोर्ट करें",
|
||||
"post_crosspost": "क्रॉसपोस्ट",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Hozzászólás",
|
||||
"post_comments": "Hozzászólások",
|
||||
"post_share": "Megosztás",
|
||||
"post_save": "Mentés",
|
||||
"post_unsave": "Mentés visszavonása",
|
||||
"save": "Mentés",
|
||||
"unsave": "Mentés visszavonása",
|
||||
"post_hide": "Elrejtés",
|
||||
"post_report": "Jelentés",
|
||||
"post_crosspost": "Keresztposzt",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Komentar",
|
||||
"post_comments": "Komentar",
|
||||
"post_share": "Bagikan",
|
||||
"post_save": "Simpan",
|
||||
"post_unsave": "Tidak Disimpan",
|
||||
"save": "Simpan",
|
||||
"unsave": "Tidak Disimpan",
|
||||
"post_hide": "Sembunyikan",
|
||||
"post_report": "Laporkan",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "commento",
|
||||
"post_comments": "commenti",
|
||||
"post_share": "condividi",
|
||||
"post_save": "salva",
|
||||
"post_unsave": "elimina",
|
||||
"save": "salva",
|
||||
"unsave": "elimina",
|
||||
"post_hide": "nascondi",
|
||||
"post_report": "segnala",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "コメント",
|
||||
"post_comments": "コメント数",
|
||||
"post_share": "シェア",
|
||||
"post_save": "保存",
|
||||
"post_unsave": "保存解除",
|
||||
"save": "保存",
|
||||
"unsave": "保存解除",
|
||||
"post_hide": "非表示",
|
||||
"post_report": "報告",
|
||||
"post_crosspost": "クロスポスト",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "댓글",
|
||||
"post_comments": "댓글들",
|
||||
"post_share": "공유",
|
||||
"post_save": "저장",
|
||||
"post_unsave": "저장 취소",
|
||||
"save": "저장",
|
||||
"unsave": "저장 취소",
|
||||
"post_hide": "숨기기",
|
||||
"post_report": "신고",
|
||||
"post_crosspost": "크로스포스트",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "टिप्पणी",
|
||||
"post_comments": "टिप्पण्या",
|
||||
"post_share": "सामायिक करा",
|
||||
"post_save": "जतन करा",
|
||||
"post_unsave": "जतन काढा",
|
||||
"save": "जतन करा",
|
||||
"unsave": "जतन काढा",
|
||||
"post_hide": "लपवा",
|
||||
"post_report": "अहवाल",
|
||||
"post_crosspost": "क्रॉसपोस्ट",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Reactie",
|
||||
"post_comments": "Reacties",
|
||||
"post_share": "Delen",
|
||||
"post_save": "Opslaan",
|
||||
"post_unsave": "Niet opslaan",
|
||||
"save": "Opslaan",
|
||||
"unsave": "Niet opslaan",
|
||||
"post_hide": "Verbergen",
|
||||
"post_report": "Rapporteren",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Kommentar",
|
||||
"post_comments": "Kommentarer",
|
||||
"post_share": "Del",
|
||||
"post_save": "Lagre",
|
||||
"post_unsave": "Fjern lagring",
|
||||
"save": "Lagre",
|
||||
"unsave": "Fjern lagring",
|
||||
"post_hide": "Skjul",
|
||||
"post_report": "Rapporter",
|
||||
"post_crosspost": "Krysspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Komentarz",
|
||||
"post_comments": "Komentarze",
|
||||
"post_share": "Udostępnij",
|
||||
"post_save": "Zapisz",
|
||||
"post_unsave": "Usuń zapis",
|
||||
"save": "Zapisz",
|
||||
"unsave": "Usuń zapis",
|
||||
"post_hide": "Ukryj",
|
||||
"post_report": "Zgłoś",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "comentário",
|
||||
"post_comments": "comentários",
|
||||
"post_share": "compartilhar",
|
||||
"post_save": "salvar",
|
||||
"post_unsave": "desfazer",
|
||||
"save": "salvar",
|
||||
"unsave": "desfazer",
|
||||
"post_hide": "ocultar",
|
||||
"post_report": "denunciar",
|
||||
"post_crosspost": "crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Comentariu",
|
||||
"post_comments": "Comentarii",
|
||||
"post_share": "Distribuie",
|
||||
"post_save": "Salvează",
|
||||
"post_unsave": "Anulează salvare",
|
||||
"save": "Salvează",
|
||||
"unsave": "Anulează salvare",
|
||||
"post_hide": "Ascunde",
|
||||
"post_report": "Raportează",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Комментарий",
|
||||
"post_comments": "Комментарии",
|
||||
"post_share": "Поделиться",
|
||||
"post_save": "Сохранить",
|
||||
"post_unsave": "Убрать",
|
||||
"save": "Сохранить",
|
||||
"unsave": "Убрать",
|
||||
"post_hide": "Скрыть",
|
||||
"post_report": "Пожаловаться",
|
||||
"post_crosspost": "Кросспост",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Koment",
|
||||
"post_comments": "Komentet",
|
||||
"post_share": "Shpërndaje",
|
||||
"post_save": "Ruaj",
|
||||
"post_unsave": "Hiq",
|
||||
"save": "Ruaj",
|
||||
"unsave": "Hiq",
|
||||
"post_hide": "Fshih",
|
||||
"post_report": "Raporto",
|
||||
"post_crosspost": "Crosspost",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Kommentar",
|
||||
"post_comments": "Kommentarer",
|
||||
"post_share": "Dela",
|
||||
"post_save": "Spara",
|
||||
"post_unsave": "Ta bort",
|
||||
"save": "Spara",
|
||||
"unsave": "Ta bort",
|
||||
"post_hide": "Dölj",
|
||||
"post_report": "Rapportera",
|
||||
"post_crosspost": "Korsposta",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "కామెంట్",
|
||||
"post_comments": "కామెంట్లు",
|
||||
"post_share": "షేర్",
|
||||
"post_save": "సేవ్",
|
||||
"post_unsave": "ఉన్సేవ్",
|
||||
"save": "సేవ్",
|
||||
"unsave": "ఉన్సేవ్",
|
||||
"post_hide": "దాచు",
|
||||
"post_report": "నివేదించు",
|
||||
"post_crosspost": "క్రాస్పోస్ట్",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "ความคิดเห็น",
|
||||
"post_comments": "ความคิดเห็น",
|
||||
"post_share": "แชร์",
|
||||
"post_save": "บันทึก",
|
||||
"post_unsave": "ยกเลิกการบันทึก",
|
||||
"save": "บันทึก",
|
||||
"unsave": "ยกเลิกการบันทึก",
|
||||
"post_hide": "ซ่อน",
|
||||
"post_report": "รายงาน",
|
||||
"post_crosspost": "โพสต์ร่วม",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Yorum",
|
||||
"post_comments": "Yorumlar",
|
||||
"post_share": "Paylaş",
|
||||
"post_save": "Kaydet",
|
||||
"post_unsave": "Kaydı Kaldır",
|
||||
"save": "Kaydet",
|
||||
"unsave": "Kaydı Kaldır",
|
||||
"post_hide": "Gizle",
|
||||
"post_report": "Rapor Et",
|
||||
"post_crosspost": "Çapraz Gönderi",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Коментар",
|
||||
"post_comments": "Коментарі",
|
||||
"post_share": "Поділитися",
|
||||
"post_save": "Зберегти",
|
||||
"post_unsave": "Видалити",
|
||||
"save": "Зберегти",
|
||||
"unsave": "Видалити",
|
||||
"post_hide": "Приховати",
|
||||
"post_report": "Поскаржитися",
|
||||
"post_crosspost": "Кроспост",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "کومنٹ",
|
||||
"post_comments": "کومنٹس",
|
||||
"post_share": "شیئر کریں",
|
||||
"post_save": "محفوظ کریں",
|
||||
"post_unsave": "محفوظ نہیں کریں",
|
||||
"save": "محفوظ کریں",
|
||||
"unsave": "محفوظ نہیں کریں",
|
||||
"post_hide": "چھپائیں",
|
||||
"post_report": "رپورٹ کریں",
|
||||
"post_crosspost": "کراس پوسٹ",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "Bình luận",
|
||||
"post_comments": "Bình luận",
|
||||
"post_share": "Chia sẻ",
|
||||
"post_save": "Lưu",
|
||||
"post_unsave": "Bỏ lưu",
|
||||
"save": "Lưu",
|
||||
"unsave": "Bỏ lưu",
|
||||
"post_hide": "Ẩn",
|
||||
"post_report": "Báo cáo",
|
||||
"post_crosspost": "Đăng chéo",
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"post_comment": "评论",
|
||||
"post_comments": "评论",
|
||||
"post_share": "分享",
|
||||
"post_save": "保存",
|
||||
"post_unsave": "取消保存",
|
||||
"save": "保存",
|
||||
"unsave": "取消保存",
|
||||
"post_hide": "隐藏",
|
||||
"post_report": "举报",
|
||||
"post_crosspost": "跨贴",
|
||||
|
||||
@@ -82,4 +82,20 @@
|
||||
.blockUser {
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editButtonWrapper {
|
||||
color: var(--text-info);
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
font-family: verdana, arial, helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.editButton {
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editButton:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
import {
|
||||
// Link,
|
||||
useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import {
|
||||
// Link,
|
||||
useLocation,
|
||||
useNavigate,
|
||||
useParams,
|
||||
} from 'react-router-dom';
|
||||
import {
|
||||
useAccount,
|
||||
useAccountComments,
|
||||
@@ -15,12 +18,15 @@ import {
|
||||
import styles from './author-sidebar.module.css';
|
||||
import { getFormattedDuration } from '../../lib/utils/time-utils';
|
||||
import { isAuthorView, isProfileView } from '../../lib/utils/view-utils';
|
||||
import {
|
||||
// findAuthorSubplebbits,
|
||||
estimateAuthorKarma } from '../../lib/utils/user-utils';
|
||||
import {
|
||||
// findAuthorSubplebbits,
|
||||
estimateAuthorKarma,
|
||||
} from '../../lib/utils/user-utils';
|
||||
// import { useDefaultSubplebbitAddresses } from '../../lib/utils/addresses-utils';
|
||||
import SubscribeButton from '../subscribe-button';
|
||||
|
||||
// TODO: uncomment when useSubplebbits({fetch: false}) is implemented, because fetching all subs for this is too expensive
|
||||
|
||||
// interface AuthorModeratingListProps {
|
||||
// accountSubplebbits: AccountSubplebbit[];
|
||||
// authorSubplebbits: string[];
|
||||
@@ -104,7 +110,16 @@ const AuthorSidebar = () => {
|
||||
<div className={styles.titleBox}>
|
||||
<div className={styles.title}>
|
||||
{address}
|
||||
{isProfilePage && !displayName && <button onClick={confirmNavigateToSettings}>edit</button>}
|
||||
{isProfilePage && !displayName && (
|
||||
<span className={styles.editButtonWrapper}>
|
||||
{' '}
|
||||
(
|
||||
<span className={styles.editButton} onClick={confirmNavigateToSettings}>
|
||||
edit
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{displayName && <div className={styles.displayName}>{displayName}</div>}
|
||||
{isAuthorPage && authorAddress !== profileAccount?.author?.address && (
|
||||
@@ -112,18 +127,12 @@ const AuthorSidebar = () => {
|
||||
<SubscribeButton address={address} />
|
||||
</div>
|
||||
)}
|
||||
{postScore ? (
|
||||
<>
|
||||
<div>
|
||||
<span className={styles.karma}>{postScore}</span> post karma
|
||||
{isAuthorPage && postScore ? ' (estimated)' : null}
|
||||
</div>
|
||||
<div>
|
||||
<span className={styles.karma}>{replyScore}</span> comment karma
|
||||
{isAuthorPage && replyScore ? ' (estimated)' : null}
|
||||
</div>
|
||||
</>
|
||||
) : null}
|
||||
<div>
|
||||
<span className={styles.karma}>{postScore}</span> post karma
|
||||
</div>
|
||||
<div>
|
||||
<span className={styles.karma}>{replyScore}</span> comment karma
|
||||
</div>
|
||||
<div className={styles.bottom}>
|
||||
{isAuthorPage && authorAddress !== profileAccount?.author?.address && (
|
||||
<span className={styles.blockUser} onClick={confirmBlock}>
|
||||
|
||||
@@ -50,7 +50,7 @@ const PostTools = ({ author, cid, hasLabel, subplebbitAddress, replyCount = 0 }:
|
||||
</span>
|
||||
</li>
|
||||
<li className={styles.button}>
|
||||
<span>{t('post_save')}</span>
|
||||
<span>{t('save')}</span>
|
||||
</li>
|
||||
<HideTools author={author} cid={cid} subplebbitAddress={subplebbitAddress} />
|
||||
<li className={styles.button}>
|
||||
@@ -74,7 +74,7 @@ const ReplyTools = ({ cid, hasLabel, showReplyForm, subplebbitAddress }: Comment
|
||||
<span>{t('reply_embed')}</span>
|
||||
</li>
|
||||
<li className={styles.button}>
|
||||
<span>{t('post_save')}</span>
|
||||
<span>{t('save')}</span>
|
||||
</li>
|
||||
<li className={styles.button}>
|
||||
<span>{t('post_report')}</span>
|
||||
@@ -96,7 +96,7 @@ const SingleReplyTools = ({ cid, hasLabel, parentCid, subplebbitAddress }: Comme
|
||||
<Link to={`/p/${subplebbitAddress}/c/${cid}`}>{t('reply_permalink')}</Link>
|
||||
</li>
|
||||
<li className={styles.button}>
|
||||
<span>{t('post_save')}</span>
|
||||
<span>{t('save')}</span>
|
||||
</li>
|
||||
<li className={styles.button}>
|
||||
<Link to={`/p/${subplebbitAddress}/c/${parentCid}`}>context</Link>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
.menuItem input[type="text"] {
|
||||
padding: 2px;
|
||||
box-shadow: var(--box-shadow);
|
||||
box-shadow: var(--box-shadow-input);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,16 +13,29 @@
|
||||
color: var(--text-info);
|
||||
font-weight: bold;
|
||||
border: 1px solid var(--border-text);
|
||||
box-shadow: var(--box-shadow-modal);
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.modalTitle {
|
||||
background: var(--background-primary);
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 6px;
|
||||
text-align: center;
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.modal input[type="checkbox"] {
|
||||
margin-right: 3px;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menuItem {
|
||||
padding-bottom: 5px;
|
||||
text-transform: lowercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menuReason {
|
||||
@@ -31,10 +44,23 @@
|
||||
|
||||
.menuItem input[type="text"] {
|
||||
padding: 2px;
|
||||
box-shadow: var(--box-shadow);
|
||||
box-shadow: var(--box-shadow-input);
|
||||
margin-top: 2px;
|
||||
width: calc(100% - 6px);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.menuItem button {
|
||||
text-transform: capitalize;
|
||||
.bottom {
|
||||
border-top: solid 1px gray;
|
||||
clear: both;
|
||||
display: block;
|
||||
padding-top: 8px;
|
||||
text-align: center;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.bottom button {
|
||||
text-transform: lowercase;
|
||||
cursor: pointer;
|
||||
padding: 2px 6px 3px;
|
||||
}
|
||||
@@ -72,6 +72,7 @@ const ModTools = ({ cid }: ModToolsProps) => {
|
||||
<FloatingFocusManager context={context} modal={false}>
|
||||
<div className={styles.modal} ref={refs.setFloating} style={floatingStyles} aria-labelledby={headingId} {...getFloatingProps()}>
|
||||
<div className={styles.modTools}>
|
||||
<div className={styles.modalTitle}>select mod action</div>
|
||||
<div className={styles.menuItem}>
|
||||
<label>
|
||||
<input onChange={onCheckbox} checked={publishCommentEditOptions.removed} type='checkbox' id='removed' />
|
||||
@@ -98,7 +99,9 @@ const ModTools = ({ cid }: ModToolsProps) => {
|
||||
</div>
|
||||
<div className={`${styles.menuItem} ${styles.menuReason}`}>
|
||||
<input type='text' onChange={onReason} defaultValue={post?.reason} size={14} placeholder='reason' />
|
||||
<button onClick={publishCommentEdit}>{t('edit')}</button>
|
||||
</div>
|
||||
<div className={styles.bottom}>
|
||||
<button onClick={publishCommentEdit}>{t('save')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,11 @@ const PostAuthor = ({ authorAddress, authorRole, cid, displayName, shortAddress,
|
||||
|
||||
return (
|
||||
<>
|
||||
{displayName && <Link to={`/u/${authorAddress}/c/${cid}`} className={`${styles.displayName} ${moderatorClass}`}>{displayName} </Link>}
|
||||
{displayName && (
|
||||
<Link to={`/u/${authorAddress}/c/${cid}`} className={`${styles.displayName} ${moderatorClass}`}>
|
||||
{displayName}{' '}
|
||||
</Link>
|
||||
)}
|
||||
<Link className={`${styles.authorAddressWrapper} ${moderatorClass}`} to={`/u/${authorAddress}/c/${cid}`}>
|
||||
<span className={styles.authorAddressHidden}>u/{shortAddress || shortAuthorAddress}</span>
|
||||
<span className={`${styles.authorAddressVisible} ${authorAddressChanged && styles.authorAddressChanged}`}>u/{shortAuthorAddress}</span>
|
||||
|
||||
@@ -47,8 +47,8 @@ const ReplyForm = ({ cid, isReplyingToReply, hideReplyForm }: ReplyFormProps) =>
|
||||
const currentContent = textRef.current?.value || '';
|
||||
const currentUrl = urlRef.current?.value || '';
|
||||
|
||||
if (!currentContent.trim()) {
|
||||
alert(`missing content`);
|
||||
if (!currentContent.trim() && !currentUrl) {
|
||||
alert(`missing content or url`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ const ReplyForm = ({ cid, isReplyingToReply, hideReplyForm }: ReplyFormProps) =>
|
||||
</div>
|
||||
<div className={styles.bottomArea}>
|
||||
<button className={styles.save} onClick={onPublish}>
|
||||
{t('post_save')}
|
||||
{t('save')}
|
||||
</button>
|
||||
{isReplyingToReply && (
|
||||
<button className={styles.cancel} onClick={hideReplyForm}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import { Comment, useAuthorAddress, useComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
||||
import { Comment, useAccountComment, useAuthorAddress, useComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
||||
import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/utils';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -36,13 +36,18 @@ const ReplyAuthor = ({ address, authorRole, cid, displayName, shortAuthorAddress
|
||||
|
||||
return (
|
||||
<>
|
||||
{displayName && <Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>{displayName} </Link>}
|
||||
{displayName && (
|
||||
<Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>
|
||||
{displayName}{' '}
|
||||
</Link>
|
||||
)}
|
||||
<Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>
|
||||
{displayName ? `u/${shortAuthorAddress}` : shortAuthorAddress}
|
||||
</Link>
|
||||
{authorRole && (
|
||||
<span className={styles.moderatorBrackets}>
|
||||
{' '}[
|
||||
{' '}
|
||||
[
|
||||
<span className={moderatorClass} title={authorRole}>
|
||||
{authorRoleInitial}
|
||||
</span>
|
||||
@@ -97,8 +102,12 @@ const ReplyMedia = ({ commentMediaInfo, content, expanded, hasThumbnail, link, l
|
||||
);
|
||||
};
|
||||
|
||||
const ParentLink = ({ reply }: { reply: Comment }) => {
|
||||
const parent = useComment({ commentCid: reply.postCid });
|
||||
type ParentLinkProps = {
|
||||
postCid: string;
|
||||
};
|
||||
|
||||
const ParentLink = ({ postCid }: ParentLinkProps) => {
|
||||
const parent = useComment({ commentCid: postCid });
|
||||
const { author, cid, content, title, subplebbitAddress } = parent || {};
|
||||
const { t } = useTranslation();
|
||||
const postTitle = (title?.length > 300 ? title?.slice(0, 300) + '...' : title) || (content?.length > 300 ? content?.slice(0, 300) + '...' : content);
|
||||
@@ -129,8 +138,24 @@ interface ReplyProps {
|
||||
}
|
||||
|
||||
const Reply = ({ depth = 0, isSingle, isNotification = false, reply = {} }: ReplyProps) => {
|
||||
const { author, cid, content, downvoteCount, flair, link, linkHeight, linkWidth, markedAsRead, removed, spoiler, state, subplebbitAddress, timestamp, upvoteCount } =
|
||||
reply || {};
|
||||
const {
|
||||
author,
|
||||
cid,
|
||||
content,
|
||||
downvoteCount,
|
||||
flair,
|
||||
link,
|
||||
linkHeight,
|
||||
linkWidth,
|
||||
markedAsRead,
|
||||
postCid,
|
||||
removed,
|
||||
spoiler,
|
||||
state,
|
||||
subplebbitAddress,
|
||||
timestamp,
|
||||
upvoteCount,
|
||||
} = reply || {};
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress });
|
||||
|
||||
const authorRole = subplebbit?.roles?.[reply.author?.address]?.role;
|
||||
@@ -168,9 +193,12 @@ const Reply = ({ depth = 0, isSingle, isNotification = false, reply = {} }: Repl
|
||||
const childrenCount = unnestedReplies.length;
|
||||
const childrenString = childrenCount === 1 ? t('child', { childrenCount }) : t('children', { childrenCount });
|
||||
|
||||
const pendingReply = useAccountComment({ commentIndex: reply?.index });
|
||||
const parentOfPendingReply = useComment({ commentCid: pendingReply?.parentCid });
|
||||
|
||||
return (
|
||||
<div className={styles.reply}>
|
||||
{isSingle && <ParentLink reply={reply} />}
|
||||
{isSingle && <ParentLink postCid={cid ? postCid : parentOfPendingReply?.postCid} />}
|
||||
<div
|
||||
className={`${!isSingle ? styles.replyWrapper : styles.singleReplyWrapper} ${depth > 1 && styles.nested} ${
|
||||
isNotification && !markedAsRead ? styles.unreadNotification : ''
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
.separator {
|
||||
color: var(--border-text);
|
||||
color: var(--gray-contrast);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,9 +85,30 @@ const useReply = (comment: Comment) => {
|
||||
|
||||
const setContent = useMemo(
|
||||
() => ({
|
||||
content: (newContent: string) => setReplyStore({ subplebbitAddress, parentCid, content: newContent, link: link || undefined, spoiler: spoiler || false }),
|
||||
link: (newLink: string) => setReplyStore({ subplebbitAddress, parentCid, content: content, link: newLink || undefined, spoiler: spoiler || false }),
|
||||
spoiler: (newSpoiler: boolean) => setReplyStore({ subplebbitAddress, parentCid, content: content, link: link || undefined, spoiler: newSpoiler }),
|
||||
content: (newContent: string) =>
|
||||
setReplyStore({
|
||||
subplebbitAddress,
|
||||
parentCid,
|
||||
content: newContent === '' ? undefined : newContent,
|
||||
link: link || undefined,
|
||||
spoiler: spoiler || false,
|
||||
}),
|
||||
link: (newLink: string) =>
|
||||
setReplyStore({
|
||||
subplebbitAddress,
|
||||
parentCid,
|
||||
content: content,
|
||||
link: newLink || undefined,
|
||||
spoiler: spoiler || false,
|
||||
}),
|
||||
spoiler: (newSpoiler: boolean) =>
|
||||
setReplyStore({
|
||||
subplebbitAddress,
|
||||
parentCid,
|
||||
content: content,
|
||||
link: link || undefined,
|
||||
spoiler: newSpoiler,
|
||||
}),
|
||||
}),
|
||||
[subplebbitAddress, parentCid, setReplyStore, content, link, spoiler],
|
||||
);
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
--gray-overlay: #F7F7F7;
|
||||
--gray-border: #ddd;
|
||||
--gray-light: #CCCCCA;
|
||||
--box-shadow-modal: 4px 4px 4px #ccc;
|
||||
--box-shadow-input: inset 0px 1px 1px rgba(0,0,0,0.3),0px 1px 0px rgba(255,255,255,0.6);
|
||||
--filter80: brightness(100%);
|
||||
--filter90: brightness(100%);
|
||||
--background: white;
|
||||
@@ -40,7 +42,6 @@
|
||||
--button-large-hover: url('/public/assets/buttons/button-large-hover.png');
|
||||
--button-large-nub: url('/public/assets/buttons/button-large-nub.png');
|
||||
--button-large-hover-nub: url('/public/assets/buttons/button-large-nub-hover.png');
|
||||
--box-shadow: inset 0px 1px 1px rgba(0,0,0,0.3),0px 1px 0px rgba(255,255,255,0.6);
|
||||
--account-dropdown-arrow: url("/public/assets/buttons/droparrowblue.gif");
|
||||
}
|
||||
|
||||
@@ -53,6 +54,8 @@
|
||||
--gray-overlay: #1f1f1f;
|
||||
--gray-border: #3e3e3e;
|
||||
--gray-light: #3e3e3e9d;
|
||||
--box-shadow-modal: 4px 4px 4px #000;
|
||||
--box-shadow-input: none;
|
||||
--filter80: brightness(80%);
|
||||
--filter90: brightness(90%);
|
||||
--background: #0f0f0f;
|
||||
@@ -86,6 +89,5 @@
|
||||
--button-large-hover: url('/public/assets/buttons/button-large-hover-dark.png');
|
||||
--button-large-nub: url('/public/assets/buttons/button-large-nub-dark.png');
|
||||
--button-large-hover-nub: url('/public/assets/buttons/button-large-nub-hover-dark.png');
|
||||
--box-shadow: none;
|
||||
--account-dropdown-arrow: url("/public/assets/buttons/droparrowgray.gif");
|
||||
}
|
||||
@@ -68,6 +68,8 @@
|
||||
text-overflow: ellipsis;
|
||||
width: calc(100vw - 28px);
|
||||
width: 100vw;
|
||||
color: var(--text-info);
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
@@ -68,8 +68,8 @@ const Post = () => {
|
||||
</div>
|
||||
<div className={styles.spacer} />
|
||||
<ReplyForm cid={cid} />
|
||||
{loadingString && loadingString}
|
||||
</div>
|
||||
{loadingString && loadingString}
|
||||
<div className={styles.replies}>
|
||||
{replies.map((reply, index) => (
|
||||
<Reply key={`${index}${reply.cid}`} reply={reply} depth={comment.depth} />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.accountData textarea {
|
||||
box-shadow: var(--box-shadow);
|
||||
box-shadow: var(--box-shadow-input);
|
||||
}
|
||||
|
||||
.accountButtons {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.usernameInput input {
|
||||
width: 200px;
|
||||
padding: 2px;
|
||||
box-shadow: var(--box-shadow);
|
||||
box-shadow: var(--box-shadow-input);
|
||||
}
|
||||
|
||||
.saved {
|
||||
|
||||
@@ -70,10 +70,10 @@ const ProfileSettings = () => {
|
||||
let resolveString = '';
|
||||
let resolveClass = '';
|
||||
|
||||
if (resolvedAddress && resolvedAddress === account?.signer.address) {
|
||||
if (resolvedAddress && resolvedAddress === account?.signer?.address) {
|
||||
resolveString = `crypto address belongs to this account, address: ${getShortAddress(resolvedAddress)}`;
|
||||
resolveClass = styles.green;
|
||||
} else if (resolvedAddress && resolvedAddress !== account?.signer.address) {
|
||||
} else if (resolvedAddress && resolvedAddress !== account?.signer?.address) {
|
||||
resolveString = `crypto address belongs to another account, address: ${getShortAddress(resolvedAddress)}`;
|
||||
resolveClass = styles.red;
|
||||
} else {
|
||||
@@ -86,7 +86,7 @@ const ProfileSettings = () => {
|
||||
resolveClass: resolveClass,
|
||||
showResolvingMessage: false,
|
||||
}));
|
||||
}, [resolvedAddress, account?.signer.address]);
|
||||
}, [resolvedAddress, account?.signer?.address]);
|
||||
|
||||
const cryptoAddressInfo = () => {
|
||||
alert(
|
||||
@@ -98,13 +98,13 @@ const ProfileSettings = () => {
|
||||
if (!cryptoState.cryptoAddress || !cryptoState.cryptoAddress.includes('.')) {
|
||||
alert('Please enter a crypto address.');
|
||||
return;
|
||||
} else if (resolvedAddress && resolvedAddress !== account?.signer.address) {
|
||||
} else if (resolvedAddress && resolvedAddress !== account?.signer?.address) {
|
||||
alert(`Cannot save resolved crypto address, it belongs to another account, address: ${resolvedAddress}`);
|
||||
return;
|
||||
} else if (cryptoState.cryptoAddress && !resolvedAddress) {
|
||||
alert('Please wait, crypto address is not resolved yet.');
|
||||
return;
|
||||
} else if (resolvedAddress && resolvedAddress === account?.signer.address) {
|
||||
} else if (resolvedAddress && resolvedAddress === account?.signer?.address) {
|
||||
try {
|
||||
await setAccount({ ...account, author: { ...account?.author, address: cryptoState.cryptoAddress } });
|
||||
setCryptoState((prevState) => ({
|
||||
|
||||
Reference in New Issue
Block a user