Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fixes and improvements #305

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading