-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: ๐ markup the projects page
- Loading branch information
1 parent
f9adb38
commit 24e0e37
Showing
9 changed files
with
93 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
import { useProjectsQuery } from '../__generated__/types' | ||
|
||
import { ProjectsListItem } from './ProjectsListItem' | ||
|
||
export const ProjectsList: React.FC = () => { | ||
const { data } = useProjectsQuery() | ||
|
||
return ( | ||
<div className="flex flex-wrap"> | ||
{data?.projects?.map((project) => { | ||
return ( | ||
<div key={project?.id} className="p-4 lg:w-1/3 w-full md:w-1/2"> | ||
<ProjectsListItem | ||
id={project?.id} | ||
title={project?.title} | ||
image={project?.imageUrlLarge} | ||
/> | ||
</div> | ||
) | ||
})} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import Link from 'next/link' | ||
import Image from 'next/image' | ||
|
||
type Props = { | ||
id?: string | ||
title?: string | ||
image?: string | null | ||
} | ||
|
||
export const ProjectsListItem: React.FC<Props> = ({ id, title, image }) => { | ||
return ( | ||
<Link href={`/projects/${id}`}> | ||
<a> | ||
<div className="transition duration-300 bg-white shadow-md rounded-3xl group hover:shadow-lg hover:scale-105"> | ||
<Image | ||
alt={`${title}ใฎ็ปๅ`} | ||
src={image ? image : './noImage.png'} | ||
width={1956} | ||
height={796} | ||
className="object-cover object-center w-full transition duration-300 rounded-t-3xl saturate-150" | ||
/> | ||
<div className="p-6"> | ||
<h2 className="mb-1 text-xl font-bold text-gray-900 transition duration-300 group-hover:text-blue-500"> | ||
{title} | ||
</h2> | ||
</div> | ||
</div> | ||
</a> | ||
</Link> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
const config = { | ||
reactStrictMode: true, | ||
images: { | ||
domains: ['d2fde157oxqkl4.cloudfront.net'], | ||
}, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
import React from 'react' | ||
import { Layout } from '../components/Layout' | ||
import Link from 'next/link' | ||
import { NextSeo } from 'next-seo' | ||
import { useProjectsQuery } from '../generated/graphql' | ||
|
||
const Home: React.FC = () => { | ||
const { data, loading } = useProjectsQuery() | ||
|
||
if (loading) { | ||
return <div>loading...</div> | ||
} else { | ||
return ( | ||
<Layout> | ||
<NextSeo | ||
title="Wantedly" | ||
description="Wantedly Frontend Internship ้ธ่่ชฒ้ก" | ||
/> | ||
<div> | ||
{!data?.projects | ||
? null | ||
: data.projects.map((project) => { | ||
return <div key={project?.id}>{project?.title}</div> | ||
})} | ||
</div> | ||
</Layout> | ||
) | ||
} | ||
return ( | ||
<Layout> | ||
<NextSeo | ||
title="Wantedly" | ||
description="Wantedly Frontend Internship ้ธ่่ชฒ้ก" | ||
/> | ||
<Link href="/projects"> | ||
<a>ๅ้ใชในใใ่ฆใ</a> | ||
</Link> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import { Layout } from '../../components/Layout' | ||
import { NextSeo } from 'next-seo' | ||
|
||
import { ProjectsList } from '../../components/ProjectsList' | ||
|
||
const ProjectsListPage: React.FC = () => { | ||
return ( | ||
<Layout> | ||
<NextSeo | ||
title="Projects - Wantedly" | ||
description="Wantedly Frontend Internship ้ธ่่ชฒ้ก" | ||
/> | ||
<ProjectsList /> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default ProjectsListPage |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.