Skip to content

Commit

Permalink
migrate site from cra to next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ayanamists committed Mar 13, 2024
1 parent d1014f5 commit 93d8a5f
Show file tree
Hide file tree
Showing 34 changed files with 1,992 additions and 8,119 deletions.
6 changes: 6 additions & 0 deletions packages/oh-my-old-tweet/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

dist/

.next/

next-env.d.ts
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/oh-my-old-tweet/app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import './App.css';
import dynamic from 'next/dynamic';

const PageRouter = dynamic(() => import('components/PageRouter'), { ssr: false });

export function generateStaticParams() {
return [{ slug: [''] }];
}

function App() {
return <PageRouter />;
}

export default App;
3 changes: 3 additions & 0 deletions packages/oh-my-old-tweet/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
24 changes: 24 additions & 0 deletions packages/oh-my-old-tweet/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import './globals.css';

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (<html lang="en">

<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="A graceful, powerful and easy-to-use tool to see old (including deleted) tweets." />
<title>Oh my Old Tweet</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">{children}</div>
</body>

</html>);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"use client";

import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { parseUserName } from '../InputParser';
import MainLayout from '../Layout/MainLayout';
import { parseUserName } from '../src/InputParser';
import dynamic from 'next/dynamic';

const MainLayout = dynamic(() => import('../src/Layout/MainLayout'), { ssr: false });

function MarkBox({ text }: { text: string }) {
return <mark className="px-2 text-white bg-tw-blue text-white rounded">{text}</mark>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import './App.css';
import MainPage from './pages/MainPage';
import UserPage from './pages/UserPage';
import StatusPage from './pages/StatusPage';
import { HashRouter, Routes, Route } from 'react-router-dom';
"use client"
import { Routes, Route, HashRouter } from 'react-router-dom';
import MainPage from './MainPage';
import StatusPage from './StatusPage';
import UserPage from './UserPage';


function App() {
export default function App() {
return (
<HashRouter>
<Routes>
Expand All @@ -15,6 +14,4 @@ function App() {
</Routes>
</HashRouter>
);
}

export default App;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use client";
import { useParams } from 'react-router-dom';
import MainLayout from '../Layout/MainLayout';
import { LoadableTCard } from '../LoadableTCard';
import { LoadableTCard } from 'src/LoadableTCard';
import MainLayout from 'src/Layout/MainLayout';


export default function Page() {
const { timestamp, user, id } = useParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use client";
import { useEffect } from 'react';
import { Timeline } from '../Timeline';
import { useParams, useNavigate } from 'react-router-dom';
import MainLayout from '../Layout/MainLayout';
import MainLayout from 'src/Layout/MainLayout';
import { Timeline } from 'src/Timeline';

export default function Page() {
const { user } = useParams();
Expand Down
104 changes: 0 additions & 104 deletions packages/oh-my-old-tweet/config/env.js

This file was deleted.

66 changes: 0 additions & 66 deletions packages/oh-my-old-tweet/config/getHttpsConfig.js

This file was deleted.

29 changes: 0 additions & 29 deletions packages/oh-my-old-tweet/config/jest/babelTransform.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/oh-my-old-tweet/config/jest/cssTransform.js

This file was deleted.

40 changes: 0 additions & 40 deletions packages/oh-my-old-tweet/config/jest/fileTransform.js

This file was deleted.

Loading

0 comments on commit 93d8a5f

Please sign in to comment.