Skip to content

Commit f04c703

Browse files
committed
Add contact to profile header
1 parent d1525d0 commit f04c703

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

src/components/content/Accordion.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const Accordion: React.FC<{ mps: MP[] }> = ({ mps }) => {
2424
bio={mp.biography}
2525
policyInterests={mp.policyInterests}
2626
profile={mp.profilePic}
27+
contact={mp.contact}
2728
/>
2829
</label>
2930
<div className="accordion-content">

src/components/content/Profile.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ export const ProfileHeader: React.FC<{
2323
bio: string;
2424
constituency: string;
2525
profile?: string;
26+
contact?: string;
2627
socials: SocialMediaLinks;
2728
policyInterests: Record<PolicyType, Policy>;
28-
}> = ({ name, bio, constituency, profile, socials, policyInterests }) => {
29+
}> = ({
30+
name,
31+
bio,
32+
constituency,
33+
profile,
34+
contact,
35+
socials,
36+
policyInterests,
37+
}) => {
2938
const getLogo = (siteType: string) => {
3039
switch (siteType) {
3140
case "facebook":
@@ -59,6 +68,14 @@ export const ProfileHeader: React.FC<{
5968
<span>
6069
<p className="font-light text-sm mb-2">{bio}</p>
6170
<p className="font-light text-sm italic">{constituency}</p>
71+
{contact && (
72+
<p>
73+
<span className="font-bold text-sm">Contact details: </span>
74+
<span className="font-light text-sm italic hover:cursor-text">
75+
{contact}
76+
</span>
77+
</p>
78+
)}
6279
</span>
6380
</div>
6481
</div>

src/data/utils/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ const mpIdxLookup: Record<number, keyof MP> = {
5454
40: "contact",
5555
41: "educationType",
5656
42: "notes",
57-
49: "profilePic",
58-
50: "winningProbability",
59-
51: "winningProbability",
57+
44: "profilePic",
58+
45: "winningProbability",
59+
46: "winningProbability",
6060
};
6161

6262
const winningLookupIdx: Record<number, keyof WinningProbability> = {
63-
50: "percentage",
64-
51: "source",
63+
45: "percentage",
64+
46: "source",
6565
};
6666

6767
const policyLookupIdx: Record<number, keyof PolicyInterests> = {

0 commit comments

Comments
 (0)