Skip to content

Commit

Permalink
Merge branch 'master' into docs/contents-revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonhyejin authored Nov 23, 2023
2 parents 5ad6929 + 37ea292 commit ba5aa72
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs-website/src/pages/_components/Hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { QuestionCircleOutlined } from "@ant-design/icons";
import styles from "./hero.module.scss";
import CodeBlock from "@theme/CodeBlock";
import CardCTAs from "../CardCTAs";
import TownhallButton from "../TownhallButton";

const HeroAnnouncement = ({ message, linkUrl, linkText }) => (
<div className={clsx("hero__alert alert alert--primary", styles.hero__alert)}>
Expand Down Expand Up @@ -46,6 +47,7 @@ const Hero = ({}) => {
<Link className="button button--secondary button--md" to="https://slack.datahubproject.io">
Join our Slack
</Link>
<TownhallButton />
</div>
</div>
<CardCTAs />
Expand Down
31 changes: 31 additions & 0 deletions docs-website/src/pages/_components/TownhallButton/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import styles from "./townhallbutton.module.scss";
import clsx from "clsx";
import Link from "@docusaurus/Link";

const TownhallButton = () => {
const today = new Date();
const currentDay = today.getDate();
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
const lastThursday = lastDayOfMonth.getDate() - ((lastDayOfMonth.getDay() + 7 - 4) % 7);

const daysUntilLastThursday = lastThursday - currentDay;

let showButton = false;
let currentMonth = '';

if (daysUntilLastThursday > 0 && daysUntilLastThursday <= 14) {
showButton = true;
currentMonth = new Intl.DateTimeFormat('en-US', { month: 'long' }).format(today);
}

return (
showButton && (
<Link to="http://rsvp.datahubproject.io" className={clsx('button button--primary button--md', styles.feature)}>
Join {currentMonth} Townhall!&nbsp;✨
</Link>
)
);
};

export default TownhallButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.feature {
color: white;
border: 1px solid transparent;
background-image: linear-gradient(to right, #1890ff 0%, #9c27b0 100%);
background-origin: border-box;
opacity: 90%;

&:hover {
opacity: 100%;
background: linear-gradient(to right, #1890ff 0%, #9c27b0 100%);
background-image: linear-gradient(to right, #1890ff 0%, #9c27b0 100%);
background-origin: border-box;
}
}

0 comments on commit ba5aa72

Please sign in to comment.