|
6 | 6 | SocialMediaLinks,
|
7 | 7 | } from "../../data/types";
|
8 | 8 | import {
|
| 9 | + CaretDown, |
9 | 10 | FacebookLogo,
|
10 | 11 | InstagramLogo,
|
11 | 12 | LinkedinLogo,
|
@@ -48,66 +49,72 @@ export const ProfileHeader: React.FC<{
|
48 | 49 | }
|
49 | 50 | };
|
50 | 51 | return (
|
51 |
| - <div className="flex flex-row justify-between flex-wrap"> |
52 |
| - <div className="flex flex-col md:flex-row gap-6"> |
53 |
| - <span> |
54 |
| - {profile ? ( |
55 |
| - <img |
56 |
| - className="rounded-md" |
57 |
| - src={profile} |
58 |
| - height={"100px"} |
59 |
| - width={"100px"} |
60 |
| - alt="MP Headshot" |
61 |
| - /> |
62 |
| - ) : ( |
63 |
| - <UserCircle size={100} /> |
64 |
| - )} |
65 |
| - </span> |
66 |
| - <div className="lg:w-2/3"> |
67 |
| - <h2 className="font-bold mb-2">{name}</h2> |
| 52 | + <div className="flex flex-col overflow-x-hidden"> |
| 53 | + <div className="flex flex-row justify-between flex-wrap"> |
| 54 | + <div className="flex flex-col md:flex-row gap-6"> |
68 | 55 | <span>
|
69 |
| - <p className="font-light text-sm mb-2">{bio}</p> |
70 |
| - <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> |
| 56 | + {profile ? ( |
| 57 | + <img |
| 58 | + className="rounded-md" |
| 59 | + src={profile} |
| 60 | + height={"100px"} |
| 61 | + width={"100px"} |
| 62 | + alt="MP Headshot" |
| 63 | + /> |
| 64 | + ) : ( |
| 65 | + <UserCircle size={100} /> |
78 | 66 | )}
|
79 | 67 | </span>
|
| 68 | + <div className="lg:w-2/3"> |
| 69 | + <h2 className="font-bold mb-2">{name}</h2> |
| 70 | + <span> |
| 71 | + <p className="font-light text-sm mb-2">{bio}</p> |
| 72 | + <p className="font-light text-sm italic">{constituency}</p> |
| 73 | + {contact && ( |
| 74 | + <p> |
| 75 | + <span className="font-bold text-sm">Contact details: </span> |
| 76 | + <span className="font-light text-sm italic hover:cursor-text"> |
| 77 | + {contact} |
| 78 | + </span> |
| 79 | + </p> |
| 80 | + )} |
| 81 | + </span> |
| 82 | + </div> |
80 | 83 | </div>
|
81 |
| - </div> |
82 |
| - <div className="flex flex-col justify-end h-full w-full gap-4 md:justify-between"> |
83 |
| - <span className="flex flex-row gap-2 font-extralight text-sm italic justify-end"> |
84 |
| - {Object.keys(socials) |
85 |
| - .filter((site) => socials[site as keyof SocialMediaLinks] !== "") |
86 |
| - .map((site: string) => { |
87 |
| - const link = socials[site as keyof SocialMediaLinks]; |
88 |
| - return ( |
89 |
| - <a href={link} key={`${name}-${site}-link`}> |
90 |
| - {getLogo(site)} |
91 |
| - </a> |
92 |
| - ); |
| 84 | + <div className="flex flex-col justify-end h-full w-full gap-4 md:justify-between"> |
| 85 | + <span className="flex flex-row gap-2 font-extralight text-sm italic justify-end"> |
| 86 | + {Object.keys(socials) |
| 87 | + .filter((site) => socials[site as keyof SocialMediaLinks] !== "") |
| 88 | + .map((site: string) => { |
| 89 | + const link = socials[site as keyof SocialMediaLinks]; |
| 90 | + return ( |
| 91 | + <a href={link} key={`${name}-${site}-link`}> |
| 92 | + {getLogo(site)} |
| 93 | + </a> |
| 94 | + ); |
| 95 | + })} |
| 96 | + </span> |
| 97 | + <div className="flex flex-row flex-wrap gap-1 justify-end"> |
| 98 | + {Object.keys(policyInterests).map((policyType) => { |
| 99 | + const policy = policyInterests[policyType]; |
| 100 | + if (policy.source) { |
| 101 | + return ( |
| 102 | + <PolicyBadge |
| 103 | + key={`${policyType}-badge`} |
| 104 | + policyName={policyType as keyof PolicyInterests} |
| 105 | + positive={policy.positive} |
| 106 | + /> |
| 107 | + ); |
| 108 | + } |
| 109 | + return <div key={`${policyType}-badge`} className="hidden"></div>; |
93 | 110 | })}
|
94 |
| - </span> |
95 |
| - <div className="flex flex-row flex-wrap gap-1 justify-end"> |
96 |
| - {Object.keys(policyInterests).map((policyType) => { |
97 |
| - const policy = policyInterests[policyType]; |
98 |
| - if (policy.source) { |
99 |
| - return ( |
100 |
| - <PolicyBadge |
101 |
| - key={`${policyType}-badge`} |
102 |
| - policyName={policyType as keyof PolicyInterests} |
103 |
| - positive={policy.positive} |
104 |
| - /> |
105 |
| - ); |
106 |
| - } |
107 |
| - return <div key={`${policyType}-badge`} className="hidden"></div>; |
108 |
| - })} |
| 111 | + </div> |
109 | 112 | </div>
|
110 | 113 | </div>
|
| 114 | + <div className="w-full flex justify-center mt-4"> |
| 115 | + <p className="text-xs font-light italic pr-4">expand for more info</p> |
| 116 | + <CaretDown size={16} /> |
| 117 | + </div> |
111 | 118 | </div>
|
112 | 119 | );
|
113 | 120 | };
|
|
0 commit comments