Compare commits
2 Commits
a89c43efd2
...
35b156ba5a
Author | SHA1 | Date |
---|---|---|
Bauke | 35b156ba5a | |
Bauke | 5969b023bb |
|
@ -1,12 +1,9 @@
|
||||||
// Import native Node libraries.
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
import fsp from "node:fs/promises";
|
import fsp from "node:fs/promises";
|
||||||
// Import Esbuild and associated plugins.
|
|
||||||
import esbuild from "esbuild";
|
import esbuild from "esbuild";
|
||||||
import copyPlugin from "esbuild-copy-static-files";
|
import copyPlugin from "esbuild-copy-static-files";
|
||||||
import {sassPlugin} from "esbuild-sass-plugin";
|
import {sassPlugin} from "esbuild-sass-plugin";
|
||||||
// Import PostCSS and associated plugins.
|
|
||||||
import cssnano from "cssnano";
|
import cssnano from "cssnano";
|
||||||
import postcss from "postcss";
|
import postcss from "postcss";
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
import {Component} from "preact";
|
||||||
|
import {type SharedProps} from "./shared.js";
|
||||||
|
|
||||||
|
export class BigDate extends Component<SharedProps> {
|
||||||
|
render() {
|
||||||
|
const {today} = this.props;
|
||||||
|
|
||||||
|
const date = [
|
||||||
|
["year", today.date.getFullYear().toString()],
|
||||||
|
["month", today.paddedMonth()],
|
||||||
|
["day", today.paddedDay()],
|
||||||
|
]
|
||||||
|
.map(([name, value]) => <span class={name}>{value}</span>)
|
||||||
|
// Add a dash between each part of the date.
|
||||||
|
// eslint-disable-next-line unicorn/no-array-reduce
|
||||||
|
.reduce((accumulator, current) => (
|
||||||
|
<>
|
||||||
|
{accumulator}
|
||||||
|
<span class="dash">-</span>
|
||||||
|
{current}
|
||||||
|
</>
|
||||||
|
));
|
||||||
|
|
||||||
|
return <h1 class="big-date">{date}</h1>;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
import {type DateWrapper} from "../date/date.js";
|
||||||
|
|
||||||
|
export type SharedProps = {
|
||||||
|
today: DateWrapper;
|
||||||
|
};
|
|
@ -1,6 +1,4 @@
|
||||||
// Third-party imports.
|
|
||||||
import {setup} from "@holllo/test";
|
import {setup} from "@holllo/test";
|
||||||
// First-party imports.
|
|
||||||
import {DateWrapper} from "./date.js";
|
import {DateWrapper} from "./date.js";
|
||||||
|
|
||||||
await setup("DateWrapper", async (group) => {
|
await setup("DateWrapper", async (group) => {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Third-party imports.
|
|
||||||
import {render} from "preact";
|
import {render} from "preact";
|
||||||
// CSS imports.
|
|
||||||
import "modern-normalize/modern-normalize.css";
|
import "modern-normalize/modern-normalize.css";
|
||||||
import "./global.scss";
|
import "./global.scss";
|
||||||
// First-party imports.
|
|
||||||
import {App} from "./app.js";
|
import {App} from "./app.js";
|
||||||
|
|
||||||
if ($dev) {
|
if ($dev) {
|
||||||
|
|
Loading…
Reference in New Issue