Skip to content

Commit

Permalink
Merge pull request #1841 from ResearchHub/journals-page
Browse files Browse the repository at this point in the history
Enable Journals page in left sidebar
  • Loading branch information
yattias authored Sep 25, 2024
2 parents ff409cf + ceb5931 commit 07cbacd
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 54 deletions.
74 changes: 32 additions & 42 deletions components/Home/sidebar/RootLeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
faGrid2,
faHandHoldingDollar,
faHouse,
faNewspaper,
faTableTree,
faWavePulse,
} from "@fortawesome/pro-solid-svg-icons";
Expand Down Expand Up @@ -97,14 +98,6 @@ export const getLeftSidebarItemAttrs = ({
href: "/live",
onClick: silentEmptyFnc,
},
{
icon: <FontAwesomeIcon icon={faGrid2}></FontAwesomeIcon>,
label: "Hubs",
isActive: ["/hubs"].includes(pathname),
isMinimized,
href: "/hubs",
onClick: silentEmptyFnc,
},
{
icon: <ResearchCoinIcon height={21} width={21} version={4} color={["/bounties"].includes(pathname) ? colors.NEW_BLUE() : "#C1C1CF"}></ResearchCoinIcon>,
label: "Bounties",
Expand All @@ -121,6 +114,22 @@ export const getLeftSidebarItemAttrs = ({
href: "/funding",
onClick: silentEmptyFnc,
},
{
icon: <FontAwesomeIcon icon={faNewspaper}></FontAwesomeIcon>,
label: "Journals",
isActive: ["/journals"].includes(pathname),
isMinimized,
href: "/journals",
onClick: silentEmptyFnc,
},
{
icon: <FontAwesomeIcon icon={faGrid2}></FontAwesomeIcon>,
label: "Hubs",
isActive: ["/hubs"].includes(pathname),
isMinimized,
href: "/hubs",
onClick: silentEmptyFnc,
},
{
icon: <FontAwesomeIcon icon={faBook}></FontAwesomeIcon>,
label: "Lab Notebook",
Expand Down Expand Up @@ -283,6 +292,9 @@ function RootLeftSidebar({
ind: number
): ReactElement<typeof RootLeftSidebarItem> => (
<>
{attrs.label === "Journals" && !isMinimized && (
<div className={css(styles.subheader)}>Browse</div>
)}
{attrs.label === "Bounties" && !isMinimized && (
<div className={css(styles.subheader)}>ResearchCoin</div>
)}
Expand Down Expand Up @@ -444,16 +456,6 @@ function RootLeftSidebar({
</span>
</InviteButton>
</span> */}
<ALink href="/about" overrideStyle={formattedFooterTxtItem}>
{"About"}
</ALink>
<ALink
href="https://researchhub.foundation"
overrideStyle={formattedFooterTxtItem}
>
{isMinimized ? "Comm.." : "Community"}
</ALink>

<span className={css(formattedFooterTxtItem)}>
{/* @ts-ignore */}
<VerifyIdentityModal
Expand Down Expand Up @@ -483,7 +485,16 @@ function RootLeftSidebar({
)}
</div>
</VerifyIdentityModal>
</span>
</span>
<ALink
href="https://researchhub.foundation"
overrideStyle={formattedFooterTxtItem}
>
{isMinimized ? "Comm.." : "Community"}
</ALink>
<ALink href="/about" overrideStyle={formattedFooterTxtItem}>
{"About"}
</ALink>
{/* <ALink
href="/leaderboard/users"
overrideStyle={formattedFooterTxtItem}
Expand Down Expand Up @@ -550,27 +561,6 @@ function RootLeftSidebar({
</ALink>
</div>
</div>
{isMinimized ? (
<div
className={css(styles.arrowRight)}
onClick={() => {
setGrowMinimized(false);
setIsMinimized(false);
}}
>
<FontAwesomeIcon icon={faArrowRightToLine}></FontAwesomeIcon>
</div>
) : (
<div
className={css(styles.arrowRight, styles.arrowLeft)}
onClick={() => {
setGrowMinimized(true);
setIsMinimized(true);
}}
>
<FontAwesomeIcon icon={faArrowLeftToLine}></FontAwesomeIcon>
</div>
)}
</div>
</div>
</motion.div>
Expand Down Expand Up @@ -626,7 +616,7 @@ const styles = StyleSheet.create({
},
leftSidebarFooterTxtItem: {
color: colors.TEXT_GREY(1),
fontSize: 16,
fontSize: 15,
fontWeight: 400,
textDecoration: "none",
margin: "0 30px 12px",
Expand All @@ -637,7 +627,7 @@ const styles = StyleSheet.create({
leftSidebarFooterTxtItemMin: {
fontSize: 14,
fontWeight: 300,
margin: "0 auto 12px",
margin: "0 auto 10px",
},
leftSidebarFooterItemsTop: {
display: "flex",
Expand Down
10 changes: 4 additions & 6 deletions components/Home/sidebar/RootLeftSidebarSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ function RootLeftSidebarSlider({
ind: number
): ReactElement<typeof RootLeftSidebarSliderItem> => (
<>
{attrs.label === "Journals" && (
<div className={css(styles.subheader)}>Browse</div>
)}
{attrs.label === "Bounties" && (
<div className={css(styles.subheader)}>ResearchCoin</div>
)}
Expand Down Expand Up @@ -125,18 +128,13 @@ function RootLeftSidebarSlider({
>
Leaderboard
</ALink> */}
<ALink
href="https://www.notion.so/Working-at-ResearchHub-6e0089f0e234407389eb889d342e5049"
overrideStyle={styles.leftSidebarSliderFooterTxtItem}
>
{"Jobs"}
</ALink>
</div>
<div className={css(styles.leftSidebarSliderFooterBottom)}>
<div
className={css(styles.leftSidebarSliderFooterItemsBottomRow)}
style={{ marginLeft: "-4px !important" }}
>

<ALink
href="https://x.com/researchhub"
overrideStyle={styles.leftSidebarSliderFooterIcon}
Expand Down
6 changes: 3 additions & 3 deletions components/Home/sidebar/sidebar_items/RootLeftSidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ const styles = StyleSheet.create({
boxSizing: "border-box",
cursor: "pointer",
display: "flex",
height: 46,
minHeight: 46,
height: 38,
minHeight: 38,
justifyContent: "flex-start",
padding: "0 30px",
width: "100%",
Expand Down Expand Up @@ -162,7 +162,7 @@ const styles = StyleSheet.create({
alignItems: "center",
color: colors.BLACK(1),
display: "flex",
fontSize: 16,
fontSize: 15,
fontWeight: 500,
userSelect: "none",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const styles = StyleSheet.create({
boxSizing: "border-box",
cursor: "pointer",
display: "flex",
height: 48,
height: 44,
justifyContent: "flex-start",
minHeight: 48,
minHeight: 44,
overflow: "hidden",
width: "100%",
textDecoration: "none",
Expand Down Expand Up @@ -98,7 +98,7 @@ const styles = StyleSheet.create({
alignItems: "center",
color: colors.BLACK(1),
display: "flex",
fontSize: 18,
fontSize: 16,
fontWeight: 500,
userSelect: "none",
},
Expand Down

0 comments on commit 07cbacd

Please sign in to comment.