mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 07:36:37 +00:00
Trying to fix site loading errors. #104
This commit is contained in:
parent
1b8fe6f6e6
commit
3278576927
|
@ -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">
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue