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,
@ -529,12 +530,14 @@ export function toast(text: string, background: string = 'success') {
position: 'left',
}).showToast();
}
}
export function pictrsDeleteToast(
clickToDeleteText: string,
deletePictureText: string,
deleteUrl: string
) {
if (isBrowser()) {
let backgroundColor = `var(--light)`;
let toast = Toastify({
text: clickToDeleteText,
@ -552,6 +555,7 @@ export function pictrsDeleteToast(
close: true,
}).showToast();
}
}
interface NotifyInfo {
name: string;
@ -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)`;
@ -581,6 +586,7 @@ export function messageToastify(info: NotifyInfo, router: any) {
},
}).showToast();
}
}
export function notifyPost(post: Post, router: any) {
let info: NotifyInfo = {