mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-01 18:21:52 +02:00
⬆️ v3.0.0 (#704)
This commit is contained in:
parent
735056f25f
commit
c22b3abc4d
385 changed files with 19912 additions and 5250 deletions
43
apps/web/src/components/date-icon.tsx
Normal file
43
apps/web/src/components/date-icon.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import clsx from "clsx";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
export const DateIconInner = (props: {
|
||||
dow?: React.ReactNode;
|
||||
day?: React.ReactNode;
|
||||
month?: React.ReactNode;
|
||||
className?: string;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"w-14 overflow-hidden rounded-md border bg-white text-center text-slate-800",
|
||||
props.className,
|
||||
)}
|
||||
>
|
||||
<div className="h-4 border-b border-slate-200 bg-slate-50 text-xs leading-4">
|
||||
{props.dow}
|
||||
</div>
|
||||
<div className="flex h-10 items-center justify-center">
|
||||
<div>
|
||||
<div className="my-px text-lg font-bold leading-none">
|
||||
{props.day}
|
||||
</div>
|
||||
<div className="text-xs font-bold uppercase tracking-wider">
|
||||
{props.month}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const DateIcon = (props: { date: Dayjs; className?: string }) => {
|
||||
return (
|
||||
<DateIconInner
|
||||
className={props.className}
|
||||
dow={dayjs(props.date).format("ddd")}
|
||||
day={dayjs(props.date).format("D")}
|
||||
month={dayjs(props.date).format("MMM")}
|
||||
/>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue