forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'datahub-project:master' into master
- Loading branch information
Showing
7 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
docs-website/src/pages/_components/TownhallButton/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! ✨ | ||
</Link> | ||
) | ||
); | ||
}; | ||
|
||
export default TownhallButton; |
14 changes: 14 additions & 0 deletions
14
docs-website/src/pages/_components/TownhallButton/townhallbutton.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters