2021-09-17 18:16:10 +00:00
|
|
|
import { Title, Paragraph, Heading } from "../components";
|
|
|
|
import DatePicker from 'react-datepicker'
|
|
|
|
import { useState } from "react";
|
|
|
|
import "react-datepicker/dist/react-datepicker.css"
|
|
|
|
import CopyToClipboard from "react-copy-to-clipboard";
|
|
|
|
import moment from "moment";
|
|
|
|
import Head from "next/head";
|
|
|
|
|
|
|
|
export default function BirthdaysPage() {
|
|
|
|
const [date, setDate] = useState(new Date());
|
2021-09-17 18:21:45 +00:00
|
|
|
const [copied, setCopied] = useState("Copy!");
|
2021-09-17 18:16:10 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Head>
|
|
|
|
<meta name="description" content="A command generator for UtiliBots' birthday bot." />
|
|
|
|
<meta property="og:description" content="A command generator for UtiliBots' birthday bot."/>
|
|
|
|
</Head>
|
|
|
|
<div className="min-h-screen min-w-full bg-gray-400 dark:bg-gray-800">
|
|
|
|
<Title>Birthdays</Title>
|
|
|
|
<Paragraph>You can generate your birthday command here for UtiliBots' birthday bot.</Paragraph>
|
|
|
|
<Heading>I was born on the...</Heading>
|
|
|
|
<Paragraph>The format is <strong>DD/MM</strong>.</Paragraph>
|
2021-09-17 18:21:45 +00:00
|
|
|
<DatePicker className="mx-4 dark:text-gray-300 dark:bg-gray-500 bg-white" selected={date} onChange={
|
2021-09-17 18:16:10 +00:00
|
|
|
// @ts-ignore
|
2021-09-17 18:21:45 +00:00
|
|
|
date => {setDate(date); setCopied("Copy!");}
|
2021-09-17 18:16:10 +00:00
|
|
|
}
|
|
|
|
dateFormat="dd/MM" />
|
2021-09-17 18:21:45 +00:00
|
|
|
<Heading>Command to set your birthday: </Heading>
|
2021-09-17 18:16:10 +00:00
|
|
|
<Paragraph>{`bd!setup ${Intl.DateTimeFormat().resolvedOptions().timeZone} ${moment(date).format("MM/DD")}`}</Paragraph>
|
2021-09-17 20:03:03 +00:00
|
|
|
<CopyToClipboard onCopy={() => setCopied("Copied!")} text={`bd!setup ${Intl.DateTimeFormat().resolvedOptions().timeZone} ${moment(date).format("MM/DD")}`}>
|
2021-09-17 18:21:45 +00:00
|
|
|
<button className="mx-4 px-4 dark:text-gray-300 dark:bg-gray-500 bg-white">{copied}</button>
|
2021-09-17 18:16:10 +00:00
|
|
|
</CopyToClipboard>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|