diff --git a/react-frontend/package-lock.json b/react-frontend/package-lock.json index fc2f16a..5245980 100644 --- a/react-frontend/package-lock.json +++ b/react-frontend/package-lock.json @@ -3402,13 +3402,13 @@ "integrity": "sha512-2/U3GXA6YiPYQDLGwtGlnNgKYBSwCFIHf8Y9LUY5VATHdtbLlU0Y1R3QoBnT0aB4qv/BEiVVsj7LJXoQCgJ2vA==" }, "node_modules/@sanity/client": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@sanity/client/-/client-6.10.0.tgz", - "integrity": "sha512-TavtxGB6NWjro2BTGXSkzXNMKFZbS2il1ItV3IdRvO0luLqS31eIz37+5X4CmCC8hGFe6fDoCjnH/iJ81vKM7g==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/@sanity/client/-/client-6.12.4.tgz", + "integrity": "sha512-eDBnKwKdFIiMeRZ5xPaKUOs+gsw6P4Bq+Bj7cZ9xuaLXMTsOSlB5h9TsPW5vAYRMbm4coVYUvhqm9TMwSi0F2Q==", "dependencies": { "@sanity/eventsource": "^5.0.0", "@vercel/stega": "0.1.0", - "get-it": "^8.4.4", + "get-it": "^8.4.6", "rxjs": "^7.0.0" }, "engines": { @@ -8285,9 +8285,9 @@ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -8672,13 +8672,13 @@ } }, "node_modules/get-it": { - "version": "8.4.4", - "resolved": "https://registry.npmjs.org/get-it/-/get-it-8.4.4.tgz", - "integrity": "sha512-Pu3pnJfnYuLEhwJgMlFqk19ugvtazzTxh7rg8wATaBL4c5Fy4ahM5B+bGdluiNSNYYK89F5vSa+N3sTa/qqtlg==", + "version": "8.4.6", + "resolved": "https://registry.npmjs.org/get-it/-/get-it-8.4.6.tgz", + "integrity": "sha512-omefjdbyRb2rRt0tnrZlbeWx9oZJm66o88K8JlYn13xELn+0+d6mJZOQHrJAdC3vxeJ4t/NHa4wh7Wlh+nvEJA==", "dependencies": { "debug": "^4.3.4", "decompress-response": "^7.0.0", - "follow-redirects": "^1.15.2", + "follow-redirects": "^1.15.4", "into-stream": "^6.0.0", "is-plain-object": "^5.0.0", "is-retry-allowed": "^2.2.0", diff --git a/react-frontend/src/APIs/ExternalResource/index.ts b/react-frontend/src/APIs/ExternalResource/index.ts deleted file mode 100644 index 7e4a32b..0000000 --- a/react-frontend/src/APIs/ExternalResource/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -const getGithubImageURL = (username: string) => `https://avatars.githubusercontent.com/${username}`; - -const getResumeURL = () => `https://drive.google.com/drive/folders/1yJmOWWaRQpM32haB8CeXCOzK0_WC6o59`; - -export { getGithubImageURL, getResumeURL }; diff --git a/react-frontend/src/APIs/Sanity/about.ts b/react-frontend/src/APIs/Sanity/about.ts new file mode 100644 index 0000000..a070d6f --- /dev/null +++ b/react-frontend/src/APIs/Sanity/about.ts @@ -0,0 +1,20 @@ +import { SanityAboutPage } from '../../Types'; +import sanityClient from './client'; + +const getAboutPage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "aboutPage"][0] { + salutation, + personImage, + seeking, + personName, + description, + resume, + position + }`; + const result: SanityAboutPage = await sanityClient.fetch(query); + return result; +}; + +export { + getAboutPage, +} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/certificates.ts b/react-frontend/src/APIs/Sanity/certificates.ts deleted file mode 100644 index b8c5c02..0000000 --- a/react-frontend/src/APIs/Sanity/certificates.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SanityCertificate } from '../../Types'; -import sanityClient from './client'; - -const getCertificates = async () => { - const query = `*[_type == "certificates"]{ - title, - subTitle, - rank, - description, - date, - link, - }`; - const result: SanityCertificate[] = await sanityClient.fetch(query); - return result; -}; - -export { - getCertificates, -} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/client.ts b/react-frontend/src/APIs/Sanity/client.ts index 9a663a4..b5896f8 100644 --- a/react-frontend/src/APIs/Sanity/client.ts +++ b/react-frontend/src/APIs/Sanity/client.ts @@ -3,7 +3,8 @@ import { createClient } from '@sanity/client' const sanityClient = createClient({ projectId: 'h48br789', dataset: 'production', - useCdn: true + useCdn: true, + apiVersion: '2022-03-07', }) export default sanityClient; \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/contacts.ts b/react-frontend/src/APIs/Sanity/contacts.ts index ed32fbe..9e78951 100644 --- a/react-frontend/src/APIs/Sanity/contacts.ts +++ b/react-frontend/src/APIs/Sanity/contacts.ts @@ -1,16 +1,19 @@ -import { SanityContact } from '../../Types'; +import { SanityContactsPage } from '../../Types'; import sanityClient from './client'; -const getContacts = async () => { - const query = `*[_type == "contacts"]{ - "imgSrc": icon.asset->url, - link, - name +const getContactsPage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "contactsPage"][0] { + title, + "contacts": contacts[] -> { + "imgSrc": icon.asset->url, + link, + name + } }`; - const result: SanityContact[] = await sanityClient.fetch(query); + const result: SanityContactsPage = await sanityClient.fetch(query); return result; }; export { - getContacts, + getContactsPage, } \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/education.ts b/react-frontend/src/APIs/Sanity/education.ts new file mode 100644 index 0000000..797584d --- /dev/null +++ b/react-frontend/src/APIs/Sanity/education.ts @@ -0,0 +1,25 @@ +import { SanityEducationPage } from '../../Types'; +import sanityClient from './client'; + +const getEducationPage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "educationPage"][0] { + title, + education { + name, + description, + location, + date, + courses[] -> { + name, + description, + "technologies": technologies[]->name + } + } + }`; + const result: SanityEducationPage = await sanityClient.fetch(query); + return result; +}; + +export { + getEducationPage, +} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/educationCourses.ts b/react-frontend/src/APIs/Sanity/educationCourses.ts deleted file mode 100644 index be09a46..0000000 --- a/react-frontend/src/APIs/Sanity/educationCourses.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { SanityEducationCourse } from '../../Types'; -import sanityClient from './client'; - -const getEducationCourses = async () => { - const query = `*[_type == "collegeCourses"]{ - name, - rank, - description, - "technologies": technologies[]->name - }`; - const result: SanityEducationCourse[] = await sanityClient.fetch(query); - return result; -}; - -export { - getEducationCourses, -} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/experience.ts b/react-frontend/src/APIs/Sanity/experience.ts new file mode 100644 index 0000000..e6c9c20 --- /dev/null +++ b/react-frontend/src/APIs/Sanity/experience.ts @@ -0,0 +1,34 @@ +import { SanityExperiencePage } from '../../Types'; +import sanityClient from './client'; + +const getExperiencePage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "experiencePage"][0] { + internshipsSection { + title, + internships[] -> { + title, + subTitle, + date, + link, + description, + "technologies": technologies[]->name + } + }, + certificatesSection { + title, + certificates[] -> { + title, + subTitle, + description, + date, + link, + } + } + }`; + const result: SanityExperiencePage = await sanityClient.fetch(query); + return result; +}; + +export { + getExperiencePage, +} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/index.ts b/react-frontend/src/APIs/Sanity/index.ts index 7759ad4..4b1ad10 100644 --- a/react-frontend/src/APIs/Sanity/index.ts +++ b/react-frontend/src/APIs/Sanity/index.ts @@ -1,6 +1,7 @@ -export { getContacts } from './contacts'; -export { getCertificates } from './certificates'; -export { getEducationCourses } from './educationCourses'; -export { getInternships } from './internships'; -export { getProjects } from './projects'; -export { getSkills } from './skills'; \ No newline at end of file +export { getContactsPage } from './contacts'; +export { getEducationPage } from './education'; +export { getProjectsPage } from './projects'; +export { getSkillsPage } from './skills'; +export { getAboutPage } from './about'; +export { getExperiencePage } from './experience'; +export { getNavbarData } from './navbar'; \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/internships.ts b/react-frontend/src/APIs/Sanity/internships.ts deleted file mode 100644 index 6561ad9..0000000 --- a/react-frontend/src/APIs/Sanity/internships.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { SanityInternship } from '../../Types'; -import sanityClient from './client'; - -const getInternships = async () => { - const query = `*[_type == "internships"]{ - title, - subTitle, - rank, - date, - link, - description, - "technologies": technologies[]->name - }`; - const result: SanityInternship[] = await sanityClient.fetch(query); - return result; -}; - -export { - getInternships, -} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/navbar.ts b/react-frontend/src/APIs/Sanity/navbar.ts new file mode 100644 index 0000000..7d652e3 --- /dev/null +++ b/react-frontend/src/APIs/Sanity/navbar.ts @@ -0,0 +1,12 @@ +import { SanityNavbarData } from '../../Types'; +import sanityClient from './client'; + +const getNavbarData = async () => { + const query = `*[_type == "portfolio"][0].navbar`; + const result: SanityNavbarData = await sanityClient.fetch(query); + return result; +}; + +export { + getNavbarData, +} \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/projects.ts b/react-frontend/src/APIs/Sanity/projects.ts index f365ca8..8d422c1 100644 --- a/react-frontend/src/APIs/Sanity/projects.ts +++ b/react-frontend/src/APIs/Sanity/projects.ts @@ -1,19 +1,21 @@ -import { SanityProject } from '../../Types'; +import { SanityProjectsPage } from '../../Types'; import sanityClient from './client'; -const getProjects = async () => { - const query = `*[_type == "projects"]{ - name, - rank, - links, - description, - "imgSrc": image.asset->url, - "technologies": technologies[]->name +const getProjectsPage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "projectsPage"][0] { + title, + "projects": projects[] -> { + name, + links, + description, + "imgSrc": image.asset->url, + "technologies": technologies[]->name + } }`; - const result: SanityProject[] = await sanityClient.fetch(query); + const result: SanityProjectsPage = await sanityClient.fetch(query); return result; }; export { - getProjects, + getProjectsPage, } \ No newline at end of file diff --git a/react-frontend/src/APIs/Sanity/skills.ts b/react-frontend/src/APIs/Sanity/skills.ts index 1316147..92c1380 100644 --- a/react-frontend/src/APIs/Sanity/skills.ts +++ b/react-frontend/src/APIs/Sanity/skills.ts @@ -1,16 +1,21 @@ -import { SanitySkill } from '../../Types'; +import { SanitySkillsPage } from '../../Types'; import sanityClient from './client'; -const getSkills = async () => { - const query = `*[_type == "skills" && rank >= 0]{ - "categoryName": category->name, - "iconURL": icon.asset->url, - name, rank +const getSkillsPage = async () => { + const query = `*[_type == "portfolio"][0].pages[_type == "skillsPage"][0] { + title, + "categories": categories[] { + title, + skills[] -> { + "iconURL": icon.asset->url, + name + } + } }`; - const result: SanitySkill[] = await sanityClient.fetch(query); + const result: SanitySkillsPage = await sanityClient.fetch(query); return result; }; export { - getSkills, + getSkillsPage, } \ No newline at end of file diff --git a/react-frontend/src/APIs/index.ts b/react-frontend/src/APIs/index.ts index 13b939e..ba50ca8 100644 --- a/react-frontend/src/APIs/index.ts +++ b/react-frontend/src/APIs/index.ts @@ -1,10 +1,9 @@ -export { getGithubImageURL, getResumeURL } from './ExternalResource'; - export { - getSkills, - getEducationCourses, - getInternships, - getProjects, - getContacts, - getCertificates + getSkillsPage, + getEducationPage, + getProjectsPage, + getContactsPage, + getExperiencePage, + getAboutPage, + getNavbarData } from './Sanity'; \ No newline at end of file diff --git a/react-frontend/src/Texts/about.ts b/react-frontend/src/Texts/about.ts deleted file mode 100644 index b3d4907..0000000 --- a/react-frontend/src/Texts/about.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const aboutPageContent = { - salutation: "As-salamu alaykum!", - name: "I'm Shawky Ebrahim", - seeking: "I'm looking for an internship in", - position: "Software Development", - description: `I can be a valuable asset to your team and contribute to your projects with my skills and enthusiasm. - Please don't hesitate to check out my resume or reach out from the contacts page.`, - resume: "See My Resume", -} \ No newline at end of file diff --git a/react-frontend/src/Texts/contacts.ts b/react-frontend/src/Texts/contacts.ts deleted file mode 100644 index 3f89e24..0000000 --- a/react-frontend/src/Texts/contacts.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const contactsPageContent = { - highlightedTitle: "Get in Touch", - titlePhrase: "How to Reach Me", -} \ No newline at end of file diff --git a/react-frontend/src/Texts/education.ts b/react-frontend/src/Texts/education.ts deleted file mode 100644 index d2a0efa..0000000 --- a/react-frontend/src/Texts/education.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const educationPageContent = { - highlightedTitle: "Education", - titlePhrase: "As a computer science student", - college: { - name: "Faculty of Computers and Artificial Intelligence - Cairo University", - degree: "Bachelor of Science in Computer Science", - gpa: "GPA: 3.74", - fullDate: "From 6/2021 to 8/2025", - location: "Giza, Egypt", - } -} \ No newline at end of file diff --git a/react-frontend/src/Texts/experience.ts b/react-frontend/src/Texts/experience.ts deleted file mode 100644 index 8500725..0000000 --- a/react-frontend/src/Texts/experience.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const experiencePageContent = { - internships: { - highlightedTitle: "Internships & Training", - titlePhrase: "How I Gained Real-World Experience", - }, - certificates: { - highlightedTitle: "Certificates", - titlePhrase: "How I Demonstrated My Excellence", - }, -} \ No newline at end of file diff --git a/react-frontend/src/Texts/index.ts b/react-frontend/src/Texts/index.ts deleted file mode 100644 index 67bbce7..0000000 --- a/react-frontend/src/Texts/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { aboutPageContent } from "./about"; - -export { skillsPageContent } from "./skills"; - -export { educationPageContent } from "./education"; - -export { experiencePageContent } from "./experience"; - -export { projectsPageContent } from "./projects"; - -export { contactsPageContent } from "./contacts"; - -export { navbarContent, pages } from "./navbarContent"; \ No newline at end of file diff --git a/react-frontend/src/Texts/navbarContent.ts b/react-frontend/src/Texts/navbarContent.ts deleted file mode 100644 index c989b17..0000000 --- a/react-frontend/src/Texts/navbarContent.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const navbarContent = { - logoText: "SHAWKY EBRAHIM" -} - -export const pages = ["about", "contact", "home", "projects"]; \ No newline at end of file diff --git a/react-frontend/src/Texts/projects.ts b/react-frontend/src/Texts/projects.ts deleted file mode 100644 index 1387051..0000000 --- a/react-frontend/src/Texts/projects.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const projectsPageContent = { - highlightedTitle: "Projects", - titlePhrase: "What I Built With My Hands and Mind", -} \ No newline at end of file diff --git a/react-frontend/src/Texts/skills.ts b/react-frontend/src/Texts/skills.ts deleted file mode 100644 index 8324030..0000000 --- a/react-frontend/src/Texts/skills.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const skillsPageContent = { - highlightedTitle: "Skills & Tools", - titlePhrase: "What I Know and Can Do", -} \ No newline at end of file diff --git a/react-frontend/src/Types/index.ts b/react-frontend/src/Types/index.ts index 0605a2e..7da0486 100644 --- a/react-frontend/src/Types/index.ts +++ b/react-frontend/src/Types/index.ts @@ -1,21 +1,12 @@ export { - type SanitySkill, - type SanityEducationCourse, - type SanityInternship, - type SanityProject, - type SanityContact, - type TechnologyCategory, - type SanityCertificate + type SanitySkillsPage, + type SanityEducationPage, + type SanityProjectsPage, + type SanityContactsPage, + type CommonTitle, + type SanityExperiencePage, + type SanityAboutPage, + type SanityNavbarData } from './sanity'; -export { type Theme, type Links } from './contexts'; - -export { type TechnologySkill } from './pages/skills'; - -export { type Course } from './pages/education'; - -export { type Internship, type Certificate } from './pages/experience'; - -export { type Project } from './pages/projects'; - -export { type Contact } from './pages/contacts'; \ No newline at end of file +export { type Theme, type Links } from './contexts'; \ No newline at end of file diff --git a/react-frontend/src/Types/pages/contacts.ts b/react-frontend/src/Types/pages/contacts.ts deleted file mode 100644 index 78ab25c..0000000 --- a/react-frontend/src/Types/pages/contacts.ts +++ /dev/null @@ -1 +0,0 @@ -export type { SanityContact as Contact } from "../sanity" \ No newline at end of file diff --git a/react-frontend/src/Types/pages/education.ts b/react-frontend/src/Types/pages/education.ts deleted file mode 100644 index 26753b8..0000000 --- a/react-frontend/src/Types/pages/education.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SanityEducationCourse } from "../sanity"; - -export type Course = Omit; \ No newline at end of file diff --git a/react-frontend/src/Types/pages/experience.ts b/react-frontend/src/Types/pages/experience.ts deleted file mode 100644 index b77970b..0000000 --- a/react-frontend/src/Types/pages/experience.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { SanityInternship, SanityCertificate } from "../sanity"; - -export type Internship = Omit; - -export type Certificate = Omit; \ No newline at end of file diff --git a/react-frontend/src/Types/pages/projects.ts b/react-frontend/src/Types/pages/projects.ts deleted file mode 100644 index 4e83ce8..0000000 --- a/react-frontend/src/Types/pages/projects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SanityProject } from "../sanity"; - -export type Project = Omit; \ No newline at end of file diff --git a/react-frontend/src/Types/pages/skills.ts b/react-frontend/src/Types/pages/skills.ts deleted file mode 100644 index cbc0d50..0000000 --- a/react-frontend/src/Types/pages/skills.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SanitySkill } from "../sanity"; - -export type TechnologySkill = Omit; diff --git a/react-frontend/src/Types/sanity.ts b/react-frontend/src/Types/sanity.ts deleted file mode 100644 index 1c47c3c..0000000 --- a/react-frontend/src/Types/sanity.ts +++ /dev/null @@ -1,55 +0,0 @@ -export type TechnologyCategory = "General" | "Frontend" | "Backend" | "Databases" | "Tools"; - -export type SanitySkill = { - name: string; - rank: number; - categoryName: TechnologyCategory; - iconURL: string; -} - -export type SanityEducationCourse = { - name: string; - rank: number; - description: string; - technologies: string[]; -} - -export type SanityInternship = { - title: string; - subTitle: string; - rank: number; - date: { - from: string; - to: string; - } - link: string; - description: string; - technologies: string[]; -} - -export type SanityProject = { - name: string; // title - rank: number; - links: { - demoLink: string; - projectLink: string; - } - description: string; - imgSrc: string; - technologies: string[]; -} - -export type SanityContact = { - imgSrc: string; - link: string; - name: string; -} - -export type SanityCertificate = { - title : string; - subTitle : string; - rank : number; - description? : string; - date : string; - link : string; -} diff --git a/react-frontend/src/Types/sanity/aboutPage.ts b/react-frontend/src/Types/sanity/aboutPage.ts new file mode 100644 index 0000000..0295b03 --- /dev/null +++ b/react-frontend/src/Types/sanity/aboutPage.ts @@ -0,0 +1,14 @@ +type Resume = { + link: string; + text: string; +} + +export type SanityAboutPage = { + personImage: string; + seeking: string; + personName: string; + description: string; + resume: Resume; + position: string; + salutation: string; +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/common.ts b/react-frontend/src/Types/sanity/common.ts new file mode 100644 index 0000000..d4d6dd0 --- /dev/null +++ b/react-frontend/src/Types/sanity/common.ts @@ -0,0 +1,6 @@ +export type CommonTitle = { + title: { + highlightedText: string; + subText: string; + } +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/contactsPage.ts b/react-frontend/src/Types/sanity/contactsPage.ts new file mode 100644 index 0000000..d7bc26d --- /dev/null +++ b/react-frontend/src/Types/sanity/contactsPage.ts @@ -0,0 +1,11 @@ +import { CommonTitle } from "./common"; + +type Contact = { + imgSrc: string; + link: string; + name: string; +} + +export type SanityContactsPage = CommonTitle & { + contacts: Contact[]; +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/educationPage.ts b/react-frontend/src/Types/sanity/educationPage.ts new file mode 100644 index 0000000..079d65f --- /dev/null +++ b/react-frontend/src/Types/sanity/educationPage.ts @@ -0,0 +1,22 @@ +import { CommonTitle } from "./common"; + +type Date = { + start: string; + end: string; +} + +type Course = { + name: string; + description: string; + technologies: string[]; +} + +export type SanityEducationPage = CommonTitle & { + education: { + name: string; + description: string; + location: string; + date: Date; + courses: Course[]; + } +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/experiencePage.ts b/react-frontend/src/Types/sanity/experiencePage.ts new file mode 100644 index 0000000..5b969e8 --- /dev/null +++ b/react-frontend/src/Types/sanity/experiencePage.ts @@ -0,0 +1,36 @@ +import { CommonTitle } from "./common"; + +type Date = { + from: string; + to: string; +} + +type Internship = { + title: string; + subTitle: string; + date: Date, + link: string; + description: string; + technologies: string[]; +} + +type Certificate = { + title: string; + subTitle: string; + description: string; + date: string; + link: string; +} + +type SanityInternshipsSection = CommonTitle & { + internships: Internship[]; +} + +type SanityCertificatesSection = CommonTitle & { + certificates: Certificate[]; +} + +export type SanityExperiencePage = { + certificatesSection: SanityCertificatesSection; + internshipsSection: SanityInternshipsSection; +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/index.ts b/react-frontend/src/Types/sanity/index.ts new file mode 100644 index 0000000..c58aadd --- /dev/null +++ b/react-frontend/src/Types/sanity/index.ts @@ -0,0 +1,8 @@ +export { type CommonTitle } from './common'; +export { type SanityAboutPage } from './aboutPage'; +export { type SanityContactsPage } from './contactsPage'; +export { type SanityEducationPage } from './educationPage'; +export { type SanityExperiencePage } from './experiencePage'; +export { type SanityProjectsPage } from './projectsPage'; +export { type SanitySkillsPage } from './skillsPage'; +export { type SanityNavbarData } from './navbarData'; \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/navbarData.ts b/react-frontend/src/Types/sanity/navbarData.ts new file mode 100644 index 0000000..87f9fd4 --- /dev/null +++ b/react-frontend/src/Types/sanity/navbarData.ts @@ -0,0 +1,3 @@ +export type SanityNavbarData = { + logo: string; +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/projectsPage.ts b/react-frontend/src/Types/sanity/projectsPage.ts new file mode 100644 index 0000000..fa27be6 --- /dev/null +++ b/react-frontend/src/Types/sanity/projectsPage.ts @@ -0,0 +1,18 @@ +import { CommonTitle } from "./common"; + +type Links = { + demoLink: string; + projectLink: string; +} + +type Project = { + name: string; + links: Links; + description: string; + imgSrc: string; + technologies: string[]; +} + +export type SanityProjectsPage = CommonTitle & { + projects: Project[]; +} \ No newline at end of file diff --git a/react-frontend/src/Types/sanity/skillsPage.ts b/react-frontend/src/Types/sanity/skillsPage.ts new file mode 100644 index 0000000..4fb637e --- /dev/null +++ b/react-frontend/src/Types/sanity/skillsPage.ts @@ -0,0 +1,15 @@ +import { CommonTitle } from "./common"; + +type Skill = { + name: string; + iconURL: string; +} + +type Category = { + title: string; + skills: Skill[]; +} + +export type SanitySkillsPage = CommonTitle & { + categories: Category[]; +} \ No newline at end of file diff --git a/react-frontend/src/components/Icon/index.tsx b/react-frontend/src/components/Icon/index.tsx index 268c514..9ce666a 100644 --- a/react-frontend/src/components/Icon/index.tsx +++ b/react-frontend/src/components/Icon/index.tsx @@ -33,7 +33,7 @@ const motionProperties = { } export default function Icon({ - src = "images/placeholder.png", + src, alt, text, pointer = false, @@ -85,7 +85,7 @@ export default function Icon({ whileTap={motionProperties.whileTap} onClick={onClick} >
- {alt} + {alt}
{text && {text}} diff --git a/react-frontend/src/components/Loader/index.tsx b/react-frontend/src/components/Loader/index.tsx index 890ac15..0ca9d53 100644 --- a/react-frontend/src/components/Loader/index.tsx +++ b/react-frontend/src/components/Loader/index.tsx @@ -22,7 +22,6 @@ export default function Loader() { display: "flex", alignItems: "center", justifyContent: "center", - width: "100%", }), []); return ( diff --git a/react-frontend/src/components/Navbar/Logo.tsx b/react-frontend/src/components/Navbar/Logo.tsx index 46c8fbd..6400598 100644 --- a/react-frontend/src/components/Navbar/Logo.tsx +++ b/react-frontend/src/components/Navbar/Logo.tsx @@ -2,10 +2,9 @@ import { useCallback } from 'react' import { useThemeContext } from '../../contexts/ThemeContext'; import Text from '../Text' import { useNavigationControllerContext } from '../../contexts/NavigationControllerContext'; -import { Links } from '../../Types'; -import { navbarContent } from '../../Texts'; +import { Links, SanityNavbarData } from '../../Types'; -export default function Logo() { +export default function Logo({ logo }: Readonly>) { const { theme } = useThemeContext(); const { setLinks } = useNavigationControllerContext(); const changeLinksHandler = useCallback(() => { @@ -34,7 +33,7 @@ export default function Logo() { - {navbarContent.logoText} + {logo} ) diff --git a/react-frontend/src/components/Navbar/index.tsx b/react-frontend/src/components/Navbar/index.tsx index 2a0d468..f664cfe 100644 --- a/react-frontend/src/components/Navbar/index.tsx +++ b/react-frontend/src/components/Navbar/index.tsx @@ -1,11 +1,15 @@ -import { CSSProperties, useMemo } from 'react' +import { CSSProperties, useEffect, useMemo, useState } from 'react' import { useThemeContext } from '../../contexts/ThemeContext'; import Logo from './Logo' import Links from './Links'; +import { SanityNavbarData } from '../../Types'; +import { getNavbarData } from '../../APIs'; +import Loader from '../Loader'; export default function Navbar() { + const [navbarData, setNavbarData] = useState(null); const { theme } = useThemeContext(); - const outerStyle = useMemo(() : CSSProperties => ({ + const outerStyle = useMemo((): CSSProperties => ({ position: "fixed", padding: "1rem", width: "100%", @@ -16,7 +20,7 @@ export default function Navbar() { ...theme.bluryStyle.main, border: "none" }), [theme]); - const innerStyle = useMemo(() : CSSProperties => ({ + const innerStyle = useMemo((): CSSProperties => ({ display: 'flex', justifyContent: 'space-between', alignItems: 'center', @@ -27,10 +31,16 @@ export default function Navbar() { flexWrap: "wrap", }), []); + useEffect(() => { + getNavbarData().then((data) => { + setNavbarData(data); + }); + }, []); + return (
- + {navbarData ? : }
diff --git a/react-frontend/src/components/ProjectCard/index.tsx b/react-frontend/src/components/ProjectCard/index.tsx index be1b9a1..fbd48d8 100644 --- a/react-frontend/src/components/ProjectCard/index.tsx +++ b/react-frontend/src/components/ProjectCard/index.tsx @@ -41,7 +41,7 @@ export default function ProjectCard({ return (
diff --git a/react-frontend/src/containers/About/Content/Description.tsx b/react-frontend/src/containers/About/Content/Description.tsx index 332b34d..d74bc62 100644 --- a/react-frontend/src/containers/About/Content/Description.tsx +++ b/react-frontend/src/containers/About/Content/Description.tsx @@ -1,8 +1,8 @@ import { memo } from 'react'; import Text from '../../../components/Text'; -import { aboutPageContent } from '../../../Texts'; +import { SanityAboutPage } from '../../../Types'; -function Description() { +function Description({ description }: Readonly>) { return (
- {aboutPageContent.description.split("\n").map((paragraph, index) => ( + {description.split("\n").map((paragraph) => ( diff --git a/react-frontend/src/containers/About/Content/Name.tsx b/react-frontend/src/containers/About/Content/Name.tsx index 915ddf0..ae629e2 100644 --- a/react-frontend/src/containers/About/Content/Name.tsx +++ b/react-frontend/src/containers/About/Content/Name.tsx @@ -1,9 +1,9 @@ import { useThemeContext } from '../../../contexts/ThemeContext'; import Text from '../../../components/Text'; -import { aboutPageContent } from '../../../Texts'; import { memo, useMemo } from 'react'; +import { SanityAboutPage } from '../../../Types'; -function Name() { +function Name({ personName }: Readonly>) { const { theme } = useThemeContext(); const textStyle = useMemo(() => { return { @@ -15,7 +15,7 @@ function Name() { return ( - {aboutPageContent.name} + {personName} ) } diff --git a/react-frontend/src/containers/About/Content/Position.tsx b/react-frontend/src/containers/About/Content/Position.tsx index ae6eeaf..693dc24 100644 --- a/react-frontend/src/containers/About/Content/Position.tsx +++ b/react-frontend/src/containers/About/Content/Position.tsx @@ -1,9 +1,9 @@ import { useThemeContext } from '../../../contexts/ThemeContext'; import Text from '../../../components/Text'; -import { aboutPageContent } from '../../../Texts'; import { memo, useMemo } from 'react'; +import { SanityAboutPage } from '../../../Types'; -function Position() { +function Position({ position }: Readonly>) { const { theme } = useThemeContext(); const textStyle = useMemo(() => { return { @@ -17,7 +17,7 @@ function Position() { return ( - {aboutPageContent.position} + {position} ) } diff --git a/react-frontend/src/containers/About/Content/ResumeButton.tsx b/react-frontend/src/containers/About/Content/ResumeButton.tsx index 88888ef..963a2fa 100644 --- a/react-frontend/src/containers/About/Content/ResumeButton.tsx +++ b/react-frontend/src/containers/About/Content/ResumeButton.tsx @@ -1,18 +1,17 @@ import Button from '../../../components/Button'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFileLines } from '@fortawesome/free-solid-svg-icons'; -import { getResumeURL } from '../../../APIs'; -import { aboutPageContent } from '../../../Texts'; import { memo } from 'react'; +import { SanityAboutPage } from '../../../Types'; -function ResumeButton() { +function ResumeButton({ resume }: Readonly>) { return (