Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(About page): Uses the Tile component #13

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ const nextConfig = {
env: {
SANITY_DATASET: process.env.SANITY_DATASET,
SANITY_PROJECT_ID: process.env.SANITY_PROJECT_ID,
SANITY_WEBHOOK_SECRET: process.env.SANITY_WEBHOOK_SECRET,
REVALIDATE_TOKEN: process.env.REVALIDATE_TOKEN,
SANITY_POSTS_WEBHOOK_SECRET: process.env.SANITY_POSTS_WEBHOOK_SECRET,
SANITY_CAROUSEL_WEBHOOK_SECRET: process.env.SANITY_CAROUSEL_WEBHOOK_SECRET,
REVALIDATE_TOKEN: process.env.REVALIDATE_TOKEN,
},
images: {
domains: ['cdn.sanity.io'],
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function Layout({
</Link>
</div>
<div className="md:flex items-end justify-between">
<div className="mb-8 md:mb-0">
<div className="md:w-80 mb-8 md:mb-0">
<Tile size="small" title="Work" link="/work" />
<Tile size="small" title="Personal Projects" />
<Tile size="small" title="About" link="/about" />
Expand Down
3 changes: 1 addition & 2 deletions src/components/LinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ type AnchorProps = Omit<
> &
LinkProps;

type Props = {title: string} & AnchorProps &
(Primary | Secondary | Rounded);
type Props = {title: string} & AnchorProps & (Primary | Secondary | Rounded);

export default function LinkButton({title, ...props}: Props) {
if (props.type === 'primary') {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react';

export default function Logo() {
return (
<svg
Expand Down
13 changes: 7 additions & 6 deletions src/components/Tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ interface Props {
title: string;
link?: string;
size: 'small' | 'medium' | 'large';
icon?: string;
}

export default function Tile({title, link, size}: Props) {
export default function Tile({title, link, size, icon}: Props) {
const sizeClasses = {
small: {
content: 'text-base',
tile: 'md:w-80 h-10',
tile: 'h-10 gap-4',
},
medium: {
content: 'text-3-1/2xl',
tile: 'w-96 h-20',
tile: 'py-5 gap-6',
},
large: {
content: 'text-3-1/2xl',
tile: 'w-112 h-40',
tile: 'py-9 gap-8',
},
};

Expand All @@ -34,7 +35,7 @@ export default function Tile({title, link, size}: Props) {
<p
className={`${sizeClasses[size].content} text-black dark:text-white group-hover:-rotate-45 duration-200 transition-transform ease-linear`}
>
{icon ?? '→'}
</p>
</Link>
) : (
Expand All @@ -45,7 +46,7 @@ export default function Tile({title, link, size}: Props) {
{title}
</p>
<p className={`${sizeClasses[size].content} text-black dark:text-white`}>
wip
{icon ?? 'wip'}
</p>
</div>
);
Expand Down
19 changes: 5 additions & 14 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Head from 'next/head';
import Image from 'next/image';
import Layout from '~/components/Layout';
import Tile from '~/components/Tile';

const SKILLS = [
'Product Design',
Expand Down Expand Up @@ -50,14 +51,13 @@ export default function About() {
</div>
<div className="h-200 rounded relative">
<Image
fill
priority
src="/images/AnitaLaudado.jpeg"
alt="A profile picture of me"
sizes="(min-width: 768px) 700px, 800px"
/* width={3852}
height={4815} */
className="rounded object-cover object-top"
width={800}
height={600}
className="rounded object-cover object-top w-full h-full"
/>
</div>
</div>
Expand All @@ -66,17 +66,8 @@ export default function About() {
What I <b>do</b>
</h2>
<div>
{/* TODO: Move this to the Tile component */}
{SKILLS.map(skill => (
<div
key={skill}
className="w-full flex items-center gap-6 py-5 border-b-1 border-black dark:border-white"
>
<p className="text-3-1/2xl text-black dark:text-white">{skill}</p>
<p className="text-3-1/2xl text-black dark:text-white ml-auto">
</p>
</div>
<Tile key={skill} size="medium" title={skill} icon="✦" />
))}
</div>
</Layout>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/work/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {PortableText, PortableTextReactComponents} from '@portabletext/react';
import type {GetStaticPropsContext, InferGetStaticPropsType} from 'next';
import Head from 'next/head';
import NextImage from 'next/image';
import Image from 'next/image';
import ImageBlock from '~/components/ImageBlock';
import Layout from '~/components/Layout';
import {parseEsotericImage} from '~/models/asset';
Expand All @@ -18,10 +18,10 @@ const components: Partial<PortableTextReactComponents> = {
),
},
types: {
fullImage: ({value}) => {
editorImage: ({value}) => {
const imageUrl = parseEsotericImage(value).url();
return (
<NextImage src={imageUrl} width={2000} height={1000} alt={value.alt} />
<Image src={imageUrl} width={1100} height={1100} alt={value.alt} />
);
},
},
Expand Down