Merge pull request #250 from plebbit/development

Development
This commit is contained in:
Tom (plebeius.eth)
2024-02-16 20:46:29 +01:00
committed by GitHub
50 changed files with 233 additions and 76 deletions

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

View File

@@ -9,7 +9,7 @@
name="description"
content="serverless, adminless, decentralized reddit alternative"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

View File

@@ -270,5 +270,8 @@
"default_communities": "المجتمعات الافتراضية",
"avatar": "الصورة الرمزية",
"pending_edit": "تحرير معلق",
"failed_edit": "فشل التعديل"
"failed_edit": "فشل التعديل",
"copy_full_address": "<1>نسخ</1> العنوان الكامل",
"node_stats": "إحصائيات العقدة",
"version": "الإصدار"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "ডিফল্ট কমিউনিটিস",
"avatar": "অবতার",
"pending_edit": "মুলতুবি সম্পাদনা",
"failed_edit": "ব্যর্থ সম্পাদনা"
"failed_edit": "ব্যর্থ সম্পাদনা",
"copy_full_address": "<1>অনুলিপি</1> সম্পূর্ণ ঠিকানা",
"node_stats": "নোড পরিসংখ্যান",
"version": "সংস্করণ"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "výchozí komunity",
"avatar": "avatar",
"pending_edit": "čekající úprava",
"failed_edit": "neúspěšná úprava"
"failed_edit": "neúspěšná úprava",
"copy_full_address": "<1>kopírovat</1> plnou adresu",
"node_stats": "statistiky uzlu",
"version": "verze"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "standardfællesskaber",
"avatar": "avatar",
"pending_edit": "ventende redigering",
"failed_edit": "mislykket redigering"
"failed_edit": "mislykket redigering",
"copy_full_address": "<1>kopiér</1> fuld adresse",
"node_stats": "nodestatistikker",
"version": "version"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "Standard-Communities",
"avatar": "Avatar",
"pending_edit": "ausstehende Bearbeitung",
"failed_edit": "fehlgeschlagene Bearbeitung"
"failed_edit": "fehlgeschlagene Bearbeitung",
"copy_full_address": "<1>Kopieren</1> Sie die vollständige Adresse",
"node_stats": "Knotenstatistiken",
"version": "Version"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "προεπιλεγμένες κοινότητες",
"avatar": "εικόνα προφίλ",
"pending_edit": "εκκρεμής επεξεργασία",
"failed_edit": "αποτυχημένη επεξεργασία"
"failed_edit": "αποτυχημένη επεξεργασία",
"copy_full_address": "<1>αντιγραφή</1> πλήρους διεύθυνσης",
"node_stats": "στατιστικές κόμβων",
"version": "έκδοση"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "default communities",
"avatar": "avatar",
"pending_edit": "pending edit",
"failed_edit": "failed edit"
"failed_edit": "failed edit",
"copy_full_address": "<1>copy</1> full address",
"node_stats": "node stats",
"version": "version"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "comunidades predeterminadas",
"avatar": "avatar",
"pending_edit": "edición pendiente",
"failed_edit": "edición fallida"
"failed_edit": "edición fallida",
"copy_full_address": "<1>copiar</1> la dirección completa",
"node_stats": "estadísticas del nodo",
"version": "versión"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "جوامع پیش‌فرض",
"avatar": "آواتار",
"pending_edit": "ویرایش در انتظار",
"failed_edit": "ویرایش ناموفق"
"failed_edit": "ویرایش ناموفق",
"copy_full_address": "<1>کپی</1> آدرس کامل",
"node_stats": "آمار گره",
"version": "نسخه"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "oletusyhteisöt",
"avatar": "avatar",
"pending_edit": "odottava muokkaus",
"failed_edit": "epäonnistunut muokkaus"
"failed_edit": "epäonnistunut muokkaus",
"copy_full_address": "<1>kopioi</1> koko osoite",
"node_stats": "solmustatistiikka",
"version": "versio"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "default na mga komunidad",
"avatar": "avatar",
"pending_edit": "naka-pending na edit",
"failed_edit": "nakabigong edit"
"failed_edit": "nakabigong edit",
"copy_full_address": "<1>kopyahin</1> ang buong address",
"node_stats": "stats ng node",
"version": "bersyon"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "communautés par défaut",
"avatar": "avatar",
"pending_edit": "modification en attente",
"failed_edit": "modification échouée"
"failed_edit": "modification échouée",
"copy_full_address": "<1>copier</1> l'adresse complète",
"node_stats": "statistiques du nœud",
"version": "version"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "קהילות ברירת מחדל",
"avatar": "אוואטר",
"pending_edit": "עריכה ממתינה",
"failed_edit": "עריכה נכשלה"
"failed_edit": "עריכה נכשלה",
"copy_full_address": "<1>העתק</1> כתובת מלאה",
"node_stats": "סטטיסטיקות הצומת",
"version": "גרסה"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "डिफ़ॉल्ट समुदाय",
"avatar": "अवतार",
"pending_edit": "अपूर्ण संपादन",
"failed_edit": "विफल संपादन"
"failed_edit": "विफल संपादन",
"copy_full_address": "<1>कॉपी</1> पूरा पता",
"node_stats": "नोड आंकड़े",
"version": "संस्करण"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "alapértelmezett közösségek",
"avatar": "avatár",
"pending_edit": "folyamatban lévő szerkesztés",
"failed_edit": "sikertelen szerkesztés"
"failed_edit": "sikertelen szerkesztés",
"copy_full_address": "<1>másol</1> teljes cím",
"node_stats": "csomópont statisztikák",
"version": "verzió"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "komunitas default",
"avatar": "avatar",
"pending_edit": "pengeditan tertunda",
"failed_edit": "edit gagal"
"failed_edit": "edit gagal",
"copy_full_address": "<1>salin</1> alamat lengkap",
"node_stats": "statistik node",
"version": "versi"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "comunità predefinite",
"avatar": "avatar",
"pending_edit": "modifica in attesa",
"failed_edit": "modifica fallita"
"failed_edit": "modifica fallita",
"copy_full_address": "<1>copia</1> l'indirizzo completo",
"node_stats": "statistiche del nodo",
"version": "versione"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "デフォルトコミュニティ",
"avatar": "アバター",
"pending_edit": "保留中の編集",
"failed_edit": "失敗した編集"
"failed_edit": "失敗した編集",
"copy_full_address": "<1>コピー</1>完全な住所",
"node_stats": "ノードの統計",
"version": "バージョン"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "기본 커뮤니티",
"avatar": "아바타",
"pending_edit": "대기 중인 편집",
"failed_edit": "실패한 편집"
"failed_edit": "실패한 편집",
"copy_full_address": "<1>복사</1> 전체 주소",
"node_stats": "노드 통계",
"version": "버전"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "डिफॉल्ट समुदाय",
"avatar": "अवतार",
"pending_edit": "प्रलंबित संपादन",
"failed_edit": "अयशस्वी संपादन"
"failed_edit": "अयशस्वी संपादन",
"copy_full_address": "<1>कॉपी</1> पूर्ण पत्ता",
"node_stats": "नोड स्टॅट्स",
"version": "आवृत्ती"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "standaardgemeenschappen",
"avatar": "avatar",
"pending_edit": "in afwachting van bewerking",
"failed_edit": "mislukte bewerking"
"failed_edit": "mislukte bewerking",
"copy_full_address": "<1>kopieer</1> het volledige adres",
"node_stats": "knoopstatistieken",
"version": "versie"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "standardfellesskap",
"avatar": "avatar",
"pending_edit": "ventende redigering",
"failed_edit": "mislykket redigering"
"failed_edit": "mislykket redigering",
"copy_full_address": "<1>kopier</1> full adresse",
"node_stats": "nodestatistikk",
"version": "versjon"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "domyślne społeczności",
"avatar": "avatar",
"pending_edit": "edycja oczekująca",
"failed_edit": "nieudana edycja"
"failed_edit": "nieudana edycja",
"copy_full_address": "<1>skopiuj</1> pełny adres",
"node_stats": "statystyki węzła",
"version": "wersja"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "comunidades padrão",
"avatar": "avatar",
"pending_edit": "edição pendente",
"failed_edit": "edição falhada"
"failed_edit": "edição falhada",
"copy_full_address": "<1>copiar</1> endereço completo",
"node_stats": "estatísticas do nó",
"version": "versão"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "comunități implicite",
"avatar": "avatar",
"pending_edit": "editare în așteptare",
"failed_edit": "editare eșuată"
"failed_edit": "editare eșuată",
"copy_full_address": "<1>copiază</1> adresa completă",
"node_stats": "statistici de nod",
"version": "versiune"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "стандартные сообщества",
"avatar": "аватар",
"pending_edit": "редактирование ожидается",
"failed_edit": "не удалось отредактировать"
"failed_edit": "не удалось отредактировать",
"copy_full_address": "<1>скопировать</1> полный адрес",
"node_stats": "статистика узла",
"version": "версия"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "komunitete parazgjedhur",
"avatar": "avatar",
"pending_edit": "ndryshimi në pritje",
"failed_edit": "ndryshimi i dështuar"
"failed_edit": "ndryshimi i dështuar",
"copy_full_address": "<1>kopjo</1> adresën e plotë",
"node_stats": "statistikat e nyjes",
"version": "versioni"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "standardgemenskaper",
"avatar": "avatar",
"pending_edit": "avvaktande redigering",
"failed_edit": "misslyckad redigering"
"failed_edit": "misslyckad redigering",
"copy_full_address": "<1>kopiera</1> fullständig adress",
"node_stats": "nodstatistik",
"version": "version"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "డిఫాల్ట్ సముదాయాలు",
"avatar": "అవతార్",
"pending_edit": "పెండింగ్ సవరించడం",
"failed_edit": "విఫలమైన సవరించడం"
"failed_edit": "విఫలమైన సవరించడం",
"copy_full_address": "<1>నకలు</1> పూర్తి చిరునామా",
"node_stats": "నోడ్ స్టాటిస్టిక్స్",
"version": "వెర్షన్"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "ชุมชนเริ่มต้น",
"avatar": "อวตาร์",
"pending_edit": "การแก้ไขที่รอดำเนินการ",
"failed_edit": "การแก้ไขล้มเหลว"
"failed_edit": "การแก้ไขล้มเหลว",
"copy_full_address": "<1>คัดลอก</1> ที่อยู่เต็ม",
"node_stats": "สถิติของโหนด",
"version": "เวอร์ชัน"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "varsayılan topluluklar",
"avatar": "avatar",
"pending_edit": "bekleyen düzenleme",
"failed_edit": "başarısız düzenleme"
"failed_edit": "başarısız düzenleme",
"copy_full_address": "<1>kopyala</1> tam adres",
"node_stats": "düğüm istatistikleri",
"version": "sürüm"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "типові спільноти",
"avatar": "аватар",
"pending_edit": "очікуване редагування",
"failed_edit": "невдале редагування"
"failed_edit": "невдале редагування",
"copy_full_address": "<1>скопіювати</1> повну адресу",
"node_stats": "статистика вузла",
"version": "версія"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "ڈیفالٹ کمیونٹیز",
"avatar": "اوتار",
"pending_edit": "زیر التواء ترتیبات",
"failed_edit": "ناکام ترتیبات"
"failed_edit": "ناکام ترتیبات",
"copy_full_address": "<1>کاپی</1> مکمل پتہ",
"node_stats": "نوڈ اشاریہ",
"version": "ورژن"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "các cộng đồng mặc định",
"avatar": "avatar",
"pending_edit": "chỉnh sửa đang chờ",
"failed_edit": "chỉnh sửa thất bại"
"failed_edit": "chỉnh sửa thất bại",
"copy_full_address": "<1>sao chép</1> địa chỉ đầy đủ",
"node_stats": "thống kê nút",
"version": "phiên bản"
}

