Skip to content

Commit 4057444

Browse files
committed
Add profile pic
1 parent c599926 commit 4057444

File tree

7 files changed

+48
-21
lines changed

7 files changed

+48
-21
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
REACT_APP_API_ENDPOINT=https://api.futurelabourmps.com/
2-
REACT_APP_API_COLS=A3:AO70
2+
REACT_APP_API_COLS=A3:AZ70

server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = express();
77
app.use(cors());
88

99
// Configuration for the proxy
10-
const API_SERVICE_URL = "https://api.futurelabourmps.com/A3:AT70";
10+
const API_SERVICE_URL = "https://api.futurelabourmps.com";
1111

1212
app.use(
1313
"/api",

src/components/SearchInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const SearchInput: React.FC = () => {
3030
id="icon"
3131
name="icon"
3232
className="py-2 px-4 pl-11 block w-full border-gray-200 shadow-sm rounded-md text-sm focus:z-10 focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"
33-
placeholder="Search"
33+
placeholder="Search by name or constituency"
3434
onChange={(e) => handleSearchChange(e.currentTarget.value)}
3535
/>
3636
</div>

src/components/content/Accordion.tsx

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

src/components/content/Profile.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
InstagramLogo,
1111
LinkedinLogo,
1212
TwitterLogo,
13+
UserCircle,
1314
} from "@phosphor-icons/react";
1415
import { FormattedContent } from "./FormattedContent";
1516
import { PolicyCard } from "./PolicyCard";
@@ -21,9 +22,10 @@ export const ProfileHeader: React.FC<{
2122
name: string;
2223
bio: string;
2324
constituency: string;
25+
profile?: string;
2426
socials: SocialMediaLinks;
2527
policyInterests: Record<PolicyType, Policy>;
26-
}> = ({ name, bio, constituency, socials, policyInterests }) => {
28+
}> = ({ name, bio, constituency, profile, socials, policyInterests }) => {
2729
const getLogo = (siteType: string) => {
2830
switch (siteType) {
2931
case "facebook":
@@ -38,12 +40,26 @@ export const ProfileHeader: React.FC<{
3840
};
3941
return (
4042
<div className="flex flex-row justify-between flex-wrap">
41-
<div className="lg:w-2/3">
42-
<h2 className="font-bold mb-2">{name}</h2>
43+
<div className="flex flex-col md:flex-row gap-6">
4344
<span>
44-
<p className="font-light text-sm mb-2">{bio}</p>
45-
<p className="font-light text-sm italic">{constituency}</p>
45+
{profile ? (
46+
<img
47+
className="rounded-md"
48+
src={profile}
49+
height={"100px"}
50+
width={"100px"}
51+
/>
52+
) : (
53+
<UserCircle size={100} />
54+
)}
4655
</span>
56+
<div className="lg:w-2/3">
57+
<h2 className="font-bold mb-2">{name}</h2>
58+
<span>
59+
<p className="font-light text-sm mb-2">{bio}</p>
60+
<p className="font-light text-sm italic">{constituency}</p>
61+
</span>
62+
</div>
4763
</div>
4864
<div className="flex flex-col justify-end h-full w-full gap-4 md:justify-between">
4965
<span className="flex flex-row gap-2 font-extralight text-sm italic justify-end">

src/data/test/rawResponse.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ export const values = [
99
"TRUE",
1010
"james",
1111
"SNP",
12-
"4,095",
12+
"4095",
1313
"Yes. Councillor for Glasgow North East",
14-
"Maureen Burke was picked to contest Glasgow North …asgow City Council, representing North East ward.",
14+
"Maureen Burke was picked to contest Glasgow North East at the next election. She is a councillor on Glasgow City Council, representing North East ward.\n\nBorn & bred & lives in Easterhouse in the seat. First worked as packer in tie-factory. Worked for Margaret Curran when she was MSP, MP & Shadow Scottish secretary. - https://twitter.com/tomorrowsmps/status/1651337216784756739",
1515
"https://twitter.com/CllrBurke",
1616
"https://www.facebook.com/profile.php?id=100047615836936",
1717
"",
1818
"",
19-
"Councillor Glasgow City Council, North East Ward",
20-
"(possibly ex) Chair of the Seven Lochs Partnership. \nDirector - Glasgow East Women's Aid (source)",
21-
"Provan Hall Community Management Trust (source) (a 15th Century historical building in Glasgow)",
22-
"Director - Glasgow East Women's Aid (resigned)\nDir…ned)\nDirector - Scottish Events Campus (resigned)",
23-
`Supported Glasgow's Climate Week in 2016. Was Chai…ts for local people and visitors alike." (source)`,
19+
"Councillor Glasgow City Council, North East Ward - <https://labourlist.org/2023/08/our-rolling-list-of-labour-parliamentary-candidate-selections/>",
20+
"(possibly ex) Chair of the Seven Lochs Partnership. \nDirector - Glasgow East Women's Aid - <https://labourlist.org/2023/08/our-rolling-list-of-labour-parliamentary-candidate-selections/>",
21+
"Provan Hall Community Management Trust (a 15th Century historical building in Glasgow) - <https://www.glasgow.gov.uk/councillorsandcommittees/agenda.asp?meetingid=15465>",
22+
"Director - Glasgow East Women's Aid (resigned)|\nDirector - Glasgow East Arts Company (resigned)|\nDirector - Culture and Sport Glasgow CIC (resigned)|\nDirector - Culture and Sport Glasgow (resigned)|\nDirector - Glasgow East Arts Company Ltd (resigned)|\nDirector - Jobs and Business Glasgow (resigned)|\nDirector - Clude Gateway URC (resigned)|\nDirector - Scottish Events Campus (resigned) - <https://find-and-update.company-information.service.gov.uk/officers/PQhWYXthUIbiNIdpZxTXs0hltjM/appointments>",
23+
"Supported Glasgow's Climate Week in 2016. Was Chair of the Seven Lochs Partnership. She said :\"We all have a part to play in tackling the issues of climate change. The Seven Lochs Wetland Park project is a fitting example of what we are doing to make Glasgow a more beautiful, liveable and sustainable city. This will be the jewel in the crown of the region's green spaces, and will bring a host of benefits for local people and visitors alike.\" - <https://glasgow.gov.uk/article/20096/Time-for-action-as-Scotlands-first-national-Climate-Week-gets-underway>",
2424
"Positive",
25-
'Anti-detention centres (from 2015; source) \n"Counc…asylum in Scotland and the wider United Kingdom."',
25+
'Anti-detention centres (from 2015\n"Council therefore calls on the Chief Executive to write to the relevant UK Government to express our strong resolve that Dungavel, and all other UK detention centres, should be closed in favour of a community-based model of assessment for those seeking asylum in Scotland and the wider United Kingdom." - <https://www.glasgow.gov.uk/councillorsandcommittees/agenda.asp?meetingid=13813>',
2626
"Positive",
2727
"",
2828
"",
@@ -36,12 +36,22 @@ export const values = [
3636
"",
3737
"",
3838
"",
39+
"In role as councillor, suggested approving the application of a conversion of townhouses to tourist short stay flats - <https://servicedapartmentnews.com/news/industry-news/glasgow-townhouse-conversion/> ",
3940
"",
4041
"",
4142
"",
43+
4244
"",
45+
"Embroiled in a conflict of interest scandal - <https://www.heraldscotland.com/news/15255963.secret-recording-leads-call-glasgow-labour-councillors-suspended/>",
4346
"",
47+
"TRUE",
48+
"James",
49+
"TRUE",
50+
"Andy",
4451
"",
52+
"https://www.glasgow.gov.uk/media/image/t/d/Maureen_Burke.JPG",
53+
"83%",
54+
"<https://www.electoralcalculus.co.uk/fcgi-bin/calcwork23.py?seat=Glasgow+North+East>",
4555
],
4656
[
4757
"Zubir Ahmed",

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-
43: "profilePic",
58-
44: "winningProbability",
59-
45: "winningProbability",
57+
49: "profilePic",
58+
50: "winningProbability",
59+
51: "winningProbability",
6060
};
6161

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

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

0 commit comments

Comments
 (0)