Skip to content

Commit

Permalink
feat: replace Job with Job2
Browse files Browse the repository at this point in the history
  • Loading branch information
martapanc committed Aug 21, 2023
1 parent 33087f5 commit 6833778
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 21 deletions.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const nextConfig = {
// },

images: {
domains: ['cdn.sanity.io'],
domains: ['cdn.sanity.io', 'res.cloudinary.com'],
remotePatterns: [
{
protocol: 'https',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"graphql": "^16.8.0",
"inquirer-fuzzy-path": "^2.3.0",
"next": "^13.4.9",
"next-cloudinary": "^4.18.0",
"next-sanity": "5.1.0",
"next-themes": "^0.2.1",
"plop": "^3.1.2",
Expand Down
9 changes: 3 additions & 6 deletions src/app/(public)/about/work/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ const queryData = async () => {

const jobs: Job2[] = flattenToArray<Job2>(data.jobs);
return {
jobs2: jobs,
jobs: jobs,
};
};

const AboutPage = async () => {
const { jobs, languages, publications, schools, shortTexts, skills } =
const { languages, publications, schools, shortTexts, skills } =
await getData();

const { jobs2 } = await queryData();
const { jobs } = await queryData();

const softwareDevelopment: ShortText | undefined = shortTexts.find(
(item) => item.name === 'software-development'
Expand All @@ -84,9 +84,6 @@ const AboutPage = async () => {
const iconDimension = 36;
const titleIconDimension = 42;

// eslint-disable-next-line no-console
console.log(jobs2[0]);

return (
<main className='min-h-main'>
<section className='dark:bg-dark bg-white'>
Expand Down
26 changes: 13 additions & 13 deletions src/components/organisms/about-work/WorkExperience.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use client';

import { PortableText } from '@portabletext/react';
import Image from 'next/image';
import { useTheme } from 'next-themes';
import * as React from 'react';
import ReactMarkdown from 'react-markdown';

import { Job } from '@/types/Job';
import { Job2 } from '@/types/Job2';

export interface WorkExperienceProps {
jobs: Job[];
jobs: Job2[];
}

const WorkExperience = ({ jobs }: WorkExperienceProps) => {
Expand All @@ -23,25 +23,25 @@ const WorkExperience = ({ jobs }: WorkExperienceProps) => {
<div>
{jobs.map((job) => (
<div
key={job._id}
key={job.id}
className='mb-4 rounded-md p-4 shadow-md dark:bg-slate-900'
>
{/* Start Job Header - Desktop */}
<div className='hidden border-b-2 border-slate-200 pb-2 md:flex'>
<Image
className='me-3 rounded-sm'
src={job.iconUrl}
alt={job.company}
src={job.icon.url}
alt={job.companyName}
width={60}
height={60}
/>

<div className='flex w-full justify-between'>
<div className='flex flex-col'>
<h4>
{job.company} {job.location && `~`} {job.location}
{job.companyName} {job.location && `~`} {job.location}
</h4>
<h5 className='font-medium'>{job.jobTitle}</h5>
<h5 className='font-medium'>{job.title}</h5>
</div>

<div className='flex flex-col justify-center'>
Expand All @@ -62,19 +62,19 @@ const WorkExperience = ({ jobs }: WorkExperienceProps) => {
<div className='flex'>
<Image
className='me-3 rounded-sm'
src={job.iconUrl}
alt={job.company}
src={job.icon.url}
alt={job.companyName}
width={60}
height={60}
/>

<div className='flex w-full justify-between'>
<div className='flex flex-col'>
<span className='text-sm font-semibold'>
{job.company} {job.location && `~`} {job.location}
{job.companyName} {job.location && `~`} {job.location}
</span>

<span className='text-sm'>{job.jobTitle}</span>
<span className='text-sm'>{job.title}</span>
</div>
</div>
</div>
Expand All @@ -92,7 +92,7 @@ const WorkExperience = ({ jobs }: WorkExperienceProps) => {
{/* Start Job Content */}
<div className='job-content pt-4'>
<div className='skill-description pb-2 text-justify font-light'>
<PortableText value={job.description} />
<ReactMarkdown>{job.description}</ReactMarkdown>
</div>

<div className='mb-2 flex flex-wrap justify-end md:w-full'>
Expand Down
6 changes: 6 additions & 0 deletions src/types/Icon2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Icon2 {
id: string;
name: string;
url: string;
alternativeText?: string;
}
4 changes: 3 additions & 1 deletion src/types/Job2.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Icon2 } from '@/types/Icon2';

export interface Job2 {
id: string;
title: string;
companyName: string;
icon: object;
icon: Icon2;
location: string;
startDate: string;
endDate: string;
Expand Down
35 changes: 35 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,33 @@
resolved "https://verdaccio.mein-recycling.de/@bcoe%2fv8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cloudinary-util/url-loader@^3.10.0":
version "3.10.0"
resolved "https://verdaccio.mein-recycling.de/@cloudinary-util%2furl-loader/-/url-loader-3.10.0.tgz#30dbed4d60968687c9161a60b246da62d42c3e33"
integrity sha512-RNp6WayU6e5ikA7yCRqNhp0lOwLl82vLco9EwpES2si6Hb+g9yEaeTYvobD44ISQeJUnPl6e1c/AEYVSjfzwrg==
dependencies:
"@cloudinary-util/util" "2.2.1"
"@cloudinary/url-gen" "^1.10.2"

"@cloudinary-util/util@2.2.1", "@cloudinary-util/util@^2.2.1":
version "2.2.1"
resolved "https://verdaccio.mein-recycling.de/@cloudinary-util%2futil/-/util-2.2.1.tgz#c482d9321d37d921b347858a121c161b68782bd3"
integrity sha512-MEIqn5WtPP3mxSMTNNfpqlGS1UquAXcjmVdY/t/edD/ZWVjI85viBiOMIuF0W6n6UF5gTstLymfQNYx0YO/GZg==

"@cloudinary/transformation-builder-sdk@^1.5.1":
version "1.5.1"
resolved "https://verdaccio.mein-recycling.de/@cloudinary%2ftransformation-builder-sdk/-/transformation-builder-sdk-1.5.1.tgz#8ed5ef27fc6b66c09cfc183649b1c69459149619"
integrity sha512-7pTKgyrX49T3Qk0+bE/RN7bijGVRPusDXjRHJyO5a7H6CnL1sZ/TvTMAKvXweFLTOpWzWFW6nS0Bah3kBvTb7w==
dependencies:
"@cloudinary/url-gen" "^1.7.0"

"@cloudinary/url-gen@^1.10.2", "@cloudinary/url-gen@^1.7.0":
version "1.11.2"
resolved "https://verdaccio.mein-recycling.de/@cloudinary%2furl-gen/-/url-gen-1.11.2.tgz#a454dc77f9efb58c6f2c2f61b84d0d3e2dce9405"
integrity sha512-9yL3BlThh3PfyRg/zS8cQVic3FdFaIOp361YrDrQ4fqYbYE47SGWF4ji9KoFxYF4ejfDEptayeG9jF2C465KRQ==
dependencies:
"@cloudinary/transformation-builder-sdk" "^1.5.1"

"@codemirror/autocomplete@^6.0.0", "@codemirror/autocomplete@^6.1.0", "@codemirror/autocomplete@^6.7.1":
version "6.8.1"
resolved "https://verdaccio.mein-recycling.de/@codemirror%2fautocomplete/-/autocomplete-6.8.1.tgz#3f3daa9f591186901db07f58d17256656242e841"
Expand Down Expand Up @@ -11877,6 +11904,14 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1, neo-async@^2.6.2:
resolved "https://verdaccio.mein-recycling.de/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==

next-cloudinary@^4.18.0:
version "4.18.0"
resolved "https://verdaccio.mein-recycling.de/next-cloudinary/-/next-cloudinary-4.18.0.tgz#6ee87882f87d7a42784b5cd648bf469b2d8a6d35"
integrity sha512-CSEaDBjuEa+eTYns4i5ieK4sm72woNwBk8820V5i93/OduRBcT521SvDDnICX+h40LW2xsOQQF9aRIQcGteOlw==
dependencies:
"@cloudinary-util/url-loader" "^3.10.0"
"@cloudinary-util/util" "^2.2.1"

next-router-mock@^0.7.5:
version "0.7.5"
resolved "https://verdaccio.mein-recycling.de/next-router-mock/-/next-router-mock-0.7.5.tgz#199073ad6d77ddf4fc8bdb847254e5412b8e9e04"
Expand Down

0 comments on commit 6833778

Please sign in to comment.