-
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.
- Loading branch information
Showing
6 changed files
with
87 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use client'; | ||
|
||
import CancelIcon from '@mui/icons-material/Cancel'; | ||
import HelpIcon from '@mui/icons-material/Help'; | ||
import React from 'react'; | ||
import { Typography } from '@mui/material'; | ||
|
||
import styled from '@emotion/styled'; | ||
import { useQueryState } from 'nuqs'; | ||
|
||
export default function FAQButton() { | ||
const [faq, setFaq] = useQueryState('faq'); | ||
|
||
return faq ? ( | ||
<StyledButton onClick={() => setFaq(null)}> | ||
<CancelIcon /> <Typography> Back </Typography> | ||
</StyledButton> | ||
) : ( | ||
<StyledButton onClick={() => setFaq('open')}> | ||
<HelpIcon /> <Typography> FAQ </Typography> | ||
</StyledButton> | ||
); | ||
} | ||
|
||
const StyledButton = styled.button` | ||
background: white; | ||
border: 0; | ||
cursor: pointer; | ||
width: 70px; | ||
&:hover { | ||
border-radius: 5px; | ||
outline: 3px solid #0150b4; | ||
p { | ||
font-weight: bold; | ||
} | ||
} | ||
`; |
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,23 @@ | ||
'use client'; | ||
|
||
import { Box } from '@mui/material'; | ||
import FAQ from './FAQ'; | ||
import React from 'react'; | ||
import ViewPicker from './ViewPicker'; | ||
|
||
import { useQueryState } from 'nuqs'; | ||
|
||
export default function FAQContainer() { | ||
const [faqOpen, _] = useQueryState('faq'); | ||
|
||
return ( | ||
<> | ||
{faqOpen && <FAQ />} | ||
|
||
{/* Don't lose state when FAQ is opened */} | ||
<Box sx={{ display: faqOpen ? 'none' : 'block', height: '100%' }}> | ||
<ViewPicker /> | ||
</Box> | ||
</> | ||
); | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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