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

feat: small ui updates #57

Merged
merged 4 commits into from
Feb 18, 2024
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
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and more.
- `/writing` - Writing page.
- `/writing/[slug]` - Static pre-rendered writing pages using [Contentful](https://www.contentful.com).
- `/journey` - Journey page.
- `/workspace` - Workspace page.
- `/bookmarks` - Bookmarks page.
- `/bookmarks/[id]` - Static pre-rendered bookmarks pages using [Raindrop](https://raindrop.io/).
- `/api` - API routes.
Expand All @@ -26,13 +27,13 @@ and more.
```bash
$ git clone https://github.com/suyalcinkaya/onur.dev.git
$ cd onur.dev
$ yarn
$ yarn dev
$ bun i
$ bun dev
```

Create a `.env` file similar to [`.env.example`](https://github.com/suyalcinkaya/onur.dev/blob/master/.env.example).

## Built With
## Tech Stack

- [Next.js](https://nextjs.org)
- [Tailwind CSS](https://tailwindcss.com)
Expand All @@ -41,3 +42,15 @@ Create a `.env` file similar to [`.env.example`](https://github.com/suyalcinkaya
- [Raindrop](https://raindrop.io)
- [Supabase](https://supabase.com)
- [Vercel](https://vercel.com)

## Repo Activity

![Alt](https://repobeats.axiom.co/api/embed/2d43636ebc156829d3e99c6f8c2b68d5aa6ebf93.svg "Repobeats analytics image")

## License

1. Feel free to take inspiration from this code.
2. Avoid directly copying it, please.
3. Crediting the author is appreciated.

No complicated licensing. Be kind and help others learn.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module.exports = {
reactStrictMode: true,
trailingSlash: false,
images: {
domains: ['images.ctfassets.net', 'assets.ctfassets.net'],
deviceSizes: [320, 375, 768, 1024, 1280]
deviceSizes: [390, 435, 768, 1024, 1280]
},
async redirects() {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/app/bookmarks/[slug]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async function CollectionPage({ params }) {
const { collection, raindrops } = await fetchData(slug)

return (
<ScrollArea className="flex flex-col" hasScrollTitle>
<ScrollArea className="bg-grid flex flex-col" hasScrollTitle>
<FloatingHeader scrollTitle={collection.title} goBackLink="/bookmarks" />
<div className="content-wrapper">
<div className="content @container">
Expand Down
8 changes: 5 additions & 3 deletions src/app/workspace/page.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image from 'next/image'

import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table.jsx'
import { ScrollArea } from '@/components/scroll-area'
import { FloatingHeader } from '@/components/floating-header'
Expand All @@ -14,17 +16,17 @@ export default async function Workspace() {
<div className="content-wrapper">
<div className="content">
<PageTitle title="Workspace" />
<div className="-mx-6 flex snap-x snap-mandatory gap-6 overflow-x-scroll pb-6 md:mx-0 md:grid md:snap-none md:grid-cols-2 md:pb-0">
<div className="-mx-6 flex snap-x snap-mandatory gap-6 overflow-x-scroll pb-4 mb-4 md:mx-0 md:grid md:snap-none md:grid-cols-2 md:overflow-x-auto md:pb-0">
<EmptyPlaceholder />
<img
<Image
src="/assets/workspace-1.webp"
alt="Workspace | 1"
className="w-2/3 snap-center object-cover md:w-full md:snap-align-none"
width={756}
height={1008}
loading="eager"
/>
<img
<Image
src="/assets/workspace-2.webp"
alt="Workspace | 2"
className="w-2/3 snap-center object-cover md:w-full md:snap-align-none"
Expand Down
1 change: 1 addition & 0 deletions src/components/writing-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const WritingLink = ({ post, viewCount, isMobile }) => {
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.3 }}
className="tabular-nums"
>
&middot; {formattedViewCount} {formattedViewCount === 1 ? 'view' : 'views'}
</m.span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/writing-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const WritingList = ({ items }) => {
{formattedViewCount ? (
<m.span
key={`${slug}-views`}
className="flex justify-end"
className="flex justify-end tabular-nums"
title={`${formattedViewCount} views`}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/writing-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const WritingViews = ({ slug }) => {
strokeWidth="1.5"
></circle>
</svg>
<span>{formattedViewCount}</span>
<span className="tabular-nums">{formattedViewCount}</span>
</m.div>
</LazyMotion>
)
Expand Down
22 changes: 19 additions & 3 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
GithubIcon,
TwitterIcon,
LinkedinIcon,
InstagramIcon,
YoutubeIcon,
Expand All @@ -14,10 +13,27 @@ import {

export const PROFILES = {
twitter: {
title: 'Twitter',
title: 'X (Twitter)',
username: 'onurschu',
url: 'https://twitter.com/intent/user?screen_name=onurschu',
icon: <TwitterIcon size={16} />
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-4 w-4"
width="44"
height="44"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#000000"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M4 4l11.733 16h4.267l-11.733 -16z" />
<path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" />
</svg>
)
},
github: {
title: 'GitHub',
Expand Down
3 changes: 3 additions & 0 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export function middleware(request, event) {
}

export const config = {
// matcher: '/writing/:path/'
// The below solution also filters out the user navigations which is not desired:
// See: https://github.com/vercel/next.js/discussions/37736#discussioncomment-7886601
matcher: [
{
source: '/writing/:path/',
Expand Down