Skip to content

Commit

Permalink
fix: index, about exchange
Browse files Browse the repository at this point in the history
exchanged two pages, updated styling of Main template
  • Loading branch information
juunie-roh committed Dec 12, 2023
1 parent 1ca1ad3 commit 6cd5b6e
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 105 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { render, screen } from '@testing-library/react';

import About from '@/pages/about';
import Index from '@/pages/index';

describe('About page', () => {
describe('Index page', () => {
describe('Render method', () => {
it('should have 3 paragraphs of `Lorem ipsum`', () => {
render(<About />);
render(<Index />);
const paragraph = screen.getAllByText(/Lorem ipsum/);
expect(paragraph).toHaveLength(3);
});
Expand Down
98 changes: 81 additions & 17 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image from 'next/image';

import { Meta } from '@/layouts/Meta';
import { Main } from '@/templates/Main';

Expand All @@ -10,23 +12,85 @@ const About = () => (
/>
}
>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Reiciendis
delectus dolore inventore repellendus suscipit maiores veritatis
doloribus, architecto deleniti error ratione libero vero autem est
temporibus fugiat sunt ut eos.
</p>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Hic dolores quos
voluptatibus tenetur cumque, unde porro quaerat veritatis similique
possimus cupiditate. Doloribus expedita iure qui delectus dolorem optio
magni repellendus?
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem dolor
nostrum fuga et. Aliquid, vitae totam. Ad eligendi voluptatem debitis
atque fuga! Molestiae, sequi eos natus ex necessitatibus corrupti ratione.
</p>
<div className="flex w-full flex-col items-center justify-between">
<div className="relative z-[-1] flex place-items-baseline before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-transparent before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px]">
<p className="mr-3 text-lg text-gray-600">This Project is built with</p>
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>
<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Docs{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Find in-depth information about Next.js features and API.
</p>
</a>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Learn{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Templates{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Explore starter templates for Next.js.
</p>
</a>
<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Deploy{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</div>
</Main>
);

Expand Down
99 changes: 17 additions & 82 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Image from 'next/image';

import { Meta } from '@/layouts/Meta';
import { Main } from '@/templates/Main';

Expand All @@ -12,86 +10,23 @@ const Index = () => (
/>
}
>
<div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Docs{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Learn{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Templates{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Explore starter templates for Next.js.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Deploy{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Reiciendis
delectus dolore inventore repellendus suscipit maiores veritatis
doloribus, architecto deleniti error ratione libero vero autem est
temporibus fugiat sunt ut eos.
</p>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Hic dolores quos
voluptatibus tenetur cumque, unde porro quaerat veritatis similique
possimus cupiditate. Doloribus expedita iure qui delectus dolorem optio
magni repellendus?
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem dolor
nostrum fuga et. Aliquid, vitae totam. Ad eligendi voluptatem debitis
atque fuga! Molestiae, sequi eos natus ex necessitatibus corrupti ratione.
</p>
</Main>
);

Expand Down
8 changes: 5 additions & 3 deletions src/templates/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ const Main = (props: IMainProps) => {
return (
<li
className={`${
router.pathname === menu.path ? 'bg-gray-400 ' : ''
}inline-block rounded-lg px-2 hover:text-gray-900`}
router.pathname === menu.path
? 'underline underline-offset-2 '
: ''
}inline-block rounded-lg px-2 hover:bg-gray-400 hover:text-gray-900`}
key={menu.id}
>
<Link href={menu.path}>{menu.name}</Link>
Expand All @@ -64,7 +66,7 @@ const Main = (props: IMainProps) => {
/>
</a>
</header>
<main className="flex min-h-screen flex-col items-center justify-between p-8 pt-32 lg:p-12 lg:pt-48">
<main className="flex min-h-screen p-8 pt-32 lg:p-12 lg:pt-48">
{props.children}
</main>

Expand Down

0 comments on commit 6cd5b6e

Please sign in to comment.