Skip to content

Commit

Permalink
Fix a bug on the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
fretchen committed Jan 6, 2025
1 parent e318065 commit beca294
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions components/BlogList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import blogs from "../blog/blogs.json";
import { Link } from "./Link";

const BlogList: React.FC = function () {
// invert the presented order of the blogs
const invertedBlogs = blogs.reverse();
return (
<div className="BlogList">
{invertedBlogs.map((blog, index) => (
{blogs.reverse().map((blog, index) => (
<div key={blogs.length - 1 - index} style={{ marginBottom: "20px" }}>
{blog.publishing_date && <p style={{ marginBottom: "5px" }}>{blog.publishing_date}</p>}
<Link href={`/blog/${blogs.length - 1 - index}`}>
Expand Down
2 changes: 0 additions & 2 deletions pages/amo/+Page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as React from "react";

import blogs from "../../amo/blogs.json";
import AmoList from "../../components/AmoList";

const App: React.FC = function () {
console.log(blogs);
return (
<div className="AMO">
<h1>AMO lecture notes</h1>
Expand Down
2 changes: 0 additions & 2 deletions pages/blog/+Page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as React from "react";

import blogs from "../../blog/blogs.json";
import BlogList from "../../components/BlogList";

const App: React.FC = function () {
console.log(blogs);
return (
<div className="Blog">
<h1>Welcome to my blog!</h1>
Expand Down

0 comments on commit beca294

Please sign in to comment.