-
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.
[front-end] add CwmLogo component and update map attribution control
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import CWMLogo from "./cwm-logo.png"; | ||
import CWMLogoSmall from "./cwm-logo-small.png"; | ||
import Box from "@mui/material/Box"; | ||
import { styled } from "@mui/material/styles"; | ||
import useMediaQuery from "@mui/material/useMediaQuery"; | ||
|
||
const StyledLogoWrapper = styled(Box)(() => ({ | ||
position: "fixed", | ||
top: "0", | ||
left: "5px", | ||
zIndex: 0, | ||
"& img": { | ||
width: "100%", | ||
maxWidth: "50px", | ||
"&.small": { | ||
display: "block", | ||
}, | ||
"&.large": { | ||
display: "none", | ||
}, | ||
}, | ||
"@media (min-width: 897px)": { | ||
bottom: "-25px", | ||
right: "-5px", | ||
top: "unset", | ||
left: "unset", | ||
"& img": { | ||
width: "100%", | ||
maxWidth: "150px", | ||
"&.small": { | ||
display: "none", | ||
}, | ||
"&.large": { | ||
display: "block", | ||
}, | ||
}, | ||
}, | ||
})); | ||
|
||
const CwmLogo = () => { | ||
const isMedium = useMediaQuery("(min-width: 897px)"); | ||
return ( | ||
<StyledLogoWrapper> | ||
{isMedium && ( | ||
<img src={CWMLogo} className="large" alt="Cooperative World Map Logo" /> | ||
)} | ||
{!isMedium && ( | ||
<img | ||
src={CWMLogoSmall} | ||
className="small" | ||
alt="Cooperative World Map Logo" | ||
/> | ||
)} | ||
</StyledLogoWrapper> | ||
); | ||
}; | ||
|
||
export default CwmLogo; |
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.
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 was deleted.
Oops, something went wrong.