View File

@@ -270,5 +270,8 @@
"default_communities": "默认社区",
"avatar": "头像",
"pending_edit": "待处理的编辑",
"failed_edit": "编辑失败"
"failed_edit": "编辑失败",
"copy_full_address": "<1>复制</1>完整地址",
"node_stats": "节点统计",
"version": "版本"
}

View File

@@ -280,6 +280,7 @@ const HeaderTitle = ({ title, shortAddress }: { title: string; shortAddress: str
const { t } = useTranslation();
const params = useParams();
const location = useLocation();
const isInAllView = isAllView(location.pathname);
const isInAuthorView = isAuthorView(location.pathname);
const isInInboxView = isInboxView(location.pathname);
const isInPostView = isPostView(location.pathname, params);
@@ -328,6 +329,8 @@ const HeaderTitle = ({ title, shortAddress }: { title: string; shortAddress: str
return t('communities');
} else if (isInNotFoundView) {
return <span className={styles.lowercase}>{t('page_not_found')}</span>;
} else if (isInAllView) {
return t('all');
}
return null;
};
@@ -385,7 +388,7 @@ const Header = () => {
)}
</Link>
</div>
{!isInHomeView && !isInAllView && (
{!isInHomeView && (
<span className={`${styles.pageName} ${!logoIsAvatar && styles.soloPageName}`}>
<HeaderTitle title={title} shortAddress={shortAddress} />
</span>

View File

@@ -60,6 +60,7 @@
border: 1px solid var(--text-primary);
background-color: black;
color: black;
z-index: 1;
cursor: pointer;
}
@@ -67,6 +68,7 @@
color: white;
text-transform: lowercase;
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

View File

@@ -47,7 +47,8 @@ const Expando = ({ commentMediaInfo, content, expanded, link, reason, removed, s
spoiler && !showSpoiler && setShowSpoiler(true);
}}
>
{link && !removed && !(spoiler && !showSpoiler) && (
<div className={spoiler && !showSpoiler ? styles.hideSpoiler : ''} />
{link && !removed && (
<div className={styles.mediaPreview}>
<Link
to={link}
@@ -64,7 +65,6 @@ const Expando = ({ commentMediaInfo, content, expanded, link, reason, removed, s
)}
{content && showContent && (
<div className={styles.usertext}>
<div className={spoiler && !showSpoiler ? styles.hideSpoiler : ''} />
<div className={styles.markdown}>
{spoiler && !showSpoiler && <div className={styles.showSpoilerButton}>{t('view_spoiler')}</div>}
<Markdown content={content} />

View File

@@ -233,4 +233,38 @@
.lastClicked {
border: 1px dashed gray;
}
.subscribeButtonWrapper {
padding-right: 14px;
position: relative;
}
.subscribeButton {
position: absolute;
bottom: -1px;
border: none;
background: none;
background-repeat: no-repeat;
height: 12px;
width: 12px;
background-size: 12px;
}
.buttonSubscribe {
background-image: url("/public/assets/buttons/all_feed_subscribe.png");
cursor: pointer;
}
.buttonSubscribe:hover {
background-image: url("/public/assets/buttons/all_feed_subscribe_hover.png");
cursor: pointer;
}
.buttonSubscribed {
background-image: url("/public/assets/buttons/all_feed_subscribed.png");
}
.greenSubplebbitAddress {
color: var(--green-bright) !important;
}

View File

@@ -1,9 +1,9 @@
import { useState } from 'react';
import styles from './post.module.css';
import { Link, useLocation, useParams } from 'react-router-dom';
import { Comment, useAuthorAddress, useAuthorAvatar, useBlock, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
import { Comment, useAuthorAddress, useAuthorAvatar, useBlock, useComment, useEditedComment, useSubplebbit, useSubscribe } from '@plebbit/plebbit-react-hooks';
import { useTranslation } from 'react-i18next';
import { isPendingView, isPostView, isSubplebbitView } from '../../lib/utils/view-utils';
import { isAllView, isPendingView, isPostView, isSubplebbitView } from '../../lib/utils/view-utils';
import { getCommentMediaInfoMemoized, getHasThumbnail } from '../../lib/utils/media-utils';
import { getHostname } from '../../lib/utils/url-utils';
import { getFormattedTimeAgo } from '../../lib/utils/time-utils';
@@ -106,6 +106,9 @@ const Post = ({ index, post = {} }: PostProps) => {
if (removed) {
content = '[removed]';
}
if (deleted) {
content = '[deleted]';
}
const { displayName, shortAddress } = author || {};
const { shortAuthorAddress, authorAddressChanged } = useAuthorAddress({ comment: post });
const { imageUrl } = useAuthorAvatar({ author });
@@ -119,6 +122,7 @@ const Post = ({ index, post = {} }: PostProps) => {
const authorRole = subplebbit?.roles?.[post.author?.address]?.role;
const isInAllView = isAllView(location.pathname);
const isInPostView = isPostView(location.pathname, params);
const isInPendingView = isPendingView(location.pathname, params);
const isInSubplebbitView = isSubplebbitView(location.pathname, params);
@@ -143,6 +147,10 @@ const Post = ({ index, post = {} }: PostProps) => {
const { blocked, unblock } = useBlock({ address: cid });
const [hasClickedSubscribe, setHasClickedSubscribe] = useState(false);
const [isHoveringOnSubscribe, setIsHoveringOnSubscribe] = useState(false);
const { subscribe, subscribed } = useSubscribe({ subplebbitAddress });
// show gray dotted border around last clicked post
const isLastClicked = localStorage.getItem('lastClickedPost') === cid;
const handlePostClick = () => {
@@ -176,7 +184,7 @@ const Post = ({ index, post = {} }: PostProps) => {
<div className={`${styles.arrowCommon} ${downvoted ? styles.downvoted : styles.arrowDown}`} onClick={() => cid && downvote()} />
</div>
</div>
{hasThumbnail && !isInPostView && (
{hasThumbnail && !isInPostView && !spoiler && (
<span className={removed ? styles.blur : ''}>
<Thumbnail
cid={cid}
@@ -245,7 +253,23 @@ const Post = ({ index, post = {} }: PostProps) => {
{!isInSubplebbitView && (
<>
 {t('post_to')}{' '}
<Link className={styles.subplebbit} to={`/p/${subplebbitAddress}`}>
{isInAllView && (!subscribed || (subscribed && hasClickedSubscribe)) && (
<span className={styles.subscribeButtonWrapper}>
<button
className={`${styles.subscribeButton} ${subscribed ? styles.buttonSubscribed : styles.buttonSubscribe}`}
onClick={() => {
subscribe();
setHasClickedSubscribe(true);
}}
onMouseOver={() => setIsHoveringOnSubscribe(true)}
onMouseLeave={() => setIsHoveringOnSubscribe(false)}
/>
</span>
)}
<Link
className={`${styles.subplebbit} ${isHoveringOnSubscribe || (subscribed && hasClickedSubscribe) ? styles.greenSubplebbitAddress : ''}`}
to={`/p/${subplebbitAddress}`}
>
p/{subplebbit?.shortAddress || subplebbitAddress}
</Link>
</>

View File

@@ -283,6 +283,9 @@ const Reply = ({ cidOfReplyWithContext, depth = 0, isSingleComment, isSingleRepl
{cid === undefined && state !== 'failed' && <Label color='yellow' text={t('pending')} />}
{editState === 'failed' && <Label color='red' text={t('failed_edit')} />}
{editState === 'pending' && <Label color='yellow' text={t('pending_edit')} />}
{deleted && <Label color='red' text={t('deleted')} />}
{removed && <Label color='red' text={t('removed')} />}
{spoiler && <Label color='black' text={t('spoiler')} />}
</span>
);
@@ -400,15 +403,12 @@ const Reply = ({ cidOfReplyWithContext, depth = 0, isSingleComment, isSingleRepl
<CommentTools
author={author}
cid={cid}
deleted={deleted}
isReply={true}
isSingleReply={isSingleReply}
index={reply?.index}
parentCid={parentCid}
postCid={postCid}
removed={removed}
replyCount={replies.length}
spoiler={spoiler}
subplebbitAddress={subplebbitAddress}
showEditForm={showEditForm}
showReplyForm={showReplyForm}

View File

@@ -47,7 +47,7 @@ const TopBar = () => {
const filterDropdownClass = isFilterDropdownOpen ? styles.visible : styles.hidden;
const sortLabels = [t('hot'), t('new'), t('active'), t('controversial'), t('top')];
const [selectedSortType, setSelectedSortType] = useState(params.sortType || '/hot');
const selectedSortType = params.sortType || 'hot';
const getTimeFilterLink = (timeFilterName: string) => {
return isInSubplebbitView
@@ -62,14 +62,6 @@ const TopBar = () => {
return index >= 0 ? sortLabels[index] : '';
};
useEffect(() => {
if (params.sortType) {
setSelectedSortType(params.sortType);
} else {
setSelectedSortType('hot');
}
}, [params.sortType, location.pathname]);
const handleClickOutside = useCallback(
(event: MouseEvent) => {
const target = event.target as Node;
@@ -103,14 +95,13 @@ const TopBar = () => {
};
}, [handleClickOutside]);
const [homeLink, setHomeLink] = useState('/');
const [allLink, setAllLink] = useState('/p/all');
useEffect(() => {
if (timeFilterName && !isInSubplebbitView) {
setHomeLink(`/${selectedSortType}/${timeFilterName}`);
setAllLink(`/p/all/${selectedSortType}/${timeFilterName}`);
}
}, [timeFilterName, isInSubplebbitView, selectedSortType]);
let homeLink = '/';
let allLink = '/p/all';
if (timeFilterName && !isInSubplebbitView) {
homeLink += `${selectedSortType}/${timeFilterName}`;
allLink += `/${selectedSortType}/${timeFilterName}`;
}
return (
<div className={styles.headerArea}>
@@ -123,19 +114,19 @@ const TopBar = () => {
{getShortAddress(subscription)}
</Link>
))}
<Link to='/communities/subscriber' className={`${styles.dropdownItem} ${styles.editSubscriptions}`}>
{t('edit_subscriptions')}
</Link>
<Link to='/communities/vote' className={`${styles.dropdownItem} ${styles.editSubscriptions}`}>
{t('default_communities')}
</Link>
<Link to='/communities/subscriber' className={`${styles.dropdownItem} ${styles.editSubscriptions}`}>
{t('edit_subscriptions')}
</Link>
</div>
</div>
<div className={styles.dropdown} ref={sortsDropdownRef} onClick={toggleSortsDropdown}>
<span className={styles.selectedTitle}>{getSelectedSortLabel()}</span>
<div className={`${styles.dropChoices} ${styles.sortsDropChoices} ${sortsDropdownClass}`} ref={sortsdropdownItemsRef}>
{sortTypes.map((choice, index) => {
let dropdownLink = isInSubplebbitView ? `/p/${params.subplebbitAddress}/${choice}` : choice;
{sortTypes.map((sortType, index) => {
let dropdownLink = isInSubplebbitView ? `/p/${params.subplebbitAddress}/${sortType}` : isinAllView ? `/p/all/${sortType}` : sortType;
if (timeFilterName) {
dropdownLink += `/${timeFilterName}`;
}

View File

@@ -2,6 +2,7 @@
--blue: blue;
--orange: #FF7500;
--green: #228822;
--green-bright: #3bc54c;
--yellow: goldenrod;
--yellow-box-contrast: #ffd634;
--yellow-box-background: #fff7d7;
@@ -70,6 +71,7 @@
--blue: rgb(47, 125, 255);
--orange: #FF7500;
--green: #228822;
--green-bright: rgb(76, 207, 92);
--yellow: rgb(200, 171, 0);
--yellow-highlight: rgb(58, 50, 0);
--yellow-box-contrast: rgb(163, 130, 0);

View File

@@ -31,7 +31,6 @@ const AccountSettings = () => {
const lastAccount = accounts[accounts.length - 1];
setActiveAccount(lastAccount.name);
setSwitchToLastAccount(false);
window.location.reload();
}
}, [accounts, switchToLastAccount]);
@@ -50,10 +49,7 @@ const AccountSettings = () => {
};
const _deleteAccount = (accountName: string) => {
if (accounts.length === 1) {
alert(t('last_account_notice'));
return;
} else if (!accountName) {
if (!accountName) {
return;
} else if (window.confirm(t('delete_confirm', { value: accountName, interpolation: { escapeValue: false } }))) {
if (window.confirm(t('double_confirm'))) {

View File

@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { setAccount, useAccount, useResolvedAuthorAddress } from '@plebbit/plebbit-react-hooks';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import styles from './address-settings.module.css';
const AddressSettings = () => {
@@ -132,7 +132,7 @@ const AddressSettings = () => {
return (
<div className={styles.addressSettings}>
<div className={styles.copyAddressSetting}>
<button onClick={() => navigator.clipboard.writeText(account?.signer?.address)}>copy</button> full address
<Trans i18nKey='copy_full_address' components={{ 1: <button onClick={() => navigator.clipboard.writeText(account?.signer?.address)} /> }} />
</div>
<div className={styles.cryptoAddressSetting}>
<span className={styles.settingTitle}>{t('crypto_address')}</span>

View File

@@ -189,7 +189,7 @@ const Settings = () => {
</a>
{isElectron && (
<a className={styles.fullNodeStats} href='http://localhost:5001/webui/' target='_blank' rel='noreferrer'>
node stats
{t('node_stats')}
</a>
)}
{commitRef && (