Fix up tiny cases where user should not be nullable
This commit is contained in:
parent
a004d3a4bf
commit
c49015bb10
|
@ -62,7 +62,7 @@ export function FeedPromo(props: { hotContracts: Contract[] }) {
|
|||
}
|
||||
|
||||
export default function FeedCreate(props: {
|
||||
user?: User
|
||||
user: User
|
||||
tag?: string
|
||||
placeholder?: string
|
||||
className?: string
|
||||
|
@ -98,7 +98,7 @@ export default function FeedCreate(props: {
|
|||
}}
|
||||
>
|
||||
<div className="relative flex items-start space-x-3">
|
||||
<Avatar username={user?.username} avatarUrl={user?.avatarUrl} noLink />
|
||||
<Avatar username={user.username} avatarUrl={user.avatarUrl} noLink />
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<Row className="justify-between">
|
||||
|
|
|
@ -25,17 +25,15 @@ export function getNavigationOptions(user?: User | null) {
|
|||
]
|
||||
}
|
||||
|
||||
export function ProfileSummary(props: { user: User | undefined }) {
|
||||
export function ProfileSummary(props: { user: User }) {
|
||||
const { user } = props
|
||||
return (
|
||||
<Row className="group avatar items-center gap-4 rounded-md py-3 text-gray-500 group-hover:bg-gray-100 group-hover:text-gray-700">
|
||||
<Avatar avatarUrl={user?.avatarUrl} username={user?.username} noLink />
|
||||
<Row className="group items-center gap-4 rounded-md py-3 text-gray-500 group-hover:bg-gray-100 group-hover:text-gray-700">
|
||||
<Avatar avatarUrl={user.avatarUrl} username={user.username} noLink />
|
||||
|
||||
<div className="truncate text-left">
|
||||
<div>{user?.name}</div>
|
||||
<div className="text-sm">
|
||||
{user ? formatMoney(Math.floor(user.balance)) : ' '}
|
||||
</div>
|
||||
<div>{user.name}</div>
|
||||
<div className="text-sm">{formatMoney(Math.floor(user.balance))}</div>
|
||||
</div>
|
||||
</Row>
|
||||
)
|
||||
|
|
|
@ -31,7 +31,7 @@ const Home = () => {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [router.isReady])
|
||||
|
||||
if (user === null) {
|
||||
if (user == null) {
|
||||
Router.replace('/')
|
||||
return <></>
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ const Home = () => {
|
|||
<Page assertUser="signed-in" suspend={!!contract}>
|
||||
<Col className="items-center">
|
||||
<Col className="w-full max-w-[700px]">
|
||||
<FeedCreate user={user ?? undefined} />
|
||||
<FeedCreate user={user} />
|
||||
<Spacer h={10} />
|
||||
{feed ? (
|
||||
<ActivityFeed
|
||||
|
|
Loading…
Reference in New Issue
Block a user