Skip to content

Commit

Permalink
Merge branch 'react-django' of github.com:AI4Bharat/ai4b-website into…
Browse files Browse the repository at this point in the history
… react-django
  • Loading branch information
Shanks0465 committed Aug 30, 2024
2 parents 5502005 + 83561fb commit ec8d002
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 28 deletions.
26 changes: 21 additions & 5 deletions frontend/components/AreaTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ const AreaTimeline = ({ data }: { data: Array<Publication> }) => {
const isDesktop = useBreakpointValue({ base: false, md: true });

return (
<Container maxWidth="7xl" p={{ base: 1, sm: 5 }}>
<Container
height={isMobile ? 500 : "auto"}
overflowY={"scroll"}
maxWidth="7xl"
p={{ base: 1, sm: 5 }}
>
<chakra.h3 fontSize="4xl" fontWeight="bold" mb={18} textAlign="center">
Timeline
</chakra.h3>
Expand Down Expand Up @@ -186,16 +191,27 @@ const Card = ({
</chakra.h1>
<ExpandableText noOfLines={2} text={description} />
<HStack>
<Link target="_blank" href={github_link}>
<FaGithub size={25} />
</Link>
{github_link ? (
<Link target="_blank" href={github_link}>
<FaGithub size={25} />
</Link>
) : (
<></>
)}
<Link target="_blank" href={paper_link}>
<FaPaperclip size={25} />
</Link>
{hf_id === null ? (
<></>
) : (
<Link target="_blank" href={`https://huggingface.co/${hf_id}`}>
<Link
target="_blank"
href={
type === "Model"
? `https://huggingface.co/${hf_id}`
: `https://huggingface.co/datasets/${hf_id}`
}
>
<img
src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
alt="Hugging Face"
Expand Down
11 changes: 9 additions & 2 deletions frontend/components/Datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
SkeletonText,
Link,
Image as ChakraImage,
useBreakpointValue,
} from "@chakra-ui/react";
import Image from "next/image";
import axios from "axios";
Expand Down Expand Up @@ -87,6 +88,7 @@ const fetchDatasets = async () => {
};

export default function Datasets() {
const isMobile = useBreakpointValue({ base: true, md: false });
const [datasets, setDatasets] = useState([]);
const { isLoading, error, data } = useQuery("fetchDatasets", fetchDatasets);

Expand Down Expand Up @@ -170,7 +172,7 @@ export default function Datasets() {
</Stack>
{isLoading ? (
<SimpleGrid columns={{ base: 1, md: 3 }} spacing={10}>
{Array.from({ length: 1 }, (_, index) => (
{Array.from({ length: 13 }, (_, index) => (
<Card
key={index}
border={"solid"}
Expand All @@ -186,7 +188,12 @@ export default function Datasets() {
))}
</SimpleGrid>
) : (
<SimpleGrid columns={{ base: 1, md: 3 }} spacing={10}>
<SimpleGrid
height={isMobile ? 500 : "auto"}
columns={{ base: 1, md: 3 }}
spacing={10}
overflowY={"scroll"}
>
{datasets.map((dataset: Dataset) => (
<Card key={dataset.title} border={"solid"} borderColor={"orange"}>
<CardBody>
Expand Down
4 changes: 1 addition & 3 deletions frontend/components/Tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ const ToolsList = () => {
<chakra.h3 fontWeight="semibold" fontSize="2xl" mt={6}>
{tool.title}
</chakra.h3>
<Text fontSize="md" mt={4}>
{tool.description}
</Text>
<Text>{tool.description}</Text>
<br />
<Link href={`${imagePrefix}/tools/${tool.title}`}>
Learn more →
Expand Down
44 changes: 26 additions & 18 deletions frontend/src/app/publications/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
useColorModeValue,
Button,
Stack,
useBreakpointValue,
} from "@chakra-ui/react";
import { FaPaperclip, FaGithub } from "react-icons/fa";
import { useQuery } from "react-query";
Expand Down Expand Up @@ -75,6 +76,7 @@ interface Publication {
}

const Publications = () => {
const isMobile = useBreakpointValue({ base: true, md: false });
const [filters, setFilters] = useState({
areas: [],
conferences: [],
Expand Down Expand Up @@ -186,21 +188,23 @@ const Publications = () => {
</Button>
</Stack>
<br />
{filteredPublications.map((pub, index) => (
<Flex key={index} mb="10px">
<LineWithDot />
<Card
title={pub.title}
categories={[pub.area, pub.conference]}
description={pub.description}
date={new Date(pub.published_on).toDateString()}
hf_id={pub.hf_id}
paper_link={pub.paper_link}
github_link={pub.github_link}
type={pub.type}
/>
</Flex>
))}
<Container height={isMobile ? 500 : "auto"} overflowY={"scroll"}>
{filteredPublications.map((pub, index) => (
<Flex key={index} mb="10px">
<LineWithDot />
<Card
title={pub.title}
categories={[pub.area, pub.conference]}
description={pub.description}
date={new Date(pub.published_on).toDateString()}
hf_id={pub.hf_id}
paper_link={pub.paper_link}
github_link={pub.github_link}
type={pub.type}
/>
</Flex>
))}
</Container>
</Container>
);
};
Expand Down Expand Up @@ -270,9 +274,13 @@ const Card = ({
</chakra.h1>
<ExpandableText noOfLines={2} text={description} />
<HStack>
<Link target="_blank" href={github_link}>
<FaGithub size={50} />
</Link>
{github_link ? (
<Link target="_blank" href={github_link}>
<FaGithub size={50} />
</Link>
) : (
<></>
)}
<Link target="_blank" href={paper_link}>
<FaPaperclip size={50} />
</Link>
Expand Down

0 comments on commit ec8d002

Please sign in to comment.