Merge pull request #1590 from jsit/fix/wider-max-width-1536

fix(UI): Make max-width wider, and make sidebar narrower on wide screens (#1536)
This commit is contained in:
SleeplessOne1917 2023-06-26 20:34:32 -04:00 committed by GitHub
commit 8766c5cf8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 455 additions and 338 deletions

View file

@ -198,9 +198,9 @@ blockquote {
.thumbnail { .thumbnail {
object-fit: cover; object-fit: cover;
min-height: 60px; aspect-ratio: 4/3;
max-height: 80px;
width: 100%; width: 100%;
max-height: 6rem;
} }
.thumbnail svg { .thumbnail svg {

View file

@ -1,7 +1,3 @@
$link-decoration: none; $link-decoration: none;
$min-contrast-ratio: 3; $min-contrast-ratio: 3;
$font-size-base: 0.875rem; $font-size-base: 0.875rem;
$container-max-widths: (
lg: 1140px,
);

View file

@ -726,7 +726,11 @@ progress {
.container, .container,
.container-fluid, .container-fluid,
.container-lg { .container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
--bs-gutter-x: 1.5rem; --bs-gutter-x: 1.5rem;
--bs-gutter-y: 0; --bs-gutter-y: 0;
width: 100%; width: 100%;
@ -736,11 +740,31 @@ progress {
margin-left: auto; margin-left: auto;
} }
@media (min-width: 576px) {
.container-sm, .container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container-md, .container-sm, .container {
max-width: 720px;
}
}
@media (min-width: 992px) { @media (min-width: 992px) {
.container-lg, .container-md, .container-sm, .container { .container-lg, .container-md, .container-sm, .container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1140px; max-width: 1140px;
} }
} }
@media (min-width: 1400px) {
.container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1320px;
}
}
:root { :root {
--bs-breakpoint-xs: 0; --bs-breakpoint-xs: 0;
--bs-breakpoint-sm: 576px; --bs-breakpoint-sm: 576px;
@ -3867,7 +3891,11 @@ textarea.form-control-lg {
} }
.navbar > .container, .navbar > .container,
.navbar > .container-fluid, .navbar > .container-fluid,
.navbar > .container-lg { .navbar > .container-sm,
.navbar > .container-md,
.navbar > .container-lg,
.navbar > .container-xl,
.navbar > .container-xxl {
display: flex; display: flex;
flex-wrap: inherit; flex-wrap: inherit;
align-items: center; align-items: center;

View file

@ -726,7 +726,11 @@ progress {
.container, .container,
.container-fluid, .container-fluid,
.container-lg { .container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
--bs-gutter-x: 1.5rem; --bs-gutter-x: 1.5rem;
--bs-gutter-y: 0; --bs-gutter-y: 0;
width: 100%; width: 100%;
@ -736,11 +740,31 @@ progress {
margin-left: auto; margin-left: auto;
} }
@media (min-width: 576px) {
.container-sm, .container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container-md, .container-sm, .container {
max-width: 720px;
}
}
@media (min-width: 992px) { @media (min-width: 992px) {
.container-lg, .container-md, .container-sm, .container { .container-lg, .container-md, .container-sm, .container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1140px; max-width: 1140px;
} }
} }
@media (min-width: 1400px) {
.container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1320px;
}
}
:root { :root {
--bs-breakpoint-xs: 0; --bs-breakpoint-xs: 0;
--bs-breakpoint-sm: 576px; --bs-breakpoint-sm: 576px;
@ -3867,7 +3891,11 @@ textarea.form-control-lg {
} }
.navbar > .container, .navbar > .container,
.navbar > .container-fluid, .navbar > .container-fluid,
.navbar > .container-lg { .navbar > .container-sm,
.navbar > .container-md,
.navbar > .container-lg,
.navbar > .container-xl,
.navbar > .container-xxl {
display: flex; display: flex;
flex-wrap: inherit; flex-wrap: inherit;
align-items: center; align-items: center;

View file

@ -725,7 +725,11 @@ progress {
.container, .container,
.container-fluid, .container-fluid,
.container-lg { .container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
--bs-gutter-x: 1.5rem; --bs-gutter-x: 1.5rem;
--bs-gutter-y: 0; --bs-gutter-y: 0;
width: 100%; width: 100%;
@ -735,11 +739,31 @@ progress {
margin-left: auto; margin-left: auto;
} }
@media (min-width: 576px) {
.container-sm, .container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container-md, .container-sm, .container {
max-width: 720px;
}
}
@media (min-width: 992px) { @media (min-width: 992px) {
.container-lg, .container-md, .container-sm, .container { .container-lg, .container-md, .container-sm, .container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1140px; max-width: 1140px;
} }
} }
@media (min-width: 1400px) {
.container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1320px;
}
}
:root { :root {
--bs-breakpoint-xs: 0; --bs-breakpoint-xs: 0;
--bs-breakpoint-sm: 576px; --bs-breakpoint-sm: 576px;
@ -3866,7 +3890,11 @@ textarea.form-control-lg {
} }
.navbar > .container, .navbar > .container,
.navbar > .container-fluid, .navbar > .container-fluid,
.navbar > .container-lg { .navbar > .container-sm,
.navbar > .container-md,
.navbar > .container-lg,
.navbar > .container-xl,
.navbar > .container-xxl {
display: flex; display: flex;
flex-wrap: inherit; flex-wrap: inherit;
align-items: center; align-items: center;

View file

@ -725,7 +725,11 @@ progress {
.container, .container,
.container-fluid, .container-fluid,
.container-lg { .container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
--bs-gutter-x: 1.5rem; --bs-gutter-x: 1.5rem;
--bs-gutter-y: 0; --bs-gutter-y: 0;
width: 100%; width: 100%;
@ -735,11 +739,31 @@ progress {
margin-left: auto; margin-left: auto;
} }
@media (min-width: 576px) {
.container-sm, .container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container-md, .container-sm, .container {
max-width: 720px;
}
}
@media (min-width: 992px) { @media (min-width: 992px) {
.container-lg, .container-md, .container-sm, .container { .container-lg, .container-md, .container-sm, .container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1140px; max-width: 1140px;
} }
} }
@media (min-width: 1400px) {
.container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1320px;
}
}
:root { :root {
--bs-breakpoint-xs: 0; --bs-breakpoint-xs: 0;
--bs-breakpoint-sm: 576px; --bs-breakpoint-sm: 576px;
@ -3866,7 +3890,11 @@ textarea.form-control-lg {
} }
.navbar > .container, .navbar > .container,
.navbar > .container-fluid, .navbar > .container-fluid,
.navbar > .container-lg { .navbar > .container-sm,
.navbar > .container-md,
.navbar > .container-lg,
.navbar > .container-xl,
.navbar > .container-xxl {
display: flex; display: flex;
flex-wrap: inherit; flex-wrap: inherit;
align-items: center; align-items: center;

View file

@ -79,256 +79,246 @@ 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 <div className="shadow-sm">
className="navbar navbar-expand-md navbar-light shadow-sm p-0 px-3 container-lg" <nav
id="navbar" className="navbar navbar-expand-md navbar-light p-0 px-3 container-lg"
> id="navbar"
<NavLink
id="navTitle"
to="/"
title={siteView?.site.description ?? siteView?.site.name}
className="d-flex align-items-center navbar-brand me-md-3"
onMouseUp={linkEvent(this, handleCollapseClick)}
> >
{siteView?.site.icon && showAvatars() && ( <NavLink
<PictrsImage src={siteView.site.icon} icon /> id="navTitle"
)} to="/"
{siteView?.site.name} title={siteView?.site.description ?? siteView?.site.name}
</NavLink> className="d-flex align-items-center navbar-brand me-md-3"
{person && ( onMouseUp={linkEvent(this, handleCollapseClick)}
<ul className="navbar-nav d-flex flex-row ms-auto d-md-none"> >
<li id="navMessages" className="nav-item nav-item-icon"> {siteView?.site.icon && showAvatars() && (
<NavLink <PictrsImage src={siteView.site.icon} icon />
to="/inbox" )}
className="p-1 nav-link border-0 nav-messages" {siteView?.site.name}
title={I18NextService.i18n.t("unread_messages", { </NavLink>
count: Number(this.state.unreadApplicationCountRes.state), {person && (
formattedCount: numToSI(this.unreadInboxCount), <ul className="navbar-nav d-flex flex-row ms-auto d-md-none">
})} <li id="navMessages" className="nav-item nav-item-icon">
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="bell" />
{this.unreadInboxCount > 0 && (
<span className="mx-1 badge text-bg-light">
{numToSI(this.unreadInboxCount)}
</span>
)}
</NavLink>
</li>
{this.moderatesSomething && (
<li className="nav-item nav-item-icon">
<NavLink <NavLink
to="/reports" to="/inbox"
className="p-1 nav-link border-0" className="p-1 nav-link border-0 nav-messages"
title={I18NextService.i18n.t("unread_reports", { title={I18NextService.i18n.t("unread_messages", {
count: Number(this.unreadReportCount), count: Number(this.state.unreadApplicationCountRes.state),
formattedCount: numToSI(this.unreadReportCount), formattedCount: numToSI(this.unreadInboxCount),
})} })}
onMouseUp={linkEvent(this, handleCollapseClick)} onMouseUp={linkEvent(this, handleCollapseClick)}
> >
<Icon icon="shield" /> <Icon icon="bell" />
{this.unreadReportCount > 0 && ( {this.unreadInboxCount > 0 && (
<span className="mx-1 badge text-bg-light"> <span className="mx-1 badge text-bg-light">
{numToSI(this.unreadReportCount)} {numToSI(this.unreadInboxCount)}
</span> </span>
)} )}
</NavLink> </NavLink>
</li> </li>
)} {this.moderatesSomething && (
{amAdmin() && ( <li className="nav-item nav-item-icon">
<li className="nav-item nav-item-icon">
<NavLink
to="/registration_applications"
className="p-1 nav-link border-0"
title={I18NextService.i18n.t(
"unread_registration_applications",
{
count: Number(this.unreadApplicationCount),
formattedCount: numToSI(this.unreadApplicationCount),
}
)}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="clipboard" />
{this.unreadApplicationCount > 0 && (
<span className="mx-1 badge text-bg-light">
{numToSI(this.unreadApplicationCount)}
</span>
)}
</NavLink>
</li>
)}
</ul>
)}
<button
className="navbar-toggler border-0 p-1"
type="button"
aria-label="menu"
data-tippy-content={I18NextService.i18n.t("expand_here")}
data-bs-toggle="collapse"
data-bs-target="#navbarDropdown"
aria-controls="navbarDropdown"
aria-expanded="false"
ref={this.collapseButtonRef}
>
<Icon icon="menu" />
</button>
<div
className="collapse navbar-collapse my-2"
id="navbarDropdown"
ref={this.mobileMenuRef}
>
<ul id="navbarLinks" className="me-auto navbar-nav">
<li className="nav-item">
<NavLink
to="/communities"
className="nav-link"
title={I18NextService.i18n.t("communities")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("communities")}
</NavLink>
</li>
<li className="nav-item">
{/* TODO make sure this works: https://github.com/infernojs/inferno/issues/1608 */}
<NavLink
to={{
pathname: "/create_post",
search: "",
hash: "",
key: "",
state: { prevPath: this.currentLocation },
}}
className="nav-link"
title={I18NextService.i18n.t("create_post")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("create_post")}
</NavLink>
</li>
{this.props.siteRes && canCreateCommunity(this.props.siteRes) && (
<li className="nav-item">
<NavLink
to="/create_community"
className="nav-link"
title={I18NextService.i18n.t("create_community")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("create_community")}
</NavLink>
</li>
)}
<li className="nav-item">
<a
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("support_lemmy")}
href={donateLemmyUrl}
>
<Icon icon="heart" classes="small" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("support_lemmy")}
</span>
</a>
</li>
</ul>
<ul id="navbarIcons" className="navbar-nav">
<li id="navSearch" className="nav-item">
<NavLink
to="/search"
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("search")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="search" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("search")}
</span>
</NavLink>
</li>
{amAdmin() && (
<li id="navAdmin" className="nav-item">
<NavLink
to="/admin"
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("admin_settings")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="settings" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("admin_settings")}
</span>
</NavLink>
</li>
)}
{person ? (
<>
<li id="navMessages" className="nav-item">
<NavLink <NavLink
className="nav-link d-inline-flex align-items-center d-md-inline-block" to="/reports"
to="/inbox" className="p-1 nav-link border-0"
title={I18NextService.i18n.t("unread_messages", { title={I18NextService.i18n.t("unread_reports", {
count: Number(this.unreadInboxCount), count: Number(this.unreadReportCount),
formattedCount: numToSI(this.unreadInboxCount), formattedCount: numToSI(this.unreadReportCount),
})} })}
onMouseUp={linkEvent(this, handleCollapseClick)} onMouseUp={linkEvent(this, handleCollapseClick)}
> >
<Icon icon="bell" /> <Icon icon="shield" />
<span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0"> {this.unreadReportCount > 0 && (
{I18NextService.i18n.t("unread_messages", {
count: Number(this.unreadInboxCount),
formattedCount: numToSI(this.unreadInboxCount),
})}
</span>
{this.unreadInboxCount > 0 && (
<span className="mx-1 badge text-bg-light"> <span className="mx-1 badge text-bg-light">
{numToSI(this.unreadInboxCount)} {numToSI(this.unreadReportCount)}
</span> </span>
)} )}
</NavLink> </NavLink>
</li> </li>
{this.moderatesSomething && ( )}
<li id="navModeration" className="nav-item"> {amAdmin() && (
<li className="nav-item nav-item-icon">
<NavLink
to="/registration_applications"
className="p-1 nav-link border-0"
title={I18NextService.i18n.t(
"unread_registration_applications",
{
count: Number(this.unreadApplicationCount),
formattedCount: numToSI(this.unreadApplicationCount),
}
)}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="clipboard" />
{this.unreadApplicationCount > 0 && (
<span className="mx-1 badge text-bg-light">
{numToSI(this.unreadApplicationCount)}
</span>
)}
</NavLink>
</li>
)}
</ul>
)}
<button
className="navbar-toggler border-0 p-1"
type="button"
aria-label="menu"
data-tippy-content={I18NextService.i18n.t("expand_here")}
data-bs-toggle="collapse"
data-bs-target="#navbarDropdown"
aria-controls="navbarDropdown"
aria-expanded="false"
ref={this.collapseButtonRef}
>
<Icon icon="menu" />
</button>
<div
className="collapse navbar-collapse my-2"
id="navbarDropdown"
ref={this.mobileMenuRef}
>
<ul id="navbarLinks" className="me-auto navbar-nav">
<li className="nav-item">
<NavLink
to="/communities"
className="nav-link"
title={I18NextService.i18n.t("communities")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("communities")}
</NavLink>
</li>
<li className="nav-item">
{/* TODO make sure this works: https://github.com/infernojs/inferno/issues/1608 */}
<NavLink
to={{
pathname: "/create_post",
search: "",
hash: "",
key: "",
state: { prevPath: this.currentLocation },
}}
className="nav-link"
title={I18NextService.i18n.t("create_post")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("create_post")}
</NavLink>
</li>
{this.props.siteRes && canCreateCommunity(this.props.siteRes) && (
<li className="nav-item">
<NavLink
to="/create_community"
className="nav-link"
title={I18NextService.i18n.t("create_community")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("create_community")}
</NavLink>
</li>
)}
<li className="nav-item">
<a
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("support_lemmy")}
href={donateLemmyUrl}
>
<Icon icon="heart" classes="small" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("support_lemmy")}
</span>
</a>
</li>
</ul>
<ul id="navbarIcons" className="navbar-nav">
<li id="navSearch" className="nav-item">
<NavLink
to="/search"
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("search")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="search" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("search")}
</span>
</NavLink>
</li>
{amAdmin() && (
<li id="navAdmin" className="nav-item">
<NavLink
to="/admin"
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t("admin_settings")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="settings" />
<span className="d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("admin_settings")}
</span>
</NavLink>
</li>
)}
{person ? (
<>
<li id="navMessages" className="nav-item">
<NavLink <NavLink
className="nav-link d-inline-flex align-items-center d-md-inline-block" className="nav-link d-inline-flex align-items-center d-md-inline-block"
to="/reports" to="/inbox"
title={I18NextService.i18n.t("unread_reports", { title={I18NextService.i18n.t("unread_messages", {
count: Number(this.unreadReportCount), count: Number(this.unreadInboxCount),
formattedCount: numToSI(this.unreadReportCount), formattedCount: numToSI(this.unreadInboxCount),
})} })}
onMouseUp={linkEvent(this, handleCollapseClick)} onMouseUp={linkEvent(this, handleCollapseClick)}
> >
<Icon icon="shield" /> <Icon icon="bell" />
<span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0"> <span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t("unread_reports", { {I18NextService.i18n.t("unread_messages", {
count: Number(this.unreadReportCount), count: Number(this.unreadInboxCount),
formattedCount: numToSI(this.unreadReportCount), formattedCount: numToSI(this.unreadInboxCount),
})} })}
</span> </span>
{this.unreadReportCount > 0 && ( {this.unreadInboxCount > 0 && (
<span className="mx-1 badge text-bg-light"> <span className="mx-1 badge text-bg-light">
{numToSI(this.unreadReportCount)} {numToSI(this.unreadInboxCount)}
</span> </span>
)} )}
</NavLink> </NavLink>
</li> </li>
)} {this.moderatesSomething && (
{amAdmin() && ( <li id="navModeration" className="nav-item">
<li id="navApplications" className="nav-item"> <NavLink
<NavLink className="nav-link d-inline-flex align-items-center d-md-inline-block"
to="/registration_applications" to="/reports"
className="nav-link d-inline-flex align-items-center d-md-inline-block" title={I18NextService.i18n.t("unread_reports", {
title={I18NextService.i18n.t( count: Number(this.unreadReportCount),
"unread_registration_applications", formattedCount: numToSI(this.unreadReportCount),
{ })}
count: Number(this.unreadApplicationCount), onMouseUp={linkEvent(this, handleCollapseClick)}
formattedCount: numToSI(this.unreadApplicationCount), >
} <Icon icon="shield" />
)} <span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0">
onMouseUp={linkEvent(this, handleCollapseClick)} {I18NextService.i18n.t("unread_reports", {
> count: Number(this.unreadReportCount),
<Icon icon="clipboard" /> formattedCount: numToSI(this.unreadReportCount),
<span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0"> })}
{I18NextService.i18n.t( </span>
{this.unreadReportCount > 0 && (
<span className="mx-1 badge text-bg-light">
{numToSI(this.unreadReportCount)}
</span>
)}
</NavLink>
</li>
)}
{amAdmin() && (
<li id="navApplications" className="nav-item">
<NavLink
to="/registration_applications"
className="nav-link d-inline-flex align-items-center d-md-inline-block"
title={I18NextService.i18n.t(
"unread_registration_applications", "unread_registration_applications",
{ {
count: Number(this.unreadApplicationCount), count: Number(this.unreadApplicationCount),
@ -337,97 +327,111 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
), ),
} }
)} )}
</span> onMouseUp={linkEvent(this, handleCollapseClick)}
{this.unreadApplicationCount > 0 && ( >
<span className="mx-1 badge text-bg-light"> <Icon icon="clipboard" />
{numToSI(this.unreadApplicationCount)} <span className="badge text-bg-light d-inline ms-1 d-md-none ms-md-0">
{I18NextService.i18n.t(
"unread_registration_applications",
{
count: Number(this.unreadApplicationCount),
formattedCount: numToSI(
this.unreadApplicationCount
),
}
)}
</span> </span>
)} {this.unreadApplicationCount > 0 && (
<span className="mx-1 badge text-bg-light">
{numToSI(this.unreadApplicationCount)}
</span>
)}
</NavLink>
</li>
)}
{person && (
<li id="dropdownUser" className="dropdown">
<button
type="button"
className="btn dropdown-toggle"
aria-expanded="false"
data-bs-toggle="dropdown"
>
{showAvatars() && person.avatar && (
<PictrsImage src={person.avatar} icon />
)}
{person.display_name ?? person.name}
</button>
<ul
className="dropdown-menu"
style={{ "min-width": "fit-content" }}
>
<li>
<NavLink
to={`/u/${person.name}`}
className="dropdown-item px-2"
title={I18NextService.i18n.t("profile")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="user" classes="me-1" />
{I18NextService.i18n.t("profile")}
</NavLink>
</li>
<li>
<NavLink
to="/settings"
className="dropdown-item px-2"
title={I18NextService.i18n.t("settings")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="settings" classes="me-1" />
{I18NextService.i18n.t("settings")}
</NavLink>
</li>
<li>
<hr className="dropdown-divider" />
</li>
<li>
<button
className="dropdown-item btn btn-link px-2"
onClick={linkEvent(this, handleLogOut)}
>
<Icon icon="log-out" classes="me-1" />
{I18NextService.i18n.t("logout")}
</button>
</li>
</ul>
</li>
)}
</>
) : (
<>
<li className="nav-item">
<NavLink
to="/login"
className="nav-link"
title={I18NextService.i18n.t("login")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("login")}
</NavLink> </NavLink>
</li> </li>
)} <li className="nav-item">
{person && ( <NavLink
<li id="dropdownUser" className="dropdown"> to="/signup"
<button className="nav-link"
type="button" title={I18NextService.i18n.t("sign_up")}
className="btn dropdown-toggle" onMouseUp={linkEvent(this, handleCollapseClick)}
aria-expanded="false"
data-bs-toggle="dropdown"
> >
{showAvatars() && person.avatar && ( {I18NextService.i18n.t("sign_up")}
<PictrsImage src={person.avatar} icon /> </NavLink>
)}
{person.display_name ?? person.name}
</button>
<ul
className="dropdown-menu"
style={{ "min-width": "fit-content" }}
>
<li>
<NavLink
to={`/u/${person.name}`}
className="dropdown-item px-2"
title={I18NextService.i18n.t("profile")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="user" classes="me-1" />
{I18NextService.i18n.t("profile")}
</NavLink>
</li>
<li>
<NavLink
to="/settings"
className="dropdown-item px-2"
title={I18NextService.i18n.t("settings")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
<Icon icon="settings" classes="me-1" />
{I18NextService.i18n.t("settings")}
</NavLink>
</li>
<li>
<hr className="dropdown-divider" />
</li>
<li>
<button
className="dropdown-item btn btn-link px-2"
onClick={linkEvent(this, handleLogOut)}
>
<Icon icon="log-out" classes="me-1" />
{I18NextService.i18n.t("logout")}
</button>
</li>
</ul>
</li> </li>
)} </>
</> )}
) : ( </ul>
<> </div>
<li className="nav-item"> </nav>
<NavLink </div>
to="/login"
className="nav-link"
title={I18NextService.i18n.t("login")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("login")}
</NavLink>
</li>
<li className="nav-item">
<NavLink
to="/signup"
className="nav-link"
title={I18NextService.i18n.t("sign_up")}
onMouseUp={linkEvent(this, handleCollapseClick)}
>
{I18NextService.i18n.t("sign_up")}
</NavLink>
</li>
</>
)}
</ul>
</div>
</nav>
); );
} }

