diff --git a/package.json b/package.json index 01f5100e..7eab4cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-ui", - "version": "0.18.0", + "version": "0.18.1-rc.1", "description": "An isomorphic UI for lemmy", "repository": "https://github.com/LemmyNet/lemmy-ui", "license": "AGPL-3.0", diff --git a/src/assets/css/main.css b/src/assets/css/main.css index b917b3ec..63c1b471 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -198,9 +198,9 @@ blockquote { .thumbnail { object-fit: cover; - min-height: 60px; - max-height: 80px; + aspect-ratio: 4/3; width: 100%; + max-height: 6rem; } .thumbnail svg { @@ -360,8 +360,9 @@ br.big { } .img-icon { - width: 2rem; - height: 2rem; + width: calc(var(--bs-body-line-height) * 1em); + height: calc(var(--bs-body-line-height) * 1em); + border-radius: 0.25em; } .tribute-container ul { diff --git a/src/assets/css/themes/_variables.scss b/src/assets/css/themes/_variables.scss index 5b07cf52..47a01ce0 100644 --- a/src/assets/css/themes/_variables.scss +++ b/src/assets/css/themes/_variables.scss @@ -1,7 +1,3 @@ $link-decoration: none; $min-contrast-ratio: 3; $font-size-base: 0.875rem; - -$container-max-widths: ( - lg: 1140px, -); diff --git a/src/assets/css/themes/darkly-red.css b/src/assets/css/themes/darkly-red.css index 1fc30a00..a5292e8d 100644 --- a/src/assets/css/themes/darkly-red.css +++ b/src/assets/css/themes/darkly-red.css @@ -726,7 +726,11 @@ progress { .container, .container-fluid, -.container-lg { +.container-xxl, +.container-xl, +.container-lg, +.container-md, +.container-sm { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; @@ -736,11 +740,31 @@ progress { 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) { .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; } } +@media (min-width: 1400px) { + .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { + max-width: 1320px; + } +} :root { --bs-breakpoint-xs: 0; --bs-breakpoint-sm: 576px; @@ -3867,7 +3891,11 @@ textarea.form-control-lg { } .navbar > .container, .navbar > .container-fluid, -.navbar > .container-lg { +.navbar > .container-sm, +.navbar > .container-md, +.navbar > .container-lg, +.navbar > .container-xl, +.navbar > .container-xxl { display: flex; flex-wrap: inherit; align-items: center; diff --git a/src/assets/css/themes/darkly.css b/src/assets/css/themes/darkly.css index a1dd3a0f..3b3a6f2e 100644 --- a/src/assets/css/themes/darkly.css +++ b/src/assets/css/themes/darkly.css @@ -726,7 +726,11 @@ progress { .container, .container-fluid, -.container-lg { +.container-xxl, +.container-xl, +.container-lg, +.container-md, +.container-sm { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; @@ -736,11 +740,31 @@ progress { 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) { .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; } } +@media (min-width: 1400px) { + .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { + max-width: 1320px; + } +} :root { --bs-breakpoint-xs: 0; --bs-breakpoint-sm: 576px; @@ -3867,7 +3891,11 @@ textarea.form-control-lg { } .navbar > .container, .navbar > .container-fluid, -.navbar > .container-lg { +.navbar > .container-sm, +.navbar > .container-md, +.navbar > .container-lg, +.navbar > .container-xl, +.navbar > .container-xxl { display: flex; flex-wrap: inherit; align-items: center; diff --git a/src/assets/css/themes/litely-red.css b/src/assets/css/themes/litely-red.css index d620d189..fbe7cdfb 100644 --- a/src/assets/css/themes/litely-red.css +++ b/src/assets/css/themes/litely-red.css @@ -725,7 +725,11 @@ progress { .container, .container-fluid, -.container-lg { +.container-xxl, +.container-xl, +.container-lg, +.container-md, +.container-sm { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; @@ -735,11 +739,31 @@ progress { 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) { .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; } } +@media (min-width: 1400px) { + .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { + max-width: 1320px; + } +} :root { --bs-breakpoint-xs: 0; --bs-breakpoint-sm: 576px; @@ -3866,7 +3890,11 @@ textarea.form-control-lg { } .navbar > .container, .navbar > .container-fluid, -.navbar > .container-lg { +.navbar > .container-sm, +.navbar > .container-md, +.navbar > .container-lg, +.navbar > .container-xl, +.navbar > .container-xxl { display: flex; flex-wrap: inherit; align-items: center; diff --git a/src/assets/css/themes/litely.css b/src/assets/css/themes/litely.css index 388b2674..801319a3 100644 --- a/src/assets/css/themes/litely.css +++ b/src/assets/css/themes/litely.css @@ -725,7 +725,11 @@ progress { .container, .container-fluid, -.container-lg { +.container-xxl, +.container-xl, +.container-lg, +.container-md, +.container-sm { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; @@ -735,11 +739,31 @@ progress { 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) { .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; } } +@media (min-width: 1400px) { + .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { + max-width: 1320px; + } +} :root { --bs-breakpoint-xs: 0; --bs-breakpoint-sm: 576px; @@ -3866,7 +3890,11 @@ textarea.form-control-lg { } .navbar > .container, .navbar > .container-fluid, -.navbar > .container-lg { +.navbar > .container-sm, +.navbar > .container-md, +.navbar > .container-lg, +.navbar > .container-xl, +.navbar > .container-xxl { display: flex; flex-wrap: inherit; align-items: center; diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 11cfb6c6..5c017189 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -79,256 +79,246 @@ export class Navbar extends Component { const siteView = this.props.siteRes?.site_view; const person = UserService.Instance.myUserInfo?.local_user_view.person; return ( - + ); } diff --git a/src/shared/components/common/pictrs-image.tsx b/src/shared/components/common/pictrs-image.tsx index 31fb1229..9c14aefc 100644 --- a/src/shared/components/common/pictrs-image.tsx +++ b/src/shared/components/common/pictrs-image.tsx @@ -39,7 +39,7 @@ export class PictrsImage extends Component { "img-expanded slight-radius": !this.props.thumbnail && !this.props.icon, "img-blur": this.props.thumbnail && this.props.nsfw, - "rounded-circle img-cover img-icon me-2": this.props.icon, + "img-cover img-icon me-1": this.props.icon, "ms-2 mb-0 rounded-circle img-cover avatar-overlay": this.props.iconOverlay, "avatar-pushup": this.props.pushup, diff --git a/src/shared/components/common/vote-buttons.tsx b/src/shared/components/common/vote-buttons.tsx index 259d2161..372a3293 100644 --- a/src/shared/components/common/vote-buttons.tsx +++ b/src/shared/components/common/vote-buttons.tsx @@ -174,7 +174,7 @@ export class VoteButtons extends Component { render() { return ( -
+
diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 7fa942af..5ef1a87d 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -387,7 +387,7 @@ export class Home extends Component { /> {site_setup && (
-
+
{tagline && (
{
{this.mobileView}
{this.posts}
-
diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 382f5650..45857a0d 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -4,6 +4,7 @@ import { Component, InfernoKeyboardEvent, InfernoMouseEvent, + InfernoNode, linkEvent, } from "inferno"; import { @@ -13,6 +14,7 @@ import { Instance, ListingType, } from "lemmy-js-client"; +import deepEqual from "lodash.isequal"; import { I18NextService } from "../../services"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; @@ -55,6 +57,7 @@ export class SiteForm extends Component { initSiteForm(): EditSite { const site = this.props.siteRes.site_view.site; const ls = this.props.siteRes.site_view.local_site; + return { name: site.name, sidebar: site.sidebar, @@ -619,6 +622,19 @@ export class SiteForm extends Component { ); } + componentDidUpdate( + prevProps: Readonly<{ children?: InfernoNode } & SiteFormProps> + ) { + if ( + !( + deepEqual(prevProps.allowedInstances, this.props.allowedInstances) || + deepEqual(prevProps.blockedInstances, this.props.blockedInstances) + ) + ) { + this.setState({ siteForm: this.initSiteForm() }); + } + } + federatedInstanceSelect(key: InstanceKey) { const id = `create_site_${key}`; const value = this.state.instance_select[key]; diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 622e9312..afd88184 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -692,6 +692,8 @@ export class Profile extends Component< > {I18NextService.i18n.t("cancel")} +
+