mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Trying to fix site loading errors. #104
This commit is contained in:
parent
1b8fe6f6e6
commit
3278576927
2 changed files with 48 additions and 42 deletions
|
@ -165,7 +165,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
|
|
||||||
// TODO class active corresponding to current page
|
// TODO class active corresponding to current page
|
||||||
navbar() {
|
navbar() {
|
||||||
let user = UserService.Instance.user;
|
let user = this.props.site.my_user;
|
||||||
return (
|
return (
|
||||||
<nav class="navbar navbar-expand-lg navbar-light shadow-sm p-0 px-3">
|
<nav class="navbar navbar-expand-lg navbar-light shadow-sm p-0 px-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
|
@ -521,6 +521,7 @@ export function isPostType(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toast(text: string, background: string = 'success') {
|
export function toast(text: string, background: string = 'success') {
|
||||||
|
if (isBrowser()) {
|
||||||
let backgroundColor = `var(--${background})`;
|
let backgroundColor = `var(--${background})`;
|
||||||
Toastify({
|
Toastify({
|
||||||
text: text,
|
text: text,
|
||||||
|
@ -528,6 +529,7 @@ export function toast(text: string, background: string = 'success') {
|
||||||
gravity: 'bottom',
|
gravity: 'bottom',
|
||||||
position: 'left',
|
position: 'left',
|
||||||
}).showToast();
|
}).showToast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function pictrsDeleteToast(
|
export function pictrsDeleteToast(
|
||||||
|
@ -535,6 +537,7 @@ export function pictrsDeleteToast(
|
||||||
deletePictureText: string,
|
deletePictureText: string,
|
||||||
deleteUrl: string
|
deleteUrl: string
|
||||||
) {
|
) {
|
||||||
|
if (isBrowser()) {
|
||||||
let backgroundColor = `var(--light)`;
|
let backgroundColor = `var(--light)`;
|
||||||
let toast = Toastify({
|
let toast = Toastify({
|
||||||
text: clickToDeleteText,
|
text: clickToDeleteText,
|
||||||
|
@ -551,6 +554,7 @@ export function pictrsDeleteToast(
|
||||||
},
|
},
|
||||||
close: true,
|
close: true,
|
||||||
}).showToast();
|
}).showToast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NotifyInfo {
|
interface NotifyInfo {
|
||||||
|
@ -561,6 +565,7 @@ interface NotifyInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function messageToastify(info: NotifyInfo, router: any) {
|
export function messageToastify(info: NotifyInfo, router: any) {
|
||||||
|
if (isBrowser()) {
|
||||||
let htmlBody = info.body ? md.render(info.body) : '';
|
let htmlBody = info.body ? md.render(info.body) : '';
|
||||||
let backgroundColor = `var(--light)`;
|
let backgroundColor = `var(--light)`;
|
||||||
|
|
||||||
|
@ -580,6 +585,7 @@ export function messageToastify(info: NotifyInfo, router: any) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}).showToast();
|
}).showToast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function notifyPost(post: Post, router: any) {
|
export function notifyPost(post: Post, router: any) {
|
||||||
|
|
Loading…
Reference in a new issue