Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/Layout.tsx → src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Header from "./Header";
import Footer from "./Footer";
import Header from "./Header.tsx";
import Footer from "./Footer.tsx";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I believe these don't need the .tsx ending, and I think it's convention to leave it off

import { Outlet } from "react-router";

export default function Layout() {
Expand Down
6 changes: 3 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router";
import "./index.css";
import Layout from "./components/Layout.tsx";
import Home from "./routes/Home.tsx";
import About from "./routes/About.tsx";
import Layout from "./components/Layout/index.tsx";
import Home from "./routes/Home/index.tsx";
import About from "./routes/About/index.tsx";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these components are exported as default, I believe we can change all of these to leave off the
/index.tsx.
E.g.

import Home from "./routes/Home";


const root = document.getElementById("root");

Expand Down
7 changes: 0 additions & 7 deletions src/routes/About.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions src/routes/About/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function About() {
return (
<main className="min-h-[25vh] grid place-items-center bg-primary">
<h3 className="text-3xl text-secondary">About Code Cafe</h3>
</main>
);
}
15 changes: 0 additions & 15 deletions src/routes/Home.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/routes/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Hero from "./Hero.tsx";
import Features from "./Features.tsx";
import CTA from "./CTA.tsx";
import Showcase from "./Showcase.tsx";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as above


export default function Home() {
return (
<>
<Hero />
<Features />
<Showcase />
<CTA />
</>
);
}