-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a knowledge base card on the overview page
- Loading branch information
Showing
6 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2024 Peter Beverloo & AnimeCon. All rights reserved. | ||
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
|
||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
|
||
import Box from '@mui/material/Box'; | ||
import Card from '@mui/material/Card'; | ||
import CardActionArea from '@mui/material/CardActionArea'; | ||
import CardContent from '@mui/material/CardContent'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
/** | ||
* Props accepted by the <KnowledgeBaseCard> component. | ||
*/ | ||
export interface KnowledgeBaseCardProps { | ||
/** | ||
* Slug of the event for which the card is being shown. | ||
*/ | ||
slug: string; | ||
} | ||
|
||
/** | ||
* The <KnowledgeBaseCard> displays a card allowing volunteers on mobile devices to enter the | ||
* Knowledge Base. A card is used as there is no space for a menu option. | ||
*/ | ||
export function KnowledgeBaseCard(props: KnowledgeBaseCardProps) { | ||
return ( | ||
<Card> | ||
<CardActionArea LinkComponent={Link} href={`/schedule/${props.slug}/knowledge`}> | ||
<Box sx={{ | ||
backgroundImage: 'url(/images/knowledge-base.jpg)', | ||
backgroundPosition: 'center', | ||
backgroundSize: 'cover', | ||
width: '100%', | ||
aspectRatio: 4 }} /> | ||
<CardContent> | ||
<Typography variant="body2" sx={{ color: 'text.secondary' }}> | ||
Check out the brand new <strong>Knowledge Base</strong>, where you can find | ||
answers to the most frequently asked questions by visitors! | ||
</Typography> | ||
</CardContent> | ||
</CardActionArea> | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2024 Peter Beverloo & AnimeCon. All rights reserved. | ||
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
|
||
'use client'; | ||
|
||
import useMediaQuery from '@mui/material/useMediaQuery'; | ||
|
||
/** | ||
* Returns whether the page is being shown on a mobile device. | ||
*/ | ||
export function useIsMobile(): boolean { | ||
return useMediaQuery((theme: any) => theme.breakpoints.down('md')); | ||
} |
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.