Skip to content

Commit

Permalink
tailwind implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
JVGS1111 committed Jul 18, 2024
1 parent f46aa5c commit 9a66af5
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 189 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "next/core-web-vitals"
"extends":[
"next/core-web-vitals",
"@rocketseat/eslint-config/next"
]
}
5 changes: 3 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
pageExtensions: ['page.tsx', 'api.ts', 'api.tsx'],
}

export default nextConfig;
export default nextConfig
41 changes: 27 additions & 14 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@phosphor-icons/react": "^2.1.7",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand All @@ -21,7 +22,7 @@
"eslint": "^8",
"eslint-config-next": "14.2.5",
"postcss": "^8",
"prettier-plugin-tailwindcss": "^0.6.5",
"prettier-plugin-tailwindcss": "^0.4.1",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
Expand Down
3 changes: 3 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require('prettier-plugin-tailwindcss')],
}
42 changes: 42 additions & 0 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ArrowLeft, GithubLogo } from '@phosphor-icons/react'

interface HeaderProps {
title: string
variante: 'home' | 'create'
}

export function Header({ title, variante = 'home' }: HeaderProps) {
function renderActionBar() {
if (variante === 'home') {
return (
<div className="flex w-full">
<button className="ml-auto">
<GithubLogo className="text-title" size={32} />
</button>
</div>
)
}

return (
<div className="flex w-full justify-between ">
<button>
<ArrowLeft className="text-title" size={32} />
</button>
<button className="font-medium text-title disabled:text-text">
done
</button>
</div>
)
}

return (
<header className="flex h-52 w-full justify-center bg-white">
<div className="flex w-full max-w-app flex-col justify-between pb-9 pl-6 pr-6 pt-6">
{renderActionBar()}
<div className="mt-auto max-w-80 text-2xl font-medium text-title">
{title}
</div>
</div>
</header>
)
}
17 changes: 17 additions & 0 deletions src/components/NavigationBar/NavItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Link from 'next/link'

interface NavItemProps {
text: string
}

export function NavItem({ text }: NavItemProps) {
return (
<Link
href="#"
className="min-w-button rounded-md bg-white px-3 py-2.5 text-center shadow-sm"
data-active={true}
>
<span className="text-xs font-medium text-text">{text}</span>
</Link>
)
}
11 changes: 11 additions & 0 deletions src/components/NavigationBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NavItem } from './NavItem'

export function NavigationBar() {
return (
<nav className="flex w-full justify-center gap-2.5 px-6 py-3">
<NavItem text="In progress" />
<NavItem text="Completed" />
<NavItem text="add list" />
</nav>
)
}
6 changes: 6 additions & 0 deletions src/pages/_app.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@/styles/globals.css'
import type { AppProps } from 'next/app'

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
6 changes: 0 additions & 6 deletions src/pages/_app.tsx

This file was deleted.

26 changes: 26 additions & 0 deletions src/pages/_document.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
</Head>
<body>
<main className="h-screen bg-app-bg">
<Main />
<NextScript />
</main>
</body>
</Html>
)
}
13 changes: 0 additions & 13 deletions src/pages/_document.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Header } from '@/components/Header'
import { NavigationBar } from '@/components/NavigationBar'

export default function Home() {
return (
<div>
<Header title="What do we have to do for today?" variante="home" />
<NavigationBar />
</div>
)
}
1 change: 1 addition & 0 deletions src/pages/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './home'
Loading

0 comments on commit 9a66af5

Please sign in to comment.