Skip to content

Commit 56907e4

Browse files
authored
oxfmt (#80)
* oxfmt * Format * Sync * Sync
1 parent 456c187 commit 56907e4

File tree

45 files changed

+255
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+255
-309
lines changed

.oxfmtrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 80,
4+
"singleQuote": false,
5+
"semi": false,
6+
"objectWrap": "preserve",
7+
"quoteProps": "as-needed",
8+
"experimentalSortPackageJson": true,
9+
"experimentalSortImports": {
10+
"newlinesBetween": false,
11+
"enabled": true
12+
},
13+
"ignorePatterns": [
14+
".next/",
15+
".yarn/",
16+
"public/",
17+
".yarnrc.yml",
18+
"next-env.d.ts"
19+
]
20+
}

.prettierignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/(main)/about/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { EnvelopeIcon } from "@heroicons/react/24/solid"
22
import { Metadata } from "@playwright/test"
33
import { clsx } from "clsx"
44
import Image from "next/image"
5-
import { Container } from "components/Container"
6-
import { PageTitle } from "components/PageTitle"
7-
import { Prose } from "components/Prose"
8-
import { socials } from "components/SocialIcons"
9-
import portraitImage from "images/portrait.jpg"
10-
import { siteMeta } from "lib/siteMeta"
5+
import { Container } from "~/components/Container"
6+
import { PageTitle } from "~/components/PageTitle"
7+
import { Prose } from "~/components/Prose"
8+
import { socials } from "~/components/SocialIcons"
9+
import portraitImage from "~/images/portrait.jpg"
10+
import { siteMeta } from "~/lib/siteMeta"
1111
import Content from "./content.mdx"
1212

1313
export const metadata: Metadata = {

app/(main)/blog/[slug]/not-found.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client"
22

33
import Link from "next/link"
4-
import { Button } from "components/Button"
5-
import ErrorPage from "components/ErrorPage"
4+
import { Button } from "~/components/Button"
5+
import ErrorPage from "~/components/ErrorPage"
66

77
export default function PostNotFound() {
88
return (

app/(main)/blog/[slug]/opengraph-image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPostImage } from "lib/posts"
1+
import { getPostImage } from "~/lib/posts"
22

33
const size = {
44
height: 1024,

app/(main)/blog/[slug]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Image from "next/image"
2-
import { PostLayout } from "components/layouts/PostLayout"
3-
import { withOpenGraph } from "lib/metadata"
4-
import { getAllPostSlugs, getPost } from "lib/posts"
2+
import { PostLayout } from "~/components/layouts/PostLayout"
3+
import { withOpenGraph } from "~/lib/metadata"
4+
import { getAllPostSlugs, getPost } from "~/lib/posts"
55

66
export async function generateStaticParams() {
77
const slugs = await getAllPostSlugs()

app/(main)/blog/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Metadata } from "next"
2-
import type { PostMeta } from "components/layouts/PostLayout"
2+
import type { PostMeta } from "~/components/layouts/PostLayout"
33

44
export function getMetadata(meta: PostMeta): Metadata {
55
return {

app/(main)/blog/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Metadata } from "next"
2-
import { Card } from "components/Card"
3-
import { SimpleLayout } from "components/layouts/SimpleLayout"
4-
import { formatDate } from "lib/date"
5-
import { getAllPosts } from "lib/posts"
2+
import { Card } from "~/components/Card"
3+
import { SimpleLayout } from "~/components/layouts/SimpleLayout"
4+
import { formatDate } from "~/lib/date"
5+
import { getAllPosts } from "~/lib/posts"
66

77
export const metadata: Metadata = {
88
description: `All of my blog posts, even the ones that I might not fully agree with anymore. Software engineering is a process of continuous learning, don’t ever think there isn’t more to learn.`,

app/(main)/blog/posts/building-figma-multiplayer-cursors/content.mdx

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -193,39 +193,40 @@ interface CursorProps {
193193
connection: ClientConnection
194194
}
195195

196-
export const Cursor = forwardRef<HTMLDivElement, CursorProps>(
197-
function Cursor({ connection }, ref) {
198-
const hash = new ColorHash({ lightness: 0.3 })
199-
const color = hash.hex(connection.username)
200-
201-
return (
202-
<div
203-
ref={ref}
204-
className={clsx(
205-
"fixed flex translate-x-[--x] translate-y-[--y] gap-1 rounded text-xs",
206-
// If we don't have any initial coordinates for the user, hide this
207-
// cursor. This happens when a new client first connects.
208-
connection.coords.x ? "visible" : "invisible",
209-
)}
210-
style={
211-
{
212-
"--x": `${connection.coords.x}vw`,
213-
"--y": `${connection.coords.y}vh`,
214-
} as React.CSSProperties
215-
}
196+
export const Cursor = forwardRef<HTMLDivElement, CursorProps>(function Cursor(
197+
{ connection },
198+
ref,
199+
) {
200+
const hash = new ColorHash({ lightness: 0.3 })
201+
const color = hash.hex(connection.username)
202+
203+
return (
204+
<div
205+
ref={ref}
206+
className={clsx(
207+
"fixed flex translate-x-[--x] translate-y-[--y] gap-1 rounded text-xs",
208+
// If we don't have any initial coordinates for the user, hide this
209+
// cursor. This happens when a new client first connects.
210+
connection.coords.x ? "visible" : "invisible",
211+
)}
212+
style={
213+
{
214+
"--x": `${connection.coords.x}vw`,
215+
"--y": `${connection.coords.y}vh`,
216+
} as React.CSSProperties
217+
}
218+
>
219+
<Arrow color={color} />
220+
221+
<span
222+
className="relative -left-1.5 top-4 rounded-sm px-1.5 py-0.5 text-white"
223+
style={{ backgroundColor: color }}
216224
>
217-
<Arrow color={color} />
218-
219-
<span
220-
className="relative -left-1.5 top-4 rounded-sm px-1.5 py-0.5 text-white"
221-
style={{ backgroundColor: color }}
222-
>
223-
{connection.username}
224-
</span>
225-
</div>
226-
)
227-
},
228-
)
225+
{connection.username}
226+
</span>
227+
</div>
228+
)
229+
})
229230
```
230231

231232
Now that we can display a single cursor, it's time to display them all!

app/(main)/blog/posts/css-scroll-animations/content.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ useEffect(() => {
157157

158158
onScroll()
159159
window.addEventListener("scroll", onScroll, { passive: true })
160-
return () =>
161-
window.removeEventListener("scroll", onScroll, { passive: true })
160+
return () => window.removeEventListener("scroll", onScroll, { passive: true })
162161
}, [])
163162

164163
return <header className={isScrolled ? "shadow-lg" : ""}></header>

0 commit comments

Comments
 (0)