Skip to content

Commit

Permalink
Merge pull request #57 from UoaWDCC/josef/sponsor-board
Browse files Browse the repository at this point in the history
Josef/sponsor board
  • Loading branch information
Kinzi-c authored Aug 28, 2024
2 parents 0186818 + 91ec5fb commit 9b487f1
Show file tree
Hide file tree
Showing 19 changed files with 424 additions and 27 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added web/public/sponsor_placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/3m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/AMK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/altair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/altium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/ansys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/c-tech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/cadpro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/crown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/tengtools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sponsors_placeholder/tradezone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 26 additions & 21 deletions web/src/app/components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface FilterProps {
filterFields: string[];
setFilterFields: (filterFields: string[]) => void;
color?: string;
useRoles?: boolean;
}

const Filter: FC<FilterProps> = ({
Expand All @@ -17,6 +18,7 @@ const Filter: FC<FilterProps> = ({
filterFields,
setFilterFields,
color = '#0091ff',
useRoles = true,
}) => {
const roles = [
{ value: 'internship', label: 'Internship' },
Expand All @@ -37,6 +39,7 @@ const Filter: FC<FilterProps> = ({
const openModal = () => setIsModalOpen(true);
const closeModal = () => setIsModalOpen(false);
const [isPortrait, setIsPortrait] = useState(window.innerHeight > window.innerWidth);
const [useRolesFilter, setUseRolesFilter] = useState(useRoles);

return (
<>
Expand All @@ -45,31 +48,33 @@ const Filter: FC<FilterProps> = ({
<Title fs="italic" className={styles.filterHeading}>
Filters
</Title>
<Stack>
<Checkbox.Group
value={filterRoles}
onChange={setFilterRoles}
label="Role Type"
labelProps={{ style: { color: color } }}
classNames={{ label: styles.filterSubheading }}
>
{roles.map((role) => (
<Checkbox
key={role.value}
value={role.value}
label={role.label}
color={color}
className={styles.checkbox}
size="md"
/>
))}
</Checkbox.Group>
</Stack>
{useRolesFilter ? (
<Stack>
<Checkbox.Group
value={filterRoles}
onChange={setFilterRoles}
label="Role Type"
labelProps={{ style: { color: color } }}
classNames={{ label: styles.filterSubheading }}
>
{roles.map((role) => (
<Checkbox
key={role.value}
value={role.value}
label={role.label}
color={color}
className={styles.checkbox}
size="md"
/>
))}
</Checkbox.Group>
</Stack>
) : null}
<Stack>
<Checkbox.Group
value={filterFields}
onChange={setFilterFields}
label="Fields"
label={useRoles ? 'Fields' : 'Industry'}
labelProps={{ style: { color: color } }}
classNames={{ label: styles.filterSubheading }}
>
Expand Down
11 changes: 11 additions & 0 deletions web/src/app/components/SponsorBoard/SponsorBoard.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.text {
position: relative;
color: var(--mantine-color-customWhite-1);
}

.paginationContainer {
display: flex;
width: 100%;
flex-direction: column;
align-items: center;
}
82 changes: 82 additions & 0 deletions web/src/app/components/SponsorBoard/SponsorBoardCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { Text, Button, Paper, Flex, Container, AspectRatio } from '@mantine/core';
import styles from './SponsorBoard.module.css';
import { Image } from '@mantine/core';

// dummy data -- change later when we have real data
export interface SponsorBoardCardProps {
sponsorTitle: string;
imageLink: string;
sponsorIndsutry: string;
sponsorLink: string;
}

export function SponsorBoardCard({
data,
isOneColumn,
}: {
data: SponsorBoardCardProps;
isOneColumn?: boolean;
}) {
const handleSponsorLink = () => {
console.log('Sponsor Link: ', data.sponsorLink);
};

return (
<Paper p="md" radius="md" w={'95%'} h={'100%'}>
<Flex
direction={isOneColumn ? 'row' : 'column'}
w={'100%'}
h={'100%'}
justify={'space-between'}
>
{/* Sponsor Title */}
<Container
w={{ base: '100%', sm: '80%', md: '80%', lg: '100%', xl: '100%' }}
h="auto"
style={{ overflow: 'hidden', flex: isOneColumn ? 1 : 'auto' }}
pl={isOneColumn ? '0' : 'auto'}
>
<AspectRatio ratio={4 / 3}>
<Image
src={data.imageLink}
alt="sponsor image"
fallbackSrc="/sponsor_placeholder.png"
radius="md"
width="100%"
height="100%"
fit="contain"
/>
</AspectRatio>
</Container>
{/* Right Container (on one column layout) */}
<Flex
direction={'column'}
justify={isOneColumn ? 'space-evenly' : 'space-between'}
style={{ flex: isOneColumn ? 2 : 'auto' }}
>
<Flex justify={'space-between'}>
{/* Sponsor Title */}
<Text fw={500} size="xl" className={styles.text} ml={isOneColumn ? 'auto': 'xs'}>
{data.sponsorTitle}
</Text>
</Flex>

{/* Button */}
<Button
color="blue"
mt="xs"
mr="md"
radius="lg"
size="compact-md"
onClick={handleSponsorLink}
w="100%"
>
{data.sponsorIndsutry}
</Button>
</Flex>
</Flex>
</Paper>
);
}

export default SponsorBoardCard;
Loading

0 comments on commit 9b487f1

Please sign in to comment.