From d952cd81020cbcf02e5ba902d439ff96fa2294be Mon Sep 17 00:00:00 2001 From: tusharshah21 Date: Mon, 9 Feb 2026 12:17:24 +0000 Subject: [PATCH] frontend for twitter implemented --- frontend/.astro/settings.json | 2 +- .../action-buttons/CreateProfileDialog.tsx | 18 ++++++++++++++ .../action-buttons/EditProfileDialog.tsx | 24 ++++++++++++++++++- .../components/profiles/list/ProfileCard.tsx | 3 +++ .../components/profiles/list/ProfilesList.tsx | 2 ++ .../profiles/profile-page/ProfileActions.tsx | 3 +++ .../profiles/profile-page/ProfileHeader.tsx | 16 +++++++++++++ .../profiles/profile-page/ProfileMain.tsx | 2 ++ frontend/src/components/ui/XIcon.tsx | 16 +++++++++++++ .../src/lib/constants/profileConstants.ts | 5 +++- frontend/src/lib/types/api.d.ts | 2 ++ frontend/src/lib/types/profiles.d.ts | 2 ++ 12 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/ui/XIcon.tsx diff --git a/frontend/.astro/settings.json b/frontend/.astro/settings.json index 2e8ce89..af96ba4 100644 --- a/frontend/.astro/settings.json +++ b/frontend/.astro/settings.json @@ -1,6 +1,6 @@ { "_variables": { - "lastUpdateCheck": 1761559074026 + "lastUpdateCheck": 1770638442880 }, "eslint.validate": [ "javascript", diff --git a/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx b/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx index d69d4f1..56db5fa 100644 --- a/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx +++ b/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx @@ -30,6 +30,7 @@ const formSchema = z.object({ name: z.string().min(2, { message: "Name must be at least 2 characters." }), description: z.string().optional(), githubLogin: z.string().optional(), + twitterHandle: z.string().optional(), }); type FormValues = z.infer; @@ -50,6 +51,7 @@ export function CreateProfileButton() { name: values.name, description: values.description || "", github_login: values.githubLogin || "", + twitter_handle: values.twitterHandle || "", }, }); await queryClient.invalidateQueries({ queryKey: ["profiles"] }); @@ -120,6 +122,22 @@ export function CreateProfileButton() { )} /> + ( + + Twitter/X Handle + +
+ @ + +
+
+ +
+ )} + />
)} + {twitterHandle && ( +
+ + + @{twitterHandle} + +
+ )} diff --git a/frontend/src/components/profiles/profile-page/ProfileMain.tsx b/frontend/src/components/profiles/profile-page/ProfileMain.tsx index 33975db..e926d68 100644 --- a/frontend/src/components/profiles/profile-page/ProfileMain.tsx +++ b/frontend/src/components/profiles/profile-page/ProfileMain.tsx @@ -24,6 +24,7 @@ export function ProfileMain({ address }: { address: string }) { name={profile?.name} description={profile?.description} githubLogin={profile?.github_login} + twitterHandle={profile?.twitter_handle} />
diff --git a/frontend/src/components/ui/XIcon.tsx b/frontend/src/components/ui/XIcon.tsx new file mode 100644 index 0000000..4c09068 --- /dev/null +++ b/frontend/src/components/ui/XIcon.tsx @@ -0,0 +1,16 @@ +interface XIconProps { + className?: string; +} + +export function XIcon({ className = "h-4 w-4" }: XIconProps) { + return ( + + + + ); +} diff --git a/frontend/src/lib/constants/profileConstants.ts b/frontend/src/lib/constants/profileConstants.ts index 7a97c26..5c3b73b 100644 --- a/frontend/src/lib/constants/profileConstants.ts +++ b/frontend/src/lib/constants/profileConstants.ts @@ -6,6 +6,7 @@ export const PROFILES: Profile[] = [ name: "Alice Developer", description: "Full-stack developer passionate about Web3 and Rust", githubLogin: "alice-dev", + twitterHandle: "alice_dev", attestationCount: 5, attestations: [ { @@ -33,6 +34,7 @@ export const PROFILES: Profile[] = [ name: "Bob Builder", description: "Smart contract developer and DeFi enthusiast", githubLogin: "bob-builder", + twitterHandle: "bob_builder", attestationCount: 3, attestations: [ { @@ -53,7 +55,8 @@ export const PROFILES: Profile[] = [ address: "0x5555...7777", name: "", description: "", - githubLogin: undefined, + githubLogin: undefined, + twitterHandle: undefined, attestationCount: 2, attestations: [ { diff --git a/frontend/src/lib/types/api.d.ts b/frontend/src/lib/types/api.d.ts index b8c914c..9a211fa 100644 --- a/frontend/src/lib/types/api.d.ts +++ b/frontend/src/lib/types/api.d.ts @@ -3,6 +3,7 @@ export type CreateProfileInput = { description?: string; avatar_url?: string; github_login?: string; + twitter_handle?: string; }; export type UpdateProfileInput = { @@ -10,6 +11,7 @@ export type UpdateProfileInput = { description?: string; avatar_url?: string; github_login?: string; + twitter_handle?: string; }; export type UpdateProfileResponse = unknown; diff --git a/frontend/src/lib/types/profiles.d.ts b/frontend/src/lib/types/profiles.d.ts index a369af8..e6e1439 100644 --- a/frontend/src/lib/types/profiles.d.ts +++ b/frontend/src/lib/types/profiles.d.ts @@ -10,6 +10,7 @@ export type Profile = { name: string; description: string; githubLogin?: string; + twitterHandle?: string; attestationCount: number; attestations: ProfileAttestation[]; }; @@ -20,6 +21,7 @@ export type ProfileFromAPI = { description?: string; avatar_url?: string; github_login?: string; + twitter_handle?: string; created_at?: string; updated_at?: string; }; \ No newline at end of file