Skip to content

Commit

Permalink
[front-end] add CwmLogo component and update map attribution control
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0ur1s authored and rogup committed Nov 22, 2024
1 parent 199fd49 commit f8128df
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 2 deletions.
58 changes: 58 additions & 0 deletions apps/front-end/src/components/common/cwmLogo/CwmLogo.tsx
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.
2 changes: 1 addition & 1 deletion apps/front-end/src/components/map/mapLibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export const createMap = (

map.fire("changeLanguage", { language: getLanguageFromUrl() });

map.addControl(new AttributionControl(), "top-right");
map.addControl(new AttributionControl({ compact: true } ), "top-right");
map.addControl(new NavigationControl(), "top-right");
disableRotation(map);
});
Expand Down
1 change: 0 additions & 1 deletion apps/front-end/src/logo.svg

This file was deleted.

0 comments on commit f8128df

Please sign in to comment.