Skip to content

Commit

Permalink
making api and lib work
Browse files Browse the repository at this point in the history
  • Loading branch information
szeckirjr committed Jan 29, 2024
1 parent 528a406 commit fd9218f
Show file tree
Hide file tree
Showing 7 changed files with 1,563 additions and 1,449 deletions.
58 changes: 41 additions & 17 deletions components/explore/ExplorePage.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
import { Box, Flex, Heading } from "@chakra-ui/react";
import { Box, Flex, Heading } from '@chakra-ui/react';

import {SubjectsList} from "common/layouts/sidebar/components/SubjectsList";
import { Term } from 'lib/fetchers';
import { getReadableTerm } from 'lib/utils/terms';

import { getSubjects } from "@courseup/lib/subjects";
type Props = {
term: Term;
subjects: {
subject: string;
title: string;
}[];
};

export default function ExplorePage({subjects}: {
subjects: {
subject: string,
title: string
}[]
}): JSX.Element {

return <Flex wrap='wrap' gap={6}>
{subjects.map((subject) => (
<Box as="a" href="https://google.com/" key={subject.subject} minW={200} w="20%" minH={100} flexGrow={1} p={6} borderRadius='lg' shadow='lg' transition='0.5s' _hover={{shadow: '2xl'}}>
<Heading size='md'>{subject.title}</Heading>
</Box>
))}
export default function ExplorePage({ term, subjects }: Props) {
return (
<Flex wrap="wrap" gap={6}>
{subjects && subjects.length > 1 ? (
subjects.map((subject) => (
<Box
as="a"
href={`/explore/${term}/${subject.subject}`}
key={subject.subject}
minW={200}
w="20%"
minH={100}
flexGrow={1}
p={6}
borderRadius="lg"
shadow="md"
transition="0.5s"
_hover={{ shadow: 'xl' }}
>
<Heading size="md" color="black">
{subject.title}
</Heading>
</Box>
))
) : (
<Box minW={200} w="20%" minH={100} flexGrow={1} p={6} borderRadius="lg" transition="0.5s">
<Heading size="md">No subjects found for {getReadableTerm(term)}</Heading>
</Box>
)}
</Flex>
}
);
}
1 change: 1 addition & 0 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
parserOptions: {
project: ['tsconfig.json', 'tsconfig.dev.json'],
sourceType: 'module',
tsconfigRootDir: __dirname,
},
ignorePatterns: [
'/lib/**/*', // Ignore built files.
Expand Down
Loading

0 comments on commit fd9218f

Please sign in to comment.