Skip to content

Commit

Permalink
Merge pull request #9 from hariscs/frontend-starter
Browse files Browse the repository at this point in the history
Frontend starter
  • Loading branch information
hariscs authored Mar 22, 2024
2 parents 37c2cf4 + 2de092e commit 28ff5d9
Show file tree
Hide file tree
Showing 16 changed files with 523 additions and 181 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"trailingComma": "es5",
"semi": false,
"singleQuote": true
}
12 changes: 8 additions & 4 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@
},
"dependencies": {
"@repo/logger": "*",
"@repo/ui": "*",
"next": "^14.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.0.4",
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"autoprefixer": "^10.4.18",
"postcss": "^8.4.35",
"prettier-plugin-tailwindcss": "^0.5.12",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
}
6 changes: 6 additions & 0 deletions apps/frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
1 change: 1 addition & 0 deletions apps/frontend/public/assets/images/bg-header.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/frontend/public/assets/images/company-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/frontend/public/favicon.ico
Binary file not shown.
Binary file added apps/frontend/public/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions apps/frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import "./styles.css";
import { League_Spartan } from 'next/font/google'
import './styles.css'

const league_spartan = League_Spartan({
subsets: ['latin'],
display: 'swap',
})

export const metadata = {
title: 'Job Board | All Jobs',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode;
children: React.ReactNode
}): JSX.Element {
return (
<html lang="en">
<body>{children}</body>
<html className={league_spartan.className} lang="en">
<head>
<link rel="icon" sizes="32x32" href="/favicon/favicon-32x32.png" />
</head>
<body className="bg-accent">{children}</body>
</html>
);
)
}
34 changes: 8 additions & 26 deletions apps/frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
import { log } from "@repo/logger";
import { CounterButton, Link } from "@repo/ui";

export const metadata = {
title: "Store | Kitchen Sink",
};
import { Card } from '@/components/Card'

export default function Store(): JSX.Element {
log("Hey! This is the Store page.");

return (
<div className="container">
<h1 className="title">
Store <br />
<span>Kitchen Sink</span>
</h1>
<CounterButton />
<p className="description">
Built With{" "}
<Link href="https://turbo.build/repo" newTab>
Turborepo
</Link>
{" & "}
<Link href="https://nextjs.org/" newTab>
Next.js
</Link>
</p>
</div>
);
<>
<header className="mb-10 bg-primary bg-[url('/assets/images/bg-header.svg')] bg-cover py-14"></header>
<main className="mx-auto max-w-[90%] md:container">
<Card />
</main>
</>
)
}
58 changes: 3 additions & 55 deletions apps/frontend/src/app/styles.css
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
line-height: 1.5;
tab-size: 4;
}

body {
margin: 0;
}

.container {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1.5rem;
max-width: 100%;
margin: 0 auto;
padding: 0 16px;
text-align: center;
}

.title {
font-size: 3rem;
font-weight: 700;
margin: 0;
}

.title span {
display: inline-block;
background-image: linear-gradient(to right, #3b82f6, #ef4444);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}

.description {
color: #9ca3af;
font-weight: 500;
}

.description a {
color: #3b82f6;
text-decoration: none;
}

.description a:hover {
text-decoration: underline;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
49 changes: 49 additions & 0 deletions apps/frontend/src/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Image from 'next/image'
import React from 'react'

export function Card() {
return (
<div className="border-primary relative flex flex-col justify-between gap-4 rounded border-l-4 bg-white p-4 font-semibold shadow-lg md:flex-row md:items-center md:px-6 md:py-8">
<div className="md:flex md:items-center md:gap-4">
<Image
src="/assets/images/company-logo.svg"
alt="logo"
className="-mt-11 h-14 w-14 rounded-full md:static md:mt-0 md:h-auto md:w-auto"
width={40}
height={40}
/>
<div className="mt-4 flex w-full flex-col gap-1 md:mt-0">
<div className="flex gap-4">
<span className="text-primary">Photosnap</span>
<div className="flex gap-2 uppercase text-white">
<span className="bg-primary rounded-full px-2 py-1 text-xs">
new!
</span>
<span className="bg-secondary rounded-full px-2 py-1 text-xs">
featured
</span>
</div>
</div>
<h2 className="text-secondary capitalize">
senior frontend developer
</h2>
<div className="text-secondary-light flex flex-wrap items-center gap-2 text-xs capitalize">
<span className="p-1">1d ago</span>
<span>&#x2022;</span>
<span className="p-1">full time</span>
<span>&#x2022;</span>
<span className="p-1">USA only</span>
</div>
</div>
</div>
<hr className="md:hidden" />
<div className="text-primary flex flex-wrap items-center gap-4 capitalize">
<span className="bg-tertiary rounded px-2 py-0.5">frontend</span>
<span className="bg-tertiary rounded px-2 py-0.5">senior</span>
<span className="bg-tertiary rounded px-2 py-0.5">HTML</span>
<span className="bg-tertiary rounded px-2 py-0.5">senior</span>
<span className="bg-tertiary rounded px-2 py-0.5">HTML</span>
</div>
</div>
)
}
55 changes: 0 additions & 55 deletions apps/frontend/src/styles.css

This file was deleted.

30 changes: 30 additions & 0 deletions apps/frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx,mdx}',
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',

// Or if using `src` directory:
'./src/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
colors: {
primary: 'hsl(180, 29%, 50%)',
secondary: {
DEFAULT: 'hsl(180, 14%, 20%)',
light: 'hsl(180, 8%, 52%)',
},
tertiary: 'hsl(180, 31%, 95%)',
accent: 'hsl(180, 52%, 96%)',
warning: 'hsl(34, 97%, 64%)',
danger: 'hsl(0, 100%, 63%)',
},
fontFamily: {
sans: ['var(--font-league_spartan)'],
},
},
},
plugins: [],
}
11 changes: 7 additions & 4 deletions apps/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
"outDir": "dist",
"plugins": [
{
"name": "next"
}
]
"name": "next",
},
],
"paths": {
"@/*": ["./src/*"],
},
},
"include": ["src", "next-env.d.ts", ".next/types/**/*.ts"]
"include": ["src", "next-env.d.ts", ".next/types/**/*.ts"],
}
Loading

0 comments on commit 28ff5d9

Please sign in to comment.