chore: scaffold twitter lite

This commit is contained in:
2026-07-13 09:41:34 +09:00
parent 245d8d743f
commit c4382c1669
17 changed files with 3459 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import type { QueryClient } from '@tanstack/react-query'
import {
createRootRouteWithContext,
HeadContent,
Scripts,
} from '@tanstack/react-router'
import appCss from '../styles.css?url'
type RouterContext = { queryClient: QueryClient }
export const Route = createRootRouteWithContext<RouterContext>()({
head: () => ({
meta: [
{ charSet: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{ title: 'Twitter Lite' },
],
links: [{ rel: 'stylesheet', href: appCss }],
}),
shellComponent: RootDocument,
})
function RootDocument({ children }: { children: React.ReactNode }) {
return (
<html lang="ja">
<head>
<HeadContent />
</head>
<body>
{children}
<Scripts />
</body>
</html>
)
}
+12
View File
@@ -0,0 +1,12 @@
import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { Home } from './index'
describe('Home', () => {
it('starts without ambient post content', () => {
render(<Home />)
expect(screen.getByText('目的を決めてから開く')).toBeInTheDocument()
expect(screen.queryByRole('article')).not.toBeInTheDocument()
})
})
+13
View File
@@ -0,0 +1,13 @@
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/')({ component: Home })
export function Home() {
return (
<main className="landing">
<p className="brand">TWITTER LITE</p>
<h1>目的を決めてから開く</h1>
<p>ユーザー名か検索語を入力するまで、投稿は表示しません。</p>
</main>
)
}