mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-01 16:51:13 +00:00
Merge branch 'main' into feat/markdown-format-bar-above
This commit is contained in:
commit
e540b1e4a9
18 changed files with 127 additions and 136 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -1 +1 @@
|
||||||
* @dessalines @SleeplessOne1917
|
* @dessalines @SleeplessOne1917 @alectrocute
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
"inferno-server": "^8.1.1",
|
"inferno-server": "^8.1.1",
|
||||||
"isomorphic-cookie": "^1.2.4",
|
"isomorphic-cookie": "^1.2.4",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"lemmy-js-client": "0.17.2-rc.24",
|
"lemmy-js-client": "0.18.0-rc.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"markdown-it-container": "^3.0.0",
|
"markdown-it-container": "^3.0.0",
|
||||||
|
|
|
@ -25,7 +25,7 @@ export class App extends Component<any, any> {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Provider i18next={i18n}>
|
<Provider i18next={i18n}>
|
||||||
<div id="app">
|
<div id="app" className="lemmy-site">
|
||||||
{siteView && (
|
{siteView && (
|
||||||
<Theme defaultTheme={siteView.local_site.default_theme} />
|
<Theme defaultTheme={siteView.local_site.default_theme} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -16,7 +16,7 @@ export class Footer extends Component<FooterProps, any> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<nav className="container-lg navbar navbar-expand-md navbar-light navbar-bg p-3">
|
<footer className="container-lg navbar navbar-expand-md navbar-light navbar-bg p-3">
|
||||||
<div className="navbar-collapse">
|
<div className="navbar-collapse">
|
||||||
<ul className="navbar-nav ml-auto">
|
<ul className="navbar-nav ml-auto">
|
||||||
{this.props.site?.version !== VERSION && (
|
{this.props.site?.version !== VERSION && (
|
||||||
|
@ -63,7 +63,7 @@ export class Footer extends Component<FooterProps, any> {
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</footer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,8 +86,12 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
const siteView = this.props.siteRes?.site_view;
|
const siteView = this.props.siteRes?.site_view;
|
||||||
const person = UserService.Instance.myUserInfo?.local_user_view.person;
|
const person = UserService.Instance.myUserInfo?.local_user_view.person;
|
||||||
return (
|
return (
|
||||||
<nav className="navbar navbar-expand-md navbar-light shadow-sm p-0 px-3 container-lg">
|
<nav
|
||||||
|
className="navbar navbar-expand-md navbar-light shadow-sm p-0 px-3 container-lg"
|
||||||
|
id="navbar"
|
||||||
|
>
|
||||||
<NavLink
|
<NavLink
|
||||||
|
id="navTitle"
|
||||||
to="/"
|
to="/"
|
||||||
title={siteView?.site.description ?? siteView?.site.name}
|
title={siteView?.site.description ?? siteView?.site.name}
|
||||||
className="d-flex align-items-center navbar-brand mr-md-3"
|
className="d-flex align-items-center navbar-brand mr-md-3"
|
||||||
|
@ -100,10 +104,10 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
{person && (
|
{person && (
|
||||||
<ul className="navbar-nav d-flex flex-row ml-auto d-md-none">
|
<ul className="navbar-nav d-flex flex-row ml-auto d-md-none">
|
||||||
<li className="nav-item">
|
<li id="navMessages" className="nav-item nav-item-icon">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/inbox"
|
to="/inbox"
|
||||||
className="p-1 nav-link border-0"
|
className="p-1 nav-link border-0 nav-messages"
|
||||||
title={i18n.t("unread_messages", {
|
title={i18n.t("unread_messages", {
|
||||||
count: Number(this.state.unreadApplicationCountRes.state),
|
count: Number(this.state.unreadApplicationCountRes.state),
|
||||||
formattedCount: numToSI(this.unreadInboxCount),
|
formattedCount: numToSI(this.unreadInboxCount),
|
||||||
|
@ -119,7 +123,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
{this.moderatesSomething && (
|
{this.moderatesSomething && (
|
||||||
<li className="nav-item">
|
<li className="nav-item nav-item-icon">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/reports"
|
to="/reports"
|
||||||
className="p-1 nav-link border-0"
|
className="p-1 nav-link border-0"
|
||||||
|
@ -139,7 +143,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
{amAdmin() && (
|
{amAdmin() && (
|
||||||
<li className="nav-item">
|
<li className="nav-item nav-item-icon">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/registration_applications"
|
to="/registration_applications"
|
||||||
className="p-1 nav-link border-0"
|
className="p-1 nav-link border-0"
|
||||||
|
@ -178,7 +182,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
id="navbarDropdown"
|
id="navbarDropdown"
|
||||||
ref={this.mobileMenuRef}
|
ref={this.mobileMenuRef}
|
||||||
>
|
>
|
||||||
<ul className="mr-auto navbar-nav">
|
<ul id="navbarLinks" className="mr-auto navbar-nav">
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/communities"
|
to="/communities"
|
||||||
|
@ -228,8 +232,8 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="navbar-nav">
|
<ul id="navbarIcons" className="navbar-nav">
|
||||||
<li className="nav-item">
|
<li id="navSearch" className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/search"
|
to="/search"
|
||||||
className="nav-link"
|
className="nav-link"
|
||||||
|
@ -240,7 +244,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
{amAdmin() && (
|
{amAdmin() && (
|
||||||
<li className="nav-item">
|
<li id="navAdmin" className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/admin"
|
to="/admin"
|
||||||
className="nav-link"
|
className="nav-link"
|
||||||
|
@ -253,7 +257,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
)}
|
)}
|
||||||
{person ? (
|
{person ? (
|
||||||
<>
|
<>
|
||||||
<li className="nav-item">
|
<li id="navMessages" className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
className="nav-link"
|
className="nav-link"
|
||||||
to="/inbox"
|
to="/inbox"
|
||||||
|
@ -272,7 +276,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
{this.moderatesSomething && (
|
{this.moderatesSomething && (
|
||||||
<li className="nav-item">
|
<li id="navModeration" className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
className="nav-link"
|
className="nav-link"
|
||||||
to="/reports"
|
to="/reports"
|
||||||
|
@ -292,7 +296,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
{amAdmin() && (
|
{amAdmin() && (
|
||||||
<li className="nav-item">
|
<li id="navApplications" className="nav-item">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/registration_applications"
|
to="/registration_applications"
|
||||||
className="nav-link"
|
className="nav-link"
|
||||||
|
@ -312,7 +316,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
{person && (
|
{person && (
|
||||||
<div className="dropdown">
|
<div id="dropdownUser" className="dropdown">
|
||||||
<button
|
<button
|
||||||
className="btn dropdown-toggle"
|
className="btn dropdown-toggle"
|
||||||
role="button"
|
role="button"
|
||||||
|
|
|
@ -21,6 +21,7 @@ interface CommentFormProps {
|
||||||
onReplyCancel?(): void;
|
onReplyCancel?(): void;
|
||||||
allLanguages: Language[];
|
allLanguages: Language[];
|
||||||
siteLanguages: number[];
|
siteLanguages: number[];
|
||||||
|
containerClass?: string;
|
||||||
onUpsertComment(form: EditComment | CreateComment): void;
|
onUpsertComment(form: EditComment | CreateComment): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ export class CommentForm extends Component<CommentFormProps, any> {
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className={["mb-3", this.props.containerClass].join(" ")}>
|
||||||
{UserService.Instance.myUserInfo ? (
|
{UserService.Instance.myUserInfo ? (
|
||||||
<MarkdownTextArea
|
<MarkdownTextArea
|
||||||
initialContent={initialContent}
|
initialContent={initialContent}
|
||||||
|
|
|
@ -282,7 +282,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="comment" role="comment">
|
<li className="comment" role="comment">
|
||||||
<div
|
<article
|
||||||
id={`comment-${cv.comment.id}`}
|
id={`comment-${cv.comment.id}`}
|
||||||
className={classNames(`details comment-node py-2`, {
|
className={classNames(`details comment-node py-2`, {
|
||||||
"border-top border-light": !this.props.noBorder,
|
"border-top border-light": !this.props.noBorder,
|
||||||
|
@ -400,6 +400,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
focus
|
focus
|
||||||
allLanguages={this.props.allLanguages}
|
allLanguages={this.props.allLanguages}
|
||||||
siteLanguages={this.props.siteLanguages}
|
siteLanguages={this.props.siteLanguages}
|
||||||
|
containerClass="comment-comment-container"
|
||||||
onUpsertComment={this.props.onEditComment}
|
onUpsertComment={this.props.onEditComment}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -512,7 +513,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
</button>
|
</button>
|
||||||
{!this.state.showAdvanced ? (
|
{!this.state.showAdvanced ? (
|
||||||
<button
|
<button
|
||||||
className="btn btn-link btn-animate text-muted"
|
className="btn btn-link btn-animate text-muted btn-more"
|
||||||
onClick={linkEvent(this, this.handleShowAdvanced)}
|
onClick={linkEvent(this, this.handleShowAdvanced)}
|
||||||
data-tippy-content={i18n.t("more")}
|
data-tippy-content={i18n.t("more")}
|
||||||
aria-label={i18n.t("more")}
|
aria-label={i18n.t("more")}
|
||||||
|
@ -944,7 +945,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
{showMoreChildren && (
|
{showMoreChildren && (
|
||||||
<div
|
<div
|
||||||
className={classNames("details ml-1 comment-node py-2", {
|
className={classNames("details ml-1 comment-node py-2", {
|
||||||
|
@ -1143,6 +1144,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
focus
|
focus
|
||||||
allLanguages={this.props.allLanguages}
|
allLanguages={this.props.allLanguages}
|
||||||
siteLanguages={this.props.siteLanguages}
|
siteLanguages={this.props.siteLanguages}
|
||||||
|
containerClass="comment-comment-container"
|
||||||
onUpsertComment={this.props.onCreateComment}
|
onUpsertComment={this.props.onCreateComment}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -64,8 +64,9 @@ export class MarkdownTextArea extends Component<
|
||||||
MarkdownTextAreaProps,
|
MarkdownTextAreaProps,
|
||||||
MarkdownTextAreaState
|
MarkdownTextAreaState
|
||||||
> {
|
> {
|
||||||
private id = `comment-textarea-${randomStr()}`;
|
private id = `markdown-textarea-${randomStr()}`;
|
||||||
private formId = `comment-form-${randomStr()}`;
|
private formId = `markdown-form-${randomStr()}`;
|
||||||
|
|
||||||
private tribute: any;
|
private tribute: any;
|
||||||
|
|
||||||
state: MarkdownTextAreaState = {
|
state: MarkdownTextAreaState = {
|
||||||
|
|
|
@ -360,7 +360,6 @@ export class Community extends Component<
|
||||||
community_view={res.community_view}
|
community_view={res.community_view}
|
||||||
moderators={res.moderators}
|
moderators={res.moderators}
|
||||||
admins={site_res.admins}
|
admins={site_res.admins}
|
||||||
online={res.online}
|
|
||||||
enableNsfw={enableNsfw(site_res)}
|
enableNsfw={enableNsfw(site_res)}
|
||||||
editable
|
editable
|
||||||
allLanguages={site_res.all_languages}
|
allLanguages={site_res.all_languages}
|
||||||
|
|
|
@ -39,7 +39,6 @@ interface SidebarProps {
|
||||||
allLanguages: Language[];
|
allLanguages: Language[];
|
||||||
siteLanguages: number[];
|
siteLanguages: number[];
|
||||||
communityLanguages?: number[];
|
communityLanguages?: number[];
|
||||||
online: number;
|
|
||||||
enableNsfw?: boolean;
|
enableNsfw?: boolean;
|
||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
editable?: boolean;
|
editable?: boolean;
|
||||||
|
@ -132,8 +131,9 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
const myUSerInfo = UserService.Instance.myUserInfo;
|
const myUSerInfo = UserService.Instance.myUserInfo;
|
||||||
const { name, actor_id } = this.props.community_view.community;
|
const { name, actor_id } = this.props.community_view.community;
|
||||||
return (
|
return (
|
||||||
<div>
|
<aside className="mb-3">
|
||||||
<div className="card border-secondary mb-3">
|
<div id="sidebarContainer">
|
||||||
|
<section id="sidebarMain" className="card border-secondary mb-3">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{this.communityTitle()}
|
{this.communityTitle()}
|
||||||
{this.props.editable && this.adminButtons()}
|
{this.props.editable && this.adminButtons()}
|
||||||
|
@ -154,15 +154,16 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
<div className="card border-secondary mb-3">
|
<section id="sidebarInfo" className="card border-secondary mb-3">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{this.description()}
|
{this.description()}
|
||||||
{this.badges()}
|
{this.badges()}
|
||||||
{this.mods()}
|
{this.mods()}
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</aside>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,12 +238,6 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
const counts = community_view.counts;
|
const counts = community_view.counts;
|
||||||
return (
|
return (
|
||||||
<ul className="my-1 list-inline">
|
<ul className="my-1 list-inline">
|
||||||
<li className="list-inline-item badge badge-secondary">
|
|
||||||
{i18n.t("number_online", {
|
|
||||||
count: this.props.online,
|
|
||||||
formattedCount: numToSI(this.props.online),
|
|
||||||
})}
|
|
||||||
</li>
|
|
||||||
<li
|
<li
|
||||||
className="list-inline-item badge badge-secondary pointer"
|
className="list-inline-item badge badge-secondary pointer"
|
||||||
data-tippy-content={i18n.t("active_users_in_the_last_day", {
|
data-tippy-content={i18n.t("active_users_in_the_last_day", {
|
||||||
|
|
|
@ -361,7 +361,6 @@ export class Home extends Component<any, HomeState> {
|
||||||
siteRes: {
|
siteRes: {
|
||||||
site_view: { counts, site },
|
site_view: { counts, site },
|
||||||
admins,
|
admins,
|
||||||
online,
|
|
||||||
},
|
},
|
||||||
showSubscribedMobile,
|
showSubscribedMobile,
|
||||||
showTrendingMobile,
|
showTrendingMobile,
|
||||||
|
@ -393,7 +392,6 @@ export class Home extends Component<any, HomeState> {
|
||||||
site={site}
|
site={site}
|
||||||
admins={admins}
|
admins={admins}
|
||||||
counts={counts}
|
counts={counts}
|
||||||
online={online}
|
|
||||||
showLocal={showLocal(this.isoData)}
|
showLocal={showLocal(this.isoData)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -417,14 +415,12 @@ export class Home extends Component<any, HomeState> {
|
||||||
siteRes: {
|
siteRes: {
|
||||||
site_view: { counts, site },
|
site_view: { counts, site },
|
||||||
admins,
|
admins,
|
||||||
online,
|
|
||||||
},
|
},
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div id="sidebarContainer">
|
||||||
<div>
|
<section id="sidebarMain" className="card border-secondary mb-3">
|
||||||
<div className="card border-secondary mb-3">
|
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{this.trendingCommunities()}
|
{this.trendingCommunities()}
|
||||||
{canCreateCommunity(this.state.siteRes) && (
|
{canCreateCommunity(this.state.siteRes) && (
|
||||||
|
@ -438,21 +434,22 @@ export class Home extends Component<any, HomeState> {
|
||||||
translationKey="explore_communities"
|
translationKey="explore_communities"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
<SiteSidebar
|
<SiteSidebar
|
||||||
site={site}
|
site={site}
|
||||||
admins={admins}
|
admins={admins}
|
||||||
counts={counts}
|
counts={counts}
|
||||||
online={online}
|
|
||||||
showLocal={showLocal(this.isoData)}
|
showLocal={showLocal(this.isoData)}
|
||||||
/>
|
/>
|
||||||
{this.hasFollows && (
|
{this.hasFollows && (
|
||||||
<div className="card border-secondary mb-3">
|
<section
|
||||||
|
id="sidebarSubscribed"
|
||||||
|
className="card border-secondary mb-3"
|
||||||
|
>
|
||||||
<div className="card-body">{this.subscribedCommunities}</div>
|
<div className="card-body">{this.subscribedCommunities}</div>
|
||||||
</div>
|
</section>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ export class Login extends Component<any, State> {
|
||||||
toast(i18n.t("enter_two_factor_code"), "info");
|
toast(i18n.t("enter_two_factor_code"), "info");
|
||||||
}
|
}
|
||||||
|
|
||||||
i.setState({ loginRes: { state: "empty" } });
|
i.setState({ loginRes: { state: "failed", msg: loginRes.msg } });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
||||||
slur_filter_regex: ls.slur_filter_regex,
|
slur_filter_regex: ls.slur_filter_regex,
|
||||||
actor_name_max_length: ls.actor_name_max_length,
|
actor_name_max_length: ls.actor_name_max_length,
|
||||||
federation_enabled: ls.federation_enabled,
|
federation_enabled: ls.federation_enabled,
|
||||||
federation_debug: ls.federation_debug,
|
|
||||||
federation_worker_count: ls.federation_worker_count,
|
federation_worker_count: ls.federation_worker_count,
|
||||||
captcha_enabled: ls.captcha_enabled,
|
captcha_enabled: ls.captcha_enabled,
|
||||||
captcha_difficulty: ls.captcha_difficulty,
|
captcha_difficulty: ls.captcha_difficulty,
|
||||||
|
|
|
@ -12,7 +12,6 @@ interface SiteSidebarProps {
|
||||||
showLocal: boolean;
|
showLocal: boolean;
|
||||||
counts?: SiteAggregates;
|
counts?: SiteAggregates;
|
||||||
admins?: PersonView[];
|
admins?: PersonView[];
|
||||||
online?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SiteSidebarState {
|
interface SiteSidebarState {
|
||||||
|
@ -30,7 +29,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="card border-secondary mb-3">
|
<section id="sidebarInfo" className="card border-secondary mb-3">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div>
|
<div>
|
||||||
<div className="mb-2">{this.siteName()}</div>
|
<div className="mb-2">{this.siteName()}</div>
|
||||||
|
@ -42,7 +41,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,15 +98,8 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
|
||||||
|
|
||||||
badges(siteAggregates: SiteAggregates) {
|
badges(siteAggregates: SiteAggregates) {
|
||||||
const counts = siteAggregates;
|
const counts = siteAggregates;
|
||||||
const online = this.props.online ?? 1;
|
|
||||||
return (
|
return (
|
||||||
<ul className="my-2 list-inline">
|
<ul className="my-2 list-inline">
|
||||||
<li className="list-inline-item badge badge-secondary">
|
|
||||||
{i18n.t("number_online", {
|
|
||||||
count: online,
|
|
||||||
formattedCount: numToSI(online),
|
|
||||||
})}
|
|
||||||
</li>
|
|
||||||
<li
|
<li
|
||||||
className="list-inline-item badge badge-secondary pointer"
|
className="list-inline-item badge badge-secondary pointer"
|
||||||
data-tippy-content={i18n.t("active_users_in_the_last_day", {
|
data-tippy-content={i18n.t("active_users_in_the_last_day", {
|
||||||
|
|
|
@ -166,7 +166,10 @@ export class CreatePost extends Component<
|
||||||
</h5>
|
</h5>
|
||||||
) : (
|
) : (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-12 col-lg-6 offset-lg-3 mb-4">
|
<div
|
||||||
|
id="createPostForm"
|
||||||
|
className="col-12 col-lg-6 offset-lg-3 mb-4"
|
||||||
|
>
|
||||||
<h5>{i18n.t("create_post")}</h5>
|
<h5>{i18n.t("create_post")}</h5>
|
||||||
<PostForm
|
<PostForm
|
||||||
onCreate={this.handlePostCreate}
|
onCreate={this.handlePostCreate}
|
||||||
|
|
|
@ -230,13 +230,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
body() {
|
body() {
|
||||||
const body = this.postView.post.body;
|
const body = this.postView.post.body;
|
||||||
return body ? (
|
return body ? (
|
||||||
<div className="col-12 card my-2 p-2">
|
<article id="postContent" className="col-12 card my-2 p-2">
|
||||||
{this.state.viewSource ? (
|
{this.state.viewSource ? (
|
||||||
<pre>{body}</pre>
|
<pre>{body}</pre>
|
||||||
) : (
|
) : (
|
||||||
<div className="md-div" dangerouslySetInnerHTML={mdToHtml(body)} />
|
<div className="md-div" dangerouslySetInnerHTML={mdToHtml(body)} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</article>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
);
|
);
|
||||||
|
@ -464,7 +464,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
</button>
|
</button>
|
||||||
{showScores() ? (
|
{showScores() ? (
|
||||||
<div
|
<div
|
||||||
className={`unselectable pointer font-weight-bold text-muted px-1`}
|
className={`unselectable pointer font-weight-bold text-muted px-1 post-score`}
|
||||||
data-tippy-content={this.pointsTippy}
|
data-tippy-content={this.pointsTippy}
|
||||||
>
|
>
|
||||||
{numToSI(this.postView.counts.score)}
|
{numToSI(this.postView.counts.score)}
|
||||||
|
@ -1398,7 +1398,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
<>
|
<>
|
||||||
{/* The mobile view*/}
|
{/* The mobile view*/}
|
||||||
<div className="d-block d-sm-none">
|
<div className="d-block d-sm-none">
|
||||||
<div className="row">
|
<article className="row post-container">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
{this.createdLine()}
|
{this.createdLine()}
|
||||||
|
|
||||||
|
@ -1413,14 +1413,14 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
{this.duplicatesLine()}
|
{this.duplicatesLine()}
|
||||||
{this.removeAndBanDialogs()}
|
{this.removeAndBanDialogs()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* The larger view*/}
|
{/* The larger view*/}
|
||||||
<div className="d-none d-sm-block">
|
<div className="d-none d-sm-block">
|
||||||
<div className="row">
|
<article className="row post-container">
|
||||||
{!this.props.viewOnly && this.voteBar()}
|
{!this.props.viewOnly && this.voteBar()}
|
||||||
<div className="col-sm-2 pr-0">
|
<div className="col-sm-2 pr-0 post-media">
|
||||||
<div className="">{this.thumbnail()}</div>
|
<div className="">{this.thumbnail()}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-sm-9">
|
<div className="col-12 col-sm-9">
|
||||||
|
@ -1435,7 +1435,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -384,6 +384,7 @@ export class Post extends Component<any, PostState> {
|
||||||
disabled={res.post_view.post.locked}
|
disabled={res.post_view.post.locked}
|
||||||
allLanguages={this.state.siteRes.all_languages}
|
allLanguages={this.state.siteRes.all_languages}
|
||||||
siteLanguages={this.state.siteRes.discussion_languages}
|
siteLanguages={this.state.siteRes.discussion_languages}
|
||||||
|
containerClass="post-comment-container"
|
||||||
onUpsertComment={this.handleCreateComment}
|
onUpsertComment={this.handleCreateComment}
|
||||||
finished={this.state.finished.get(0)}
|
finished={this.state.finished.get(0)}
|
||||||
/>
|
/>
|
||||||
|
@ -547,12 +548,10 @@ export class Post extends Component<any, PostState> {
|
||||||
const res = this.state.postRes;
|
const res = this.state.postRes;
|
||||||
if (res.state === "success") {
|
if (res.state === "success") {
|
||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
|
||||||
<Sidebar
|
<Sidebar
|
||||||
community_view={res.data.community_view}
|
community_view={res.data.community_view}
|
||||||
moderators={res.data.moderators}
|
moderators={res.data.moderators}
|
||||||
admins={this.state.siteRes.admins}
|
admins={this.state.siteRes.admins}
|
||||||
online={res.data.online}
|
|
||||||
enableNsfw={enableNsfw(this.state.siteRes)}
|
enableNsfw={enableNsfw(this.state.siteRes)}
|
||||||
showIcon
|
showIcon
|
||||||
allLanguages={this.state.siteRes.all_languages}
|
allLanguages={this.state.siteRes.all_languages}
|
||||||
|
@ -565,7 +564,6 @@ export class Post extends Component<any, PostState> {
|
||||||
onBlockCommunity={this.handleBlockCommunity}
|
onBlockCommunity={this.handleBlockCommunity}
|
||||||
onEditCommunity={this.handleEditCommunity}
|
onEditCommunity={this.handleEditCommunity}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5615,10 +5615,10 @@ leac@^0.6.0:
|
||||||
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
|
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
|
||||||
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==
|
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==
|
||||||
|
|
||||||
lemmy-js-client@0.17.2-rc.24:
|
lemmy-js-client@0.18.0-rc.1:
|
||||||
version "0.17.2-rc.24"
|
version "0.18.0-rc.1"
|
||||||
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.24.tgz#3b09233a6d89286e559be2e840d81c0c549562ad"
|
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.18.0-rc.1.tgz#fd0c88810572d90413696011ebaed19e3b8162d8"
|
||||||
integrity sha512-aSHz7UTcwnwnNd9poY8tEXP7RA9ieZm9MAfSljcbCNU5ds9CASXYNodmraUVJiqCmT4HWnj7IeVmBC9r7nTHnw==
|
integrity sha512-lQe443Nr5UCSoY+IxmT7mBe0IRF6EAZ/4PJSRoPSL+U8A+egMMBPbuxnisHzLsC+eDOWRUIgOqZlwlaRnbmuig==
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-fetch "^3.1.5"
|
cross-fetch "^3.1.5"
|
||||||
form-data "^4.0.0"
|
form-data "^4.0.0"
|
||||||
|
|
Loading…
Reference in a new issue