diff --git a/frontend/src/app/components/users/PublicProfile.tsx b/frontend/src/app/components/users/PublicProfile.tsx index 6610fb1..ccefc81 100644 --- a/frontend/src/app/components/users/PublicProfile.tsx +++ b/frontend/src/app/components/users/PublicProfile.tsx @@ -46,7 +46,7 @@ export default function PublicProfile({}) { - + diff --git a/frontend/src/app/components/users/profile/UserHeader.tsx b/frontend/src/app/components/users/profile/UserHeader.tsx index bf5be1f..4b25cfc 100644 --- a/frontend/src/app/components/users/profile/UserHeader.tsx +++ b/frontend/src/app/components/users/profile/UserHeader.tsx @@ -10,12 +10,22 @@ const { Title, Paragraph } = Typography; export default function UserHeader({ user }: { user: User }) { return (
- + <Title style={{ marginBottom: ".25rem" }}> {user?.first_name} {user?.last_name} - - {user?.linkedin_url && } - {user?.twitter_url && } + + {user?.linkedin_url && ( + + )} + {user?.twitter_url && ( + + )} { + if (trustworthiness?.total_score) { + if (trustworthiness?.total_score >= 80) { + return "Excellent"; + } else if (trustworthiness?.total_score >= 60) { + return "Good"; + } else if (trustworthiness?.total_score >= 40) { + return "Fair"; + } else if (trustworthiness?.total_score >= 20) { + return "Poor"; + } else { + return "Very Poor"; + } + } + return "No score yet"; + }, [trustworthiness?.total_score]); return ( <> +
+ + Refresh +
( +
+ {percent} +
+ Score +
+
+ )} /> -
- - - trustworthy score + + {scoreLeaderText} + {hasScore ? ( + + ) : ( + + Seems like you dont have a score yet + + )} diff --git a/frontend/src/redux/reducers/types/commonTypes.ts b/frontend/src/redux/reducers/types/commonTypes.ts index 85afa12..6103784 100644 --- a/frontend/src/redux/reducers/types/commonTypes.ts +++ b/frontend/src/redux/reducers/types/commonTypes.ts @@ -1,3 +1,16 @@ +export interface TrustworthinessDetails { + calculated_on: string; + next_refresh_available: string; + total_score: number; + components: { + payments: number; + claims: number; + background: number; + activity: number; + lifestyle: number; + }; +} + export interface User { id: number; first_name: string; @@ -10,6 +23,7 @@ export interface User { linkedin_url?: string; twitter_url?: string; + trustworthiness?: TrustworthinessDetails; } export interface Premium { diff --git a/pods/serializers.py b/pods/serializers.py index 767a576..6b67df9 100644 --- a/pods/serializers.py +++ b/pods/serializers.py @@ -132,6 +132,8 @@ class Meta: "updated_at", "verified_email", "pods", + "linkedin_url", + "twitter_url", ]