commit 936717a610e52274fe7ab94f62b2982e7a294977
parent aaa5182d36fb9236e8d690d40c652767790bebf3
Author: MTRNord <mtrnord1@gmail.com>
Date: Fri, 21 Jan 2022 14:37:09 +0100
Fix lint error and hide the sections if missing in the event
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/helpers/matrix_client.ts b/helpers/matrix_client.ts
@@ -364,7 +364,7 @@ export default class MatrixClient {
}
// TODO allow filters
- async getTimeline(roomId: string, limit: number, filter: object = { limit: 30, types: ["m.image", "m.image_gallery"] }) {
+ async getTimeline(roomId: string, limit: number, filter: object = { limit: 30, types: ["m.image", "m.image_gallery"] }) {// eslint-disable-line unicorn/no-object-as-default-parameter
if (!this.accessToken) {
console.error("No access token");
return [];
diff --git a/pages/profile/[userid].tsx b/pages/profile/[userid].tsx
@@ -215,29 +215,29 @@ class Profile extends PureComponent<Props, State> {
</div>
</div>
<div className="bg-[#fefefe]/[.95] dark:bg-[#14181E]/[.95] pt-7 w-ull flex flex-col box-border tracking--[.3px] text-gray-900 dark:text-gray-200">
- <div className="px-8">
+ {profile_event?.content["matrixart.profile.description"] ? <div className="px-8">
<div className="mb-8 font-regular text-base leading-[1.22] whitespace-pre-wrap">
{profile_event ? profile_event.content["matrixart.profile.description"] : undefined}
</div>
- </div>
- <div className="px-8">
+ </div> : undefined}
+ {profile_event?.content["matrixart.profile.pronouns"] ? <div className="px-8">
<div className="mb-8 flex items-start justify-between flex-wrap w-full">
<div className="h-11 mb-0 text-xs flex items-center uppercase text-gray-700 dark:text-gray-400">Pronouns</div>
<div className="w-full justify-items-end">{profile_event ? profile_event.content["matrixart.profile.pronouns"] : undefined}</div>
</div>
- </div>
- <div className="px-8">
+ </div> : undefined}
+ {profile_event?.content["matrixart.profile.links"] ? <div className="px-8">
<div className="mb-8 flex items-start justify-between flex-wrap w-full">
<div className="h-11 mb-0 text-xs flex items-center uppercase text-gray-700 dark:text-gray-400">Follow me on</div>
<div className="w-full max-w-[21.5rem] grid gap-4 auto-cols-[2.75rem] auto-rows-[2.75rem] grid-flow-col justify-items-end">{/*TODO Social Icons */}</div>
</div>
- </div>
- <div className="px-8">
+ </div> : undefined}
+ {profile_event?.content["matrixart.profile.biography"] ? <div className="px-8">
<div className="mb-8 font-regular text-base leading-[1.22] whitespace-pre-wrap">
<div className="h-11 mb-0 text-xs flex items-center uppercase text-gray-700 dark:text-gray-400">My Bio</div>
<div className="text-base font-regular">{profile_event ? profile_event.content["matrixart.profile.biography"] : undefined}</div>
</div>
- </div>
+ </div> : undefined}
</div>
</section>
</div>