Skip to content

Commit ed270f0

Browse files
committed
change color theme based on page
1 parent 434953f commit ed270f0

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

components/Avatar.jsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
import Image from 'next/image';
22
import { faLinkedin } from '@fortawesome/free-brands-svg-icons';
33
import FontAwesomeLink from './FontAwesomeLink';
4+
import { PageIdentifiers } from '../utils/flags';
45

56
const PROFILE_CONTAINER = 'flex flex-col items-center m-10';
67

7-
const Avatar = ({ name, linkedin, position, pfp, classes, prevRole, profileContainerClasses = '' }) => {
8+
const Avatar = ({ name, linkedin, position, pfp, classes, prevRole, profileContainerClasses = '', teamIdentifier }) => {
89
const img = 'https:' + pfp.fields.file.url;
10+
11+
const colorTheme =
12+
teamIdentifier === PageIdentifiers.INTERNAL_LEVEL_CONTAINER
13+
? 'text-[#00D3A9]'
14+
: teamIdentifier === PageIdentifiers.EXECUTIVE_LEVEL_CONTAINER
15+
? 'text-[#7055FD]'
16+
: '';
17+
918
return (
1019
<div className={`${PROFILE_CONTAINER} ${profileContainerClasses}`}>
1120
<div className={`w-28 h-28 sm:w-48 sm:h-48 rounded-full relative overflow-hidden`}>
1221
<Image src={img} alt={name} layout="fill" objectFit="contain" unoptimized={true} />
1322
</div>
14-
<h2 className={`text-[#7055FD] text-xs sm:text-base font-semibold mt-3 ${classes}`}>{name}</h2>
15-
<h2 className={`text-[#7055FD] text-xs sm:text-base font-medium mb-2 ${classes}`}>{position}</h2>
23+
<h2 className={`${colorTheme} text-xs sm:text-base font-semibold mt-3 ${classes}`}>{name}</h2>
24+
<h2 className={`${colorTheme} text-xs sm:text-base font-medium mb-2 ${classes}`}>{position}</h2>
1625
{prevRole && (
1726
<h2
18-
className={`text-[#7055FD] w-28 text-center text-xs sm:text-base hidden sm:block font-medium mb-2 ${classes}`}
27+
className={`${colorTheme} w-28 text-center text-xs sm:text-base hidden sm:block font-medium mb-2 ${classes}`}
1928
>
2029
Previously: {prevRole}
2130
</h2>
2231
)}
23-
{linkedin && <FontAwesomeLink username={linkedin} icon={faLinkedin} className={`${classes} fill-black `} />}
32+
{linkedin && (
33+
<FontAwesomeLink colorTheme={colorTheme} username={linkedin} icon={faLinkedin} className={`${classes}`} />
34+
)}
2435
</div>
2536
);
2637
};

components/FontAwesomeLink.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
22

3-
const FontAwesomeLink = ({ username, icon, className }) => {
4-
const defaultClasses = 'h-6 w-6 text-[#7055FD] hover:text-[#8A76FF] transition-all duration-300 cursor-pointer';
3+
const FontAwesomeLink = ({ username, colorTheme, icon, className }) => {
4+
const defaultClasses = 'size-6 transition-all duration-300 cursor-pointer';
55
return (
66
<a target="_blank" href={`https://linkedin.com/in/${username}`} rel="noopener noreferrer">
7-
<FontAwesomeIcon className={`${defaultClasses} ${className}`} icon={icon} />
7+
<FontAwesomeIcon className={`${colorTheme} hover:size-7 ${defaultClasses} ${className}`} icon={icon} />
88
</a>
99
);
1010
};

components/InternalTeam.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
44
import { Tabs, TabsHeader, TabsBody, Tab, TabPanel } from '@material-tailwind/react';
55
import Heading from './Heading';
66
import { UnderlineTypes } from '../utils/underlineType';
7+
import { PageIdentifiers } from '../utils/flags';
78

89
const positionToGroupMap = {
910
'Jr VP Marketing': 'Marketing',
@@ -48,19 +49,19 @@ const InternalTeam = () => {
4849
return (
4950
<>
5051
<div className="mb-12 flex justify-center gap-3">
51-
<Heading distanceFromTop={11} underlineType={UnderlineTypes.PURPLE_SHORT_UNDERLINE}>
52+
<Heading distanceFromTop={11} underlineType={UnderlineTypes.GREEN_SHORT_UNDERLINE}>
5253
Internal{' '}
5354
</Heading>
5455
<span className="text-5xl font-semibold">Team</span>
5556
</div>
5657
{groups.length > 0 && (
57-
<Tabs value={activeTab} className="">
58+
<Tabs value={activeTab}>
5859
<TabsHeader className="overflow-x-auto whitespace-nowrap scrollbar-hide w-full flex flex-row">
5960
{groups.map((group) => (
6061
<Tab key={group} value={group} onClick={() => setActiveTab(group)}>
6162
<div
62-
className={`rounded-full p-2 px-4 font-medium hover:bg-[#7559fc] hover:text-white transition-all duration-200
63-
${activeTab === group ? 'bg-[#7559fc] text-white' : 'text-black'}
63+
className={`rounded-full p-2 px-6 font-medium hover:bg-[#00D3A9] hover:text-white transition-all duration-200
64+
${activeTab === group ? 'bg-[#00D3A9] text-white' : 'text-black'}
6465
`}
6566
>
6667
{group}
@@ -71,7 +72,10 @@ const InternalTeam = () => {
7172
<TabsBody>
7273
{groups.map((group) => (
7374
<TabPanel key={group} value={group}>
74-
<Team executives={executives.filter((exec) => exec.group === group)} />
75+
<Team
76+
teamIdentifier={PageIdentifiers.INTERNAL_LEVEL_CONTAINER}
77+
teamMembers={executives.filter((exec) => exec.group === group)}
78+
/>
7579
</TabPanel>
7680
))}
7781
</TabsBody>

components/Team.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Avatar from './Avatar';
22

3-
const Team = ({ executives }) => {
4-
const EXECUTIVE_LEVEL_CONTAINER = 'flex flex-row flex-wrap justify-center w-full';
3+
const Team = ({ teamMembers, teamIdentifier }) => {
4+
const TEAM_CONTAINER = 'flex flex-row flex-wrap justify-center w-full';
55

66
return (
7-
<div className={EXECUTIVE_LEVEL_CONTAINER}>
8-
{executives.map((exec) => (
9-
<Avatar key={exec.name} {...exec} />
7+
<div className={TEAM_CONTAINER}>
8+
{teamMembers.map((member) => (
9+
<Avatar teamIdentifier={teamIdentifier} key={member.name} {...member} />
1010
))}
1111
</div>
1212
);

components/TechnicalTeam.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
44
import { Tabs, TabsHeader, TabsBody, Tab, TabPanel } from '@material-tailwind/react';
55
import Heading from './Heading';
66
import { UnderlineTypes } from '../utils/underlineType';
7+
import { PageIdentifiers } from '../utils/flags';
78

89
const TechnicalTeam = () => {
910
const [executives, setExecutives] = useState([]);
@@ -51,7 +52,10 @@ const TechnicalTeam = () => {
5152
<TabsBody>
5253
{positions.map((position) => (
5354
<TabPanel key={position} value={position}>
54-
<Team executives={executives.filter((exec) => exec.position === position)} />
55+
<Team
56+
teamIdentifier={PageIdentifiers.EXECUTIVE_LEVEL_CONTAINER}
57+
teamMembers={executives.filter((exec) => exec.position === position)}
58+
/>
5559
</TabPanel>
5660
))}
5761
</TabsBody>

utils/flags.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
export const underConstruction = process.env.NEXT_PUBLIC_CONSTRUCTION_FLAG === 'false';
2+
3+
export const PageIdentifiers = {
4+
EXECUTIVE_LEVEL_CONTAINER: 'EXECUTIVE_LEVEL_CONTAINER',
5+
INTERNAL_LEVEL_CONTAINER: 'INTERNAL_LEVEL_CONTAINER',
6+
};

0 commit comments

Comments
 (0)