added verified badge to profile (#1710)
* added verified badge to profile * added verified to schema * made verified optional * generated missing migration * add if exists Co-authored-by: Jamie <ijamespine@me.com>
This commit is contained in:
+5
-1
@@ -1,4 +1,5 @@
|
||||
import { ArrowRightIcon } from "@heroicons/react/outline";
|
||||
import { BadgeCheckIcon } from "@heroicons/react/solid";
|
||||
import { GetServerSidePropsContext } from "next";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
@@ -33,7 +34,6 @@ export default function User(props: inferSSRProps<typeof getServerSideProps>) {
|
||||
delete query.user; // So it doesn't display in the Link (and make tests fail)
|
||||
|
||||
const nameOrUsername = user.name || user.username || "";
|
||||
|
||||
const [evtsToVerify, setEvtsToVerify] = useState<EvtsToVerify>({});
|
||||
|
||||
return (
|
||||
@@ -56,6 +56,9 @@ export default function User(props: inferSSRProps<typeof getServerSideProps>) {
|
||||
/>
|
||||
<h1 className="mb-1 text-3xl font-bold font-cal text-neutral-900 dark:text-white">
|
||||
{nameOrUsername}
|
||||
{user.verified && (
|
||||
<BadgeCheckIcon className="inline w-6 h-6 -mt-1 text-blue-500 dark:text-white" />
|
||||
)}
|
||||
</h1>
|
||||
<p className="text-neutral-500 dark:text-white">{user.bio}</p>
|
||||
</div>
|
||||
@@ -139,6 +142,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||
theme: true,
|
||||
plan: true,
|
||||
away: true,
|
||||
verified: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `smartContractAddress` on the `EventType` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "EventType" DROP COLUMN IF EXISTS "smartContractAddress";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "verified" BOOLEAN DEFAULT false;
|
||||
@@ -141,6 +141,7 @@ model User {
|
||||
destinationCalendar DestinationCalendar?
|
||||
away Boolean @default(false)
|
||||
metadata Json?
|
||||
verified Boolean? @default(false)
|
||||
|
||||
@@map(name: "users")
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ export const _UserModel = z.object({
|
||||
brandColor: z.string(),
|
||||
away: z.boolean(),
|
||||
metadata: jsonSchema,
|
||||
verified: z.boolean().nullish(),
|
||||
});
|
||||
|
||||
export interface CompleteUser extends z.infer<typeof _UserModel> {
|
||||
|
||||
Reference in New Issue
Block a user