Skip to content

Commit

Permalink
Merge pull request #1840 from ResearchHub/bounties-page
Browse files Browse the repository at this point in the history
Enable bounties page
  • Loading branch information
yattias authored Sep 25, 2024
2 parents ee097e3 + 520bbcb commit ff409cf
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 97 deletions.
6 changes: 3 additions & 3 deletions components/Bounty/api/fetchBountiesAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { PaginatedApiResponse } from "~/config/types/root_types";

type Args = {
personalized?: boolean;
page?: number;
pageCursor?: string | null;
status?: string;
};

export const fetchBounties = ({ personalized = true, page, status = 'OPEN' }: Args): Promise<PaginatedApiResponse> => {
const url = generateApiUrl(`bounty?status=${status}`) + (personalized ? '&personalized=true' : '');
export const fetchBounties = ({ personalized = true, pageCursor = null, status = 'OPEN' }: Args): Promise<PaginatedApiResponse> => {
const url = pageCursor || generateApiUrl(`bounty?status=${status}${personalized ? '&personalized=true' : ''}`);

return fetch(url, API.GET_CONFIG())
.then(Helpers.checkStatus)
Expand Down
57 changes: 18 additions & 39 deletions components/Home/sidebar/RootLeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
faArrowLeftToLine,
faArrowRightToLine,
faGrid2,
faHandHoldingDollar,
faHouse,
faTableTree,
faWavePulse,
Expand Down Expand Up @@ -50,6 +51,7 @@ import NewPostButton from "~/components/NewPostButton";
import NewPostModal from "~/components/Modals/NewPostModal";
import { ROUTES as WS_ROUTES } from "~/config/ws";
import VerifyIdentityModal from "~/components/Verification/VerifyIdentityModal";
import ResearchCoinIcon from "~/components/Icons/ResearchCoinIcon";

type Props = {
openLoginModal: any;
Expand Down Expand Up @@ -104,30 +106,17 @@ export const getLeftSidebarItemAttrs = ({
onClick: silentEmptyFnc,
},
{
icon: ["/funding"].includes(pathname) ? (
<img
src="/static/rsc-icon-dark-blue.svg"
width="24"
height="24"
style={{
marginLeft: "-2px",
}}
/>
) : (
<img
src="/static/rsc-icon-gray.svg"
width="24"
height="24"
style={{
marginLeft: "-2px",
}}
/>
),
icon: <ResearchCoinIcon height={21} width={21} version={4} color={["/bounties"].includes(pathname) ? colors.NEW_BLUE() : "#C1C1CF"}></ResearchCoinIcon>,
label: "Bounties",
isActive: ["/bounties"].includes(pathname),
isMinimized,
href: "/bounties",
onClick: silentEmptyFnc,
},
{
icon: <FontAwesomeIcon icon={faHandHoldingDollar}></FontAwesomeIcon>,
label: "Funding",
isActive: ["/funding"].includes(pathname),
// let's show this for 15 days, after that it'll programmatically be hidden.
// if you're seeing this after the date below, please remove this code.
showNewFeatureIndicator: new Date() < new Date("2024-03-21"),
isMinimized,
href: "/funding",
onClick: silentEmptyFnc,
Expand Down Expand Up @@ -294,9 +283,12 @@ function RootLeftSidebar({
ind: number
): ReactElement<typeof RootLeftSidebarItem> => (
<>
{attrs.label === "Funding" && !isMinimized && (
<div className={css(styles.subheader)}>Tools</div>
{attrs.label === "Bounties" && !isMinimized && (
<div className={css(styles.subheader)}>ResearchCoin</div>
)}
{attrs.label === "Lab Notebook" && !isMinimized && (
<div className={css(styles.subheader)}>Tools</div>
)}
<RootLeftSidebarItem key={`${attrs.label}-${ind}`} {...attrs} />
</>
)
Expand Down Expand Up @@ -455,13 +447,6 @@ function RootLeftSidebar({
<ALink href="/about" overrideStyle={formattedFooterTxtItem}>
{"About"}
</ALink>
<ALink
href="https://docs.researchhub.com/"
target="_blank"
overrideStyle={formattedFooterTxtItem}
>
{"Docs"}
</ALink>
<ALink
href="https://researchhub.foundation"
overrideStyle={formattedFooterTxtItem}
Expand Down Expand Up @@ -505,12 +490,6 @@ function RootLeftSidebar({
>
{isMinimized ? "Top" : "Leaderboard"}
</ALink> */}
<ALink
href="https://researchhub.notion.site/Working-at-ResearchHub-6e0089f0e234407389eb889d342e5049"
overrideStyle={formattedFooterTxtItem}
>
{"Jobs"}
</ALink>
</div>
<div className={css(styles.footer)}>
<div className={formattedFooterItemsButtonRow}>
Expand Down Expand Up @@ -564,10 +543,10 @@ function RootLeftSidebar({
{"Issues"}
</ALink>
<ALink
href="https://researchhub.notion.site/ResearchHub-a2a87270ebcf43ffb4b6050e3b766ba0"
href="https://docs.researchhub.com/"
overrideStyle={styles.leftSidebarFooterBotItem}
>
{"Help"}
{"Docs"}
</ALink>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion components/Home/sidebar/RootLeftSidebarSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ function RootLeftSidebarSlider({
ind: number
): ReactElement<typeof RootLeftSidebarSliderItem> => (
<>
{attrs.label === "Funding" && (
{attrs.label === "Bounties" && (
<div className={css(styles.subheader)}>ResearchCoin</div>
)}
{attrs.label === "Lab Notebook" && (
<div className={css(styles.subheader)}>Tools</div>
)}
<RootLeftSidebarSliderItem key={`${attrs.label}-${ind}`} {...attrs} />
Expand Down
3 changes: 3 additions & 0 deletions components/HorizontalTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ const styles = StyleSheet.create({
"::-webkit-scrollbar": {
display: "none",
},
[`@media only screen and (max-width: ${breakpoints.small.str})`]: {
maxWidth: "93vw",
}
},
tab: {
color: colors.MEDIUM_GREY(1.0),
Expand Down
21 changes: 1 addition & 20 deletions components/UnifiedDocFeed/FeedInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,7 @@ export default function FeedInfoCard({
/>
</div>
)}
<div className={css(styles.detailRow, styles.metadata)}>
<div className={css(styles.dataPoint)}>
{/* @ts-ignore */}
<PaperIcon height={13} width={14} color="#918F9B" />
<span>
{numPapers === 1 ? `${numPapers} Paper` : `${numPapers} Papers`}
</span>
</div>
<div className={css(styles.dataPoint)}>
<FontAwesomeIcon
icon={faComments}
style={{ color: "#918F9B", fontSize: 12 }}
/>
<span>
{numComments === 1
? `${numComments} Discussion`
: `${numComments} Discussions`}
</span>
</div>
</div>

</div>
</div>
);
Expand Down
Loading

0 comments on commit ff409cf

Please sign in to comment.