Browse Source

misc

Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
pull/1/head
Muthu Kumar 2 years ago
parent
commit
e071805f11
Signed by: mkrhere GPG Key ID: 3FD688398897097E
  1. 8
      src/components/Timeline.tsx
  2. 3
      vite.config.ts

8
src/components/Timeline.tsx

@ -2,8 +2,8 @@ import React, { useMemo } from "react";
import { css, cx } from "@emotion/css";
import { format, isBefore, startOfDay } from "date-fns";
type TLUnit = { title?: string; url?: string; img?: string; date: string };
type TimelineUnits = TLUnit[];
export type TimelineUnit = { title?: string; url?: string; img?: string; date: string };
export type TimelineUnits = TimelineUnit[];
const unit = css`
display: flex;
@ -86,7 +86,7 @@ const tlcontainer = css`
}
`;
const TimelineUnit: React.FunctionComponent<{ contents: TLUnit }> = ({ contents }) => {
const Unit: React.FunctionComponent<{ contents: TimelineUnit }> = ({ contents }) => {
const date = useMemo(() => new Date(contents.date), [contents.date]);
return (
@ -125,7 +125,7 @@ const Timeline: React.FunctionComponent<{ contents: TimelineUnits }> = ({ conten
.map(unit => ({ ...unit, Date: new Date(unit.date) }))
.filter(unit => !isBefore(startOfDay(unit.Date), current))
.map(unit => (
<TimelineUnit key={unit.date} contents={unit} />
<Unit key={unit.date} contents={unit} />
))}
</div>
);

3
vite.config.ts

@ -6,9 +6,6 @@ import svgr from "@svgr/rollup";
export default defineConfig({
server: {
port: 12000,
hmr: {
port: 12000,
},
},
plugins: [
reactRefresh(),

Loading…
Cancel
Save