View file

@ -174,7 +174,7 @@ export class VoteButtons extends Component<VoteButtonsProps, VoteButtonsState> {
render() { render() {
return ( return (
<div className="vote-bar col-1 pe-0 small text-center"> <div className="vote-bar pe-0 small text-center">
<button <button
type="button" type="button"
className={`btn-animate btn btn-link p-0 ${ className={`btn-animate btn btn-link p-0 ${

View file

@ -317,7 +317,10 @@ export class Community extends Component<
/> />
<div className="row"> <div className="row">
<main className="col-12 col-md-8" ref={this.mainContentRef}> <main
className="col-12 col-md-8 col-lg-9"
ref={this.mainContentRef}
>
{this.communityInfo(res)} {this.communityInfo(res)}
<div className="d-block d-md-none"> <div className="d-block d-md-none">
<button <button
@ -340,7 +343,7 @@ export class Community extends Component<
{this.listings(res)} {this.listings(res)}
<Paginator page={page} onChange={this.handlePageChange} /> <Paginator page={page} onChange={this.handlePageChange} />
</main> </main>
<aside className="d-none d-md-block col-md-4"> <aside className="d-none d-md-block col-md-4 col-lg-3">
{this.sidebar(res)} {this.sidebar(res)}
</aside> </aside>
</div> </div>

View file

@ -387,7 +387,7 @@ export class Home extends Component<any, HomeState> {
/> />
{site_setup && ( {site_setup && (
<div className="row"> <div className="row">
<main role="main" className="col-12 col-md-8"> <main role="main" className="col-12 col-md-8 col-lg-9">
{tagline && ( {tagline && (
<div <div
id="tagline" id="tagline"
@ -397,7 +397,7 @@ export class Home extends Component<any, HomeState> {
<div className="d-block d-md-none">{this.mobileView}</div> <div className="d-block d-md-none">{this.mobileView}</div>
{this.posts} {this.posts}
</main> </main>
<aside className="d-none d-md-block col-md-4"> <aside className="d-none d-md-block col-md-4 col-lg-3">
{this.mySidebar} {this.mySidebar}
</aside> </aside>
</div> </div>

View file

@ -1426,21 +1426,23 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<div className="d-none d-sm-block"> <div className="d-none d-sm-block">
<article className="row post-container"> <article className="row post-container">
{!this.props.viewOnly && ( {!this.props.viewOnly && (
<VoteButtons <div className="col flex-grow-0">
voteContentType={VoteContentType.Post} <VoteButtons
id={this.postView.post.id} voteContentType={VoteContentType.Post}
onVote={this.props.onPostVote} id={this.postView.post.id}
enableDownvotes={this.props.enableDownvotes} onVote={this.props.onPostVote}
counts={this.postView.counts} enableDownvotes={this.props.enableDownvotes}
my_vote={this.postView.my_vote} counts={this.postView.counts}
/> my_vote={this.postView.my_vote}
/>
</div>
)} )}
<div className="col-sm-2 pe-0 post-media"> <div className="col flex-grow-1">
<div className="">{this.thumbnail()}</div>
</div>
<div className="col-12 col-sm-9">
<div className="row"> <div className="row">
<div className="col-12"> <div className="col-sm-3 col-lg-2 pe-0 post-media">
<div className="">{this.thumbnail()}</div>
</div>
<div className="col-12 col-sm-9 col-lg-10">
{this.postTitleLine()} {this.postTitleLine()}
{this.createdLine()} {this.createdLine()}
{this.showBodyPreview()} {this.showBodyPreview()}

View file

@ -348,7 +348,7 @@ export class Post extends Component<any, PostState> {
const res = this.state.postRes.data; const res = this.state.postRes.data;
return ( return (
<div className="row"> <div className="row">
<main className="col-12 col-md-8 mb-3"> <main className="col-12 col-md-8 col-lg-9 mb-3">
<HtmlTags <HtmlTags
title={this.documentTitle} title={this.documentTitle}
path={this.context.router.route.match.url} path={this.context.router.route.match.url}
@ -416,7 +416,7 @@ export class Post extends Component<any, PostState> {
{this.state.commentViewType == CommentViewType.Flat && {this.state.commentViewType == CommentViewType.Flat &&
this.commentsFlat()} this.commentsFlat()}
</main> </main>
<aside className="d-none d-md-block col-md-4"> <aside className="d-none d-md-block col-md-4 col-lg-3">
{this.sidebar()} {this.sidebar()}
</aside> </aside>
</div> </div>