Skip to content

Commit

Permalink
Merge pull request #305 from crisgarner/main
Browse files Browse the repository at this point in the history
feat: fixes and improvements
  • Loading branch information
crisgarner authored Sep 5, 2024
2 parents 03d3953 + edc0cd4 commit bac35e0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ProjectAvatarWithName = ({

return (
<Component className="flex flex-1 items-center gap-4" href={`/projects/${id}`} tabIndex={-1}>
<ProjectAvatar profileId={projects?.[0]?.recipient} rounded="full" size="sm" />
<ProjectAvatar rounded="full" size="sm" url={metadata.data?.bannerImageUrl} />

<div>
<div className="font-bold uppercase">{projects?.[0]?.name}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { type ComponentProps } from "react";
import { type Address } from "viem";

import { Avatar } from "~/components/ui/Avatar";
import { useProfileWithMetadata } from "~/hooks/useProfile";

export interface IProjectAvatarProps extends ComponentProps<typeof Avatar> {
profileId?: Address;
profileId?: string;
url?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const Projects = (): JSX.Element => {

<div className="mb-4 flex justify-between">
<Heading as="h3" size="3xl">
Projects
Beaches
</Heading>

<div>
Expand Down
6 changes: 2 additions & 4 deletions packages/interface/src/hooks/useProfile.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { type Address } from "viem";

import { api } from "~/utils/api";

import type { UseTRPCQueryResult } from "@trpc/react-query/shared";
import type { Attestation } from "~/utils/types";

import { useMetadata } from "./useMetadata";

export function useProfile(id?: Address): UseTRPCQueryResult<Attestation, unknown> {
export function useProfile(id?: string): UseTRPCQueryResult<Attestation, unknown> {
return api.profile.get.useQuery({ id: String(id) }, { enabled: Boolean(id) });
}

export function useProfileWithMetadata(
id?: Address,
id?: string,
): UseTRPCQueryResult<{ profileImageUrl: string; bannerImageUrl: string }, unknown> {
const profile = useProfile(id);

Expand Down
4 changes: 2 additions & 2 deletions packages/interface/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SignupPage = (): JSX.Element => {
</Heading>

<Heading as="h2" className="max-w-screen-lg text-center" size="4xl">
{config.roundId.toUpperCase()}
By MUQA
</Heading>

<p className="flex max-w-screen-md gap-2 text-center text-xl dark:text-gray-400">
Expand All @@ -51,7 +51,7 @@ const SignupPage = (): JSX.Element => {

{isConnected && isRegistered && appState === EAppState.VOTING && (
<Button size="auto" variant="primary">
<Link href="/projects">View projects</Link>
<Link href="/projects">View beaches</Link>
</Button>
)}

Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/server/api/routers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const profileRouter = createTRPCRouter({
get: publicProcedure.input(z.object({ id: z.string() })).query(async ({ input }) =>
fetchAttestations([eas.schemas.metadata], {
where: {
recipient: { in: [input.id] },
id: { in: [input.id] },
...createDataFilter("type", "bytes32", "profile"),
},
}).then(([attestation]) => {
Expand Down

0 comments on commit bac35e0

Please sign in to comment.