Skip to content

Commit 434140f

Browse files
authored
Merge pull request #2 from afsaa/dev
Dev updates
2 parents 5a79839 + be9c7b1 commit 434140f

37 files changed

+965
-220
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"eslint-plugin-prettier": "^4.0.0",
2222
"graphql": "^16.6.0",
2323
"markdown-to-jsx": "^7.1.7",
24-
"next": "latest",
24+
"next": "^13.5.3",
2525
"prettier": "^2.5.1",
2626
"react": "^18.0.2",
2727
"react-dom": "^18.0.2",

src/components/ExperiencePreview/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import { useRouter } from 'next/router';
33
import Markdown from 'markdown-to-jsx';
44
import Button from '@/ui/button';
5+
import { useTranslations } from '../../hooks';
56

67
interface IExperiencePreview {
78
heading: string;
@@ -10,19 +11,25 @@ interface IExperiencePreview {
1011

1112
const ExperiencePreview = ({ heading, description }: IExperiencePreview) => {
1213
const router = useRouter();
14+
const translationsResponse = useTranslations('ExperiencePreview');
15+
const [labels, setLabels] = useState(async () => {
16+
await translationsResponse.then((data) => {
17+
setLabels(data);
18+
});
19+
});
1320

1421
return (
15-
<section className="m-0 h-auto flex flex-col items-center">
22+
<section className="w-full md:w-1/2 lg:w-2/3 p-0 md:pr-10 flex flex-col items-center justify-evenly">
1623
<article className="w-full flex flex-col items-center justify-between">
1724
<div className="flex items-center justify-center">
18-
<h2 className="text-3xl text-carrara font-montserrat font-bold">{heading}</h2>
25+
<h2 className="text-center text-3xl text-carrara font-montserrat font-bold">{heading}</h2>
1926
</div>
2027
<div className="mt-5 flex items-center justify-center">
2128
<Markdown className="font-cabin text-lg text-justify indent-8">{description || ''}</Markdown>
2229
</div>
2330
</article>
2431
<div className="my-5 flex items-center justify-center">
25-
<Button primary text="See more" onClick={() => router.push('/exp-and-projects')} />
32+
<Button primary text={labels['seeMore']} onClick={() => router.push('/exp-and-projects')} />
2633
</div>
2734
</section>
2835
);

src/components/ExperiencesCard/index.tsx

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
import Experience from './../Experience';
2-
import React from 'react';
2+
import React, { useState } from 'react';
33
import Button from '@/ui/button';
44
import { Experience as ExpGenerated } from '../../generated/graphql';
5+
import Link from 'next/link';
6+
import { useTranslations } from '../../hooks';
7+
8+
type experienceCardProps = {
9+
cvUrl?: string;
10+
experiences: ExpGenerated[];
11+
};
12+
13+
const ExperiencesCard = ({ cvUrl, experiences }: experienceCardProps) => {
14+
const translationsResponse = useTranslations('ExperiencesCard');
15+
const [labels, setLabels] = useState(async () => {
16+
await translationsResponse.then((data) => {
17+
setLabels(data);
18+
});
19+
});
520

6-
const ExperiencesCard = ({ experiences }: { experiences: ExpGenerated[] }) => {
721
return (
8-
<div className="w-auto md:w-96 h-auto p-4 border border-stone-600 rounded-xl flex flex-col justify-between justify-self-center bg-black/50">
9-
<>
10-
<h2 className="font-montserrat font-bold text-carrara">Work</h2>
11-
{experiences.map((experience) => {
12-
return <Experience {...experience} />;
13-
})}
14-
<div className="mt-4">
15-
<Button primary size="full" text="Download CV" />
16-
</div>
17-
</>
22+
<div className="w-full md:w-1/2 lg:w-1/3 flex items-center justify-center">
23+
<div className="w-auto md:w-96 h-auto p-4 border border-stone-600 rounded-xl flex flex-col justify-between justify-self-center bg-black/50">
24+
<>
25+
<h2 className="font-montserrat font-bold text-carrara">{labels['work']}</h2>
26+
{experiences.map((experience) => {
27+
return <Experience {...experience} />;
28+
})}
29+
<div className="mt-4">
30+
{cvUrl?.length > 0 && (
31+
<Link href={cvUrl} target="_blank">
32+
<Button primary size="full" text={labels['downloadCV']} />
33+
</Link>
34+
)}
35+
</div>
36+
</>
37+
</div>
1838
</div>
1939
);
2040
};

src/components/Footer/index.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
2+
import { useTranslations } from '../../hooks';
23
import NavItem, { INavItem } from '../Navbar/partials/NavItem';
34

45
const Footer = ({ navItems }: { navItems?: INavItem[] }) => {
6+
const translationsResponse = useTranslations('Footer');
7+
const [labels, setLabels] = useState(async () => {
8+
await translationsResponse.then((data) => {
9+
setLabels(data);
10+
});
11+
});
12+
513
return (
6-
<div className="mt-10 p-5 md:p-20 flex flex-col md:flex-row justify-between bg-black shadow-xl">
14+
<div className="mt-10 p-5 md:px-11 md:py-16 flex flex-col md:flex-row justify-between bg-black shadow-xl">
715
<div className="flex flex-col md:flex-row">
816
{navItems?.map(({ sys, title, pathname }) => (
917
<NavItem key={sys?.id} title={title} pathname={pathname} />
1018
))}
1119
</div>
1220
<div className="flex items-center justify-center md:justify-start my-5 md:my-0">
13-
<p className="font-cabin text-center md:text-left text-carrara/50"> &copy; 2023 Andres Saa. All rights reserved.</p>
21+
<p className="font-cabin text-center md:text-left text-carrara/50"> &copy; 2023 Andres Saa. {labels['allRightsReserved']}.</p>
1422
</div>
1523
</div>
1624
);

src/components/Hero/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type HeroProps = {
66

77
const Hero = ({ error, onError, render }: HeroProps) => {
88
return (
9-
<section className="m-0 md:my-4 px-10 py-5 md:py-10 flex flex-wrap items-center justify-around md:flex-nowrap">
9+
<section className="my-4 md:my-10 px-10 py-5 md:py-10 flex flex-wrap">
1010
{error && onError()}
1111
{render && render()}
1212
</section>

src/components/Navbar/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useState } from 'react';
2-
import { GiHamburgerMenu } from 'react-icons/gi';
32
import Link from 'next/link';
43
import NavItem, { INavItem } from './partials/NavItem';
54
import Icon from '@/ui/icon';
@@ -12,7 +11,7 @@ const Navbar = ({ navItems }: { navItems?: INavItem[] }) => {
1211
};
1312

1413
return (
15-
<nav className="mb-10 p-5 md:p-20 relative md:static flex items-center justify-between bg-black shadow-xl">
14+
<nav className="mb-10 p-5 md:px-11 md:py-16 relative md:static flex items-center justify-between bg-black shadow-xl">
1615
<Link href="/" legacyBehavior>
1716
<a className="font-montserrat font-semibold text-2xl text-carrara">AFSAA</a>
1817
</Link>
@@ -22,7 +21,7 @@ const Navbar = ({ navItems }: { navItems?: INavItem[] }) => {
2221
))}
2322
</div>
2423
<div className="md:hidden cursor-pointer" onClick={() => handleToggleMenu()}>
25-
<Icon className="text-carrara" icon={<GiHamburgerMenu />} fontSize="25px" color="" />
24+
<Icon className="text-carrara" icon="GiHamburgerMenu" fontSize="25px" color="" />
2625
</div>
2726
</nav>
2827
);

src/components/Navbar/partials/NavItem.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import React from 'react';
22
import Link from 'next/link';
33
import { Sys } from '../../../generated/graphql';
4+
import { useRouter } from 'next/router';
45

56
export type INavItem = { sys?: Sys; pathname?: string; query?: string; title?: string };
67

78
const NavItem = ({ pathname, query = '', title }: INavItem) => {
9+
const router = useRouter();
10+
811
return (
9-
<li className="transition-all mx-2 p-2 list-none no-underline rounded-md font-montserrat font-medium text-lg text-carrara hover:bg-primary-light/50 hover:drop-shadow-lg">
12+
<li
13+
className={`transition-all mx-2 p-2 list-none no-underline font-montserrat font-medium text-lg text-carrara ${
14+
pathname === router.route ? 'border-b-2 border-primary-light hover:drop-shadow-lg' : ''
15+
} hover:border-b-2 border-primary-light hover:drop-shadow-lg`}
16+
>
1017
<Link className="h-full" href={{ pathname, query }}>
1118
{title}
1219
</Link>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import { Project } from '../../generated/graphql';
3+
import Icon from '../../ui/icon';
4+
import Link from 'next/link';
5+
6+
interface ProjectCardProps extends Project {}
7+
8+
const ProjectCard = ({ title, description, technologies, image, url }: ProjectCardProps): JSX.Element => {
9+
return (
10+
<Link href={url} target="_blank">
11+
<div className="max-w-md border border-stone-600 rounded-xl bg-black/50 shadow-md overflow-hidden hover:opacity-80 focus:opacity-80">
12+
<img src={image?.url || 'https://via.placeholder.com/400x250'} alt={title} className="w-full h-48 object-fill" />
13+
<div className="p-4">
14+
<h3 className="mb-2 font-montserrat font-bold text-xl">{title}</h3>
15+
<p className="mb-4 font-cabin text-carrara/50 whitespace-normal">{description}</p>
16+
<div className="flex flex-wrap">
17+
{technologies.map((technology) => (
18+
<span key={technology} className="mr-2 mb-2 py-1 px-2 rounded-full bg-primary-light text-mirage font-cabin font-medium text-sm">
19+
{technology}
20+
</span>
21+
))}
22+
</div>
23+
<div className="mt-2">
24+
<p className="flex items-center gap-2 text-white font-cabin">
25+
<Icon icon="BiLink" fontSize="20px" color="white" />
26+
{url}
27+
</p>
28+
</div>
29+
</div>
30+
</div>
31+
</Link>
32+
);
33+
};
34+
35+
export default ProjectCard;

src/components/Skill/index.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import React, { useState } from 'react';
2+
import { Skill } from '../../generated/graphql';
3+
import { useTranslations } from '../../hooks';
4+
import SkillItem from './partials/SkillItem';
5+
6+
interface ISkill {
7+
skills: Skill[];
8+
hasHardSkills?: boolean;
9+
hasSoftSkills?: boolean;
10+
hasOtherSkills?: boolean;
11+
}
12+
13+
const SkillComponent = ({ skills, hasHardSkills, hasSoftSkills, hasOtherSkills }: ISkill): JSX.Element => {
14+
const translationsResponse = useTranslations('Skill');
15+
const [labels, setLabels] = useState(async () => {
16+
await translationsResponse.then((data) => {
17+
setLabels(data);
18+
});
19+
});
20+
21+
return (
22+
<>
23+
{hasHardSkills && (
24+
<div>
25+
<h2 className="text-2xl font-montserrat">{labels['hardSkillsHeading']}</h2>
26+
<div className="my-5 flex items-center justify-around md:justify-start flex-wrap gap-10">
27+
{skills.map((skill) => {
28+
return <SkillItem type="hard" name={skill.technology} />;
29+
})}
30+
</div>
31+
</div>
32+
)}
33+
{hasSoftSkills && (
34+
<div>
35+
<h2 className="text-2xl font-montserrat">{labels['softSkillsHeading']}</h2>
36+
<div className="my-5 flex md:flex-row flex-col items-center justify-start gap-10 font-cabin">
37+
{skills.map((skill) => {
38+
return <SkillItem type="soft" name={skill.technology} />;
39+
})}
40+
</div>
41+
</div>
42+
)}
43+
{hasOtherSkills && (
44+
<div>
45+
<h2 className="text-2xl font-montserrat"> {labels['otherSkillsHeading']}</h2>
46+
<div className="my-5 flex md:flex-row flex-col items-center justify-start gap-10 font-cabin">
47+
{skills.map((skill) => {
48+
return <SkillItem type="other" name={skill.technology} />;
49+
})}
50+
</div>
51+
</div>
52+
)}
53+
</>
54+
);
55+
};
56+
57+
export default SkillComponent;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from 'react';
2+
import Icon from '@/ui/icon';
3+
4+
interface ISkillItem {
5+
type: 'hard' | 'soft' | 'other';
6+
name: string;
7+
}
8+
9+
const SkillItem = ({ type, name }: ISkillItem): JSX.Element => {
10+
const hasSoftOrOtherSkill: boolean = type === 'soft' || type === 'other';
11+
12+
return (
13+
<>
14+
{type === 'hard' && (
15+
<span className="flex flex-col items-center font-cabin">
16+
<Icon className="mb-2 text-carrara" icon={`Si${name}`} fontSize="50px" color="" />
17+
{name}
18+
</span>
19+
)}
20+
{hasSoftOrOtherSkill && (
21+
<div className="my-5 flex md:flex-row flex-col items-center justify-start gap-10 font-cabin">
22+
<p>{name}</p>
23+
</div>
24+
)}
25+
</>
26+
);
27+
};
28+
29+
export default SkillItem;

0 commit comments

Comments
 (0)