Skip to content

Commit

Permalink
Merge pull request #1 from shawkyebrahim2514/Development
Browse files Browse the repository at this point in the history
Accepting the new updates in Sanity and frontend implementations
  • Loading branch information
shawkyebrahim2514 authored Feb 11, 2024
2 parents a58a80d + b3535fa commit 1c93402
Show file tree
Hide file tree
Showing 107 changed files with 1,231 additions and 1,033 deletions.
22 changes: 11 additions & 11 deletions react-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions react-frontend/src/APIs/ExternalResource/index.ts

This file was deleted.

20 changes: 20 additions & 0 deletions react-frontend/src/APIs/Sanity/about.ts
Original file line number Diff line number Diff line change
@@ -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,
}
19 changes: 0 additions & 19 deletions react-frontend/src/APIs/Sanity/certificates.ts

This file was deleted.

3 changes: 2 additions & 1 deletion react-frontend/src/APIs/Sanity/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
19 changes: 11 additions & 8 deletions react-frontend/src/APIs/Sanity/contacts.ts
Original file line number Diff line number Diff line change
@@ -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,
}
25 changes: 25 additions & 0 deletions react-frontend/src/APIs/Sanity/education.ts
Original file line number Diff line number Diff line change
@@ -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,
}
17 changes: 0 additions & 17 deletions react-frontend/src/APIs/Sanity/educationCourses.ts

This file was deleted.

34 changes: 34 additions & 0 deletions react-frontend/src/APIs/Sanity/experience.ts
Original file line number Diff line number Diff line change
@@ -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,
}
13 changes: 7 additions & 6 deletions react-frontend/src/APIs/Sanity/index.ts
Original file line number Diff line number Diff line change
@@ -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';
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';
20 changes: 0 additions & 20 deletions react-frontend/src/APIs/Sanity/internships.ts

This file was deleted.

12 changes: 12 additions & 0 deletions react-frontend/src/APIs/Sanity/navbar.ts
Original file line number Diff line number Diff line change
@@ -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,
}
24 changes: 13 additions & 11 deletions react-frontend/src/APIs/Sanity/projects.ts
Original file line number Diff line number Diff line change
@@ -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,
}
21 changes: 13 additions & 8 deletions react-frontend/src/APIs/Sanity/skills.ts
Original file line number Diff line number Diff line change
@@ -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,
}
15 changes: 7 additions & 8 deletions react-frontend/src/APIs/index.ts
Original file line number Diff line number Diff line change
@@ -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';
9 changes: 0 additions & 9 deletions react-frontend/src/Texts/about.ts

This file was deleted.

4 changes: 0 additions & 4 deletions react-frontend/src/Texts/contacts.ts

This file was deleted.

11 changes: 0 additions & 11 deletions react-frontend/src/Texts/education.ts

This file was deleted.

10 changes: 0 additions & 10 deletions react-frontend/src/Texts/experience.ts

This file was deleted.

Loading

0 comments on commit 1c93402

Please sign in to comment.