Trying to fix site loading errors. #104

This commit is contained in:
Dessalines 2020-12-05 20:26:01 -06:00
parent 1b8fe6f6e6
commit 3278576927
2 changed files with 48 additions and 42 deletions

View file

@ -165,7 +165,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
// TODO class active corresponding to current page
navbar() {
let user = UserService.Instance.user;
let user = this.props.site.my_user;
return (
<nav class="navbar navbar-expand-lg navbar-light shadow-sm p-0 px-3">
<div class="container">

View file

@ -521,6 +521,7 @@ export function isPostType(
}
export function toast(text: string, background: string = 'success') {
if (isBrowser()) {
let backgroundColor = `var(--${background})`;
Toastify({
text: text,
@ -528,6 +529,7 @@ export function toast(text: string, background: string = 'success') {
gravity: 'bottom',
position: 'left',
}).showToast();
}
}
export function pictrsDeleteToast(
@ -535,6 +537,7 @@ export function pictrsDeleteToast(
deletePictureText: string,
deleteUrl: string
) {
if (isBrowser()) {
let backgroundColor = `var(--light)`;
let toast = Toastify({
text: clickToDeleteText,
@ -551,6 +554,7 @@ export function pictrsDeleteToast(
},
close: true,
}).showToast();
}
}
interface NotifyInfo {
@ -561,6 +565,7 @@ interface NotifyInfo {
}
export function messageToastify(info: NotifyInfo, router: any) {
if (isBrowser()) {
let htmlBody = info.body ? md.render(info.body) : '';
let backgroundColor = `var(--light)`;
@ -580,6 +585,7 @@ export function messageToastify(info: NotifyInfo, router: any) {
}
},
}).showToast();
}
}
export function notifyPost(post: Post, router: any) {