File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,4 +19,7 @@ export const DEV_CONFIG: EnvConfig = {
1919 measurementId : "G-N6LZ64EMJ2" ,
2020 region : 'us-west1' ,
2121 } ,
22+ adminIds : [
23+ 'ULxLz04VW1V4vbnj5XLwvzCSkYd2' , // Martin
24+ ] ,
2225}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { SimpleCopyTextButton } from 'web/components/buttons/copy-link-button'
1616import { api } from 'web/lib/api'
1717import { buildArray } from 'common/util/array'
1818import { DeleteYourselfButton } from '../profile/delete-yourself'
19+ import { toast } from "react-hot-toast" ;
1920
2021export function MoreOptionsUserButton ( props : { user : User } ) {
2122 const { user } = props
@@ -55,11 +56,22 @@ export function MoreOptionsUserButton(props: { user: User }) {
5556 < Button
5657 color = { 'red' }
5758 size = "xs"
58- onClick = { ( ) => {
59- api ( 'ban-user' , {
60- userId,
61- unban : user . isBannedFromPosting ?? false ,
62- } )
59+ onClick = { async ( ) => {
60+ await toast . promise (
61+ api ( 'ban-user' , {
62+ userId,
63+ unban : user . isBannedFromPosting ?? false ,
64+ } ) ,
65+ {
66+ loading : 'Banning...' ,
67+ success : ( ) => {
68+ return 'User banned!'
69+ } ,
70+ error : ( ) => {
71+ return 'Error banning user'
72+ } ,
73+ }
74+ )
6375 } }
6476 >
6577 { user . isBannedFromPosting ? 'Banned' : 'Ban User' }
Original file line number Diff line number Diff line change @@ -88,11 +88,29 @@ type ActiveUserPageProps = {
8888export default function UserPage ( props : UserPageProps ) {
8989 // console.debug('Starting UserPage in /[username]')
9090 if ( ! props . user ) {
91- return < div > This account has been deleted</ div >
91+ return < LovePage
92+ trackPageView = { 'user page' }
93+ className = { 'relative p-2 sm:pt-0' }
94+ >
95+ < Col className = "items-center justify-center h-full" >
96+ < div className = "text-xl font-semibold text-center mt-8" >
97+ This account has been deleted.
98+ </ div >
99+ </ Col >
100+ </ LovePage >
92101 }
93102
94103 if ( props . user . isBannedFromPosting ) {
95- return < div > This account is banned</ div >
104+ return < LovePage
105+ trackPageView = { 'user page' }
106+ className = { 'relative p-2 sm:pt-0' }
107+ >
108+ < Col className = "items-center justify-center h-full" >
109+ < div className = "text-xl font-semibold text-center mt-8" >
110+ This account has been suspended.
111+ </ div >
112+ </ Col >
113+ </ LovePage >
96114 }
97115
98116 return < UserPageInner { ...props } />
You can’t perform that action at this time.
0 commit comments