Skip to content

Commit

Permalink
Set work experience dynamically based on start year
Browse files Browse the repository at this point in the history
  • Loading branch information
PardhuMadipalli committed Oct 6, 2024
1 parent 5ce1c56 commit 6f2e0ba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
12 changes: 12 additions & 0 deletions src/commons/helpers.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

export function replacePlaceHolders(text, placeholdersMap) {
for (let [key, value] of placeholdersMap) {
console.log(key, value, text)
text = text.replace(key, value)
}
return text
}

export function capitalizeFirstLetter(str) {
return str[0].toUpperCase() + str.slice(1);
}
22 changes: 9 additions & 13 deletions src/components/FooterSticky.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ import FooterIcons from './FooterIcons';

function Copyright() {
return (
<>
<Typography variant="body2">
{'Copyright © '}
{/* </Typography>
<Typography variant="body1"> */}
<Link color="inherit" href="/" sx={{fontWeight: 'bold'}} underline="hover">
Pardhu Madipalli
</Link>{' '}
{/* </Typography>
<Typography variant="body2"> */}
{new Date().getFullYear()}
</Typography>
</>
<Typography variant="body2" fontSize='0.8rem'>
{'Copyright © '}

<Link color="inherit" href="/" sx={{fontWeight: 'bold'}} underline="hover">
Pardhu Madipalli
</Link>{' '}

{new Date().getFullYear()}
</Typography>
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/content/homepage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ data:
mainItems:
- key: software
title: Software Engineering
subtitle: Five years experience
subtitle: Number_of_years years experience
text:
- Working as a cloud full stack developer for more than 4 years. Over this time, I have worked on very diverse areas including web server technologies, cloud infrastructure and applications, and, UI.
- Working as a cloud full stack developer for more than Number_of_years years. Over this time, I have worked on very diverse areas including web server technologies, cloud infrastructure and applications, and, UI.
- I've made contributions to several projects using technologies such as NodeJS, docker, and maven in my free time. I also have a very fair understanding of data science by working on multiple college projects.
link: "/work"
linkTitle: Work Profile
Expand Down
1 change: 1 addition & 0 deletions src/content/volunteering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data:
- |
Anybody can enter a url into our site and verify if it is blocked by any ISP in India.
imageUrl: /vol/software-developer.png
# imageUrl: /vol/software.png
- position: Teacher, Volunteer recruiter
org:
name: eVidyaloka
Expand Down
10 changes: 8 additions & 2 deletions src/pages/homePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "@mui/material/styles";
import {WorkOutline as WorkIcon, VolunteerActivismOutlined as VolunteerIcon} from "@mui/icons-material";
import {fetchDataAndUpdateItems} from "../commons/commons";
import {capitalizeFirstLetter, replacePlaceHolders} from "../commons/helpers";
// import { green, purple, grey } from '@mui/material/colors';

const StyledBox = styled(Grid)(({ theme }) => ({
Expand Down Expand Up @@ -97,6 +98,9 @@ const itemIconMap = {
}

const HomePage = () => {
const placeHoldersMap = new Map()
placeHoldersMap.set('Number_of_years',
numberInWords[new Date().getFullYear() - new Date(2018, 6, 25).getFullYear()])
const [data, setData] = React.useState()
React.useEffect(fetchDataAndUpdateItems(homePageFile, setData), [])
return (
Expand All @@ -107,10 +111,11 @@ const HomePage = () => {
data.mainItems.map((item, i) =>
<IntroductionComp key={i}
title={item.title}
subtitle={item.subtitle}
subtitle={capitalizeFirstLetter(replacePlaceHolders(item.subtitle, placeHoldersMap))}
linkName={item.linkTitle}
linkUrl={item.link}
text={item.text}
text={item.text.map(line => replacePlaceHolders(line, placeHoldersMap))}
// text={item.text}
icon={itemIconMap[item.key]} />
)
}
Expand Down Expand Up @@ -143,4 +148,5 @@ const HomePage = () => {
)
}

const numberInWords = ['', 'one', 'Two', 'Three', 'Four', 'Five', 'six', 'seven', 'eight', 'nine']
export default HomePage

0 comments on commit 6f2e0ba

Please sign in to comment.