mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 13:51:13 +00:00
Merge branch 'main' into fallback-image
This commit is contained in:
commit
5ea42422a0
4 changed files with 16 additions and 2 deletions
|
@ -105,6 +105,7 @@ export async function createSsrHtml(
|
||||||
-moz-filter: blur(10px);
|
-moz-filter: blur(10px);
|
||||||
-o-filter: blur(10px);
|
-o-filter: blur(10px);
|
||||||
-ms-filter: blur(10px);
|
-ms-filter: blur(10px);
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import "./styles.scss";
|
||||||
import { Theme } from "./theme";
|
import { Theme } from "./theme";
|
||||||
import AnonymousGuard from "../common/anonymous-guard";
|
import AnonymousGuard from "../common/anonymous-guard";
|
||||||
import AdultConsentModal from "../common/adult-consent-modal";
|
import AdultConsentModal from "../common/adult-consent-modal";
|
||||||
|
import { destroyTippy, setupTippy } from "../../tippy";
|
||||||
|
|
||||||
function handleJumpToContent(event) {
|
function handleJumpToContent(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -23,6 +24,14 @@ export default class App extends Component<any, any> {
|
||||||
private isoData: IsoDataOptionalSite = setIsoData(this.context);
|
private isoData: IsoDataOptionalSite = setIsoData(this.context);
|
||||||
private readonly rootRef = createRef<HTMLDivElement>();
|
private readonly rootRef = createRef<HTMLDivElement>();
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
setupTippy(this.rootRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
destroyTippy();
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const siteRes = this.isoData.site_res;
|
const siteRes = this.isoData.site_res;
|
||||||
const siteView = siteRes?.site_view;
|
const siteView = siteRes?.site_view;
|
||||||
|
|
|
@ -96,6 +96,7 @@ function handleAdultConsent(i: AdultConsentModal) {
|
||||||
function handleAdultConsentGoBack(i: AdultConsentModal) {
|
function handleAdultConsentGoBack(i: AdultConsentModal) {
|
||||||
i.setState({ redirectCountdown: 5 });
|
i.setState({ redirectCountdown: 5 });
|
||||||
|
|
||||||
|
clearInterval(i.redirectTimeout);
|
||||||
i.redirectTimeout = setInterval(() => {
|
i.redirectTimeout = setInterval(() => {
|
||||||
i.setState(prev => ({
|
i.setState(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
|
|
|
@ -103,7 +103,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
private readonly isoData: IsoDataOptionalSite = setIsoData(this.context);
|
private readonly isoData: IsoDataOptionalSite = setIsoData(this.context);
|
||||||
state: PostListingState = {
|
state: PostListingState = {
|
||||||
showEdit: false,
|
showEdit: false,
|
||||||
imageExpanded: !!this.isoData.site_res?.site_view.site.content_warning,
|
imageExpanded: false,
|
||||||
viewSource: false,
|
viewSource: false,
|
||||||
showAdvanced: false,
|
showAdvanced: false,
|
||||||
showBody: false,
|
showBody: false,
|
||||||
|
@ -135,7 +135,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
if (UserService.Instance.myUserInfo) {
|
if (
|
||||||
|
UserService.Instance.myUserInfo &&
|
||||||
|
!this.isoData.showAdultConsentModal
|
||||||
|
) {
|
||||||
const { auto_expand, blur_nsfw } =
|
const { auto_expand, blur_nsfw } =
|
||||||
UserService.Instance.myUserInfo.local_user_view.local_user;
|
UserService.Instance.myUserInfo.local_user_view.local_user;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in a new issue