Skip to content

Commit

Permalink
Merge pull request #1890 from ResearchHub/journal-now
Browse files Browse the repository at this point in the history
Updating journal page to allow posting via modal
  • Loading branch information
yattias authored Nov 27, 2024
2 parents d721e06 + a088198 commit 2f7faca
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pages/researchhub-journal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import ScrollingHubTags from "~/components/ResearchHubJournal/ScrollingHubTags";
import { useState } from "react";
import { useRouter } from 'next/router';
import JournalLayout from "~/components/ResearchHubJournal/JournalLayout";
import PaperVersionModal from "~/components/Document/lib/PaperVersion/PaperVersionModal";
import { ACTION } from "~/components/Document/lib/PaperVersion/PaperVersionTypes";

function ResearchHubJournalPage(): JSX.Element {
const router = useRouter();
const [showPaperModal, setShowPaperModal] = useState(false);

const scrollToHowItWorks = () => {
const howItWorksSection = document.getElementById('how-it-works');
Expand Down Expand Up @@ -42,7 +45,7 @@ function ResearchHubJournalPage(): JSX.Element {
<div className={css(styles.hero)}>
<div className={css(styles.heroContent)}>
<div className={css(styles.heroTagWrapper)}>
<div className={css(styles.heroTag)}>Coming Soon</div>
<div className={css(styles.heroTag)}>Available Now</div>
</div>

<div className={css(styles.titleContainer)}>
Expand All @@ -56,10 +59,10 @@ function ResearchHubJournalPage(): JSX.Element {

<div className={css(styles.heroButtons)}>
<button
onClick={() => window.open('https://forms.gle/3x1F6Gj4pxoDUHU19', '_blank')}
onClick={() => setShowPaperModal(true)}
className={css(styles.primaryButton)}
>
Submit Early
Submit Now
</button>
<button
onClick={scrollToHowItWorks}
Expand Down Expand Up @@ -141,6 +144,14 @@ function ResearchHubJournalPage(): JSX.Element {
<div id="how-it-works" className={css(styles.subtleGradientSection)}>
<HowItWorks />
</div>

{showPaperModal && (
<PaperVersionModal
isOpen={showPaperModal}
closeModal={() => setShowPaperModal(false)}
action="PUBLISH_IN_JOURNAL"
/>
)}
</div>
</JournalLayout>
);
Expand Down

0 comments on commit 2f7faca

Please sign in to comment.