This is an automated email from the ASF dual-hosted git repository. leonardcs pushed a commit to branch feature/homepage in repository https://gitbox.apache.org/repos/asf/incubator-baremaps-site.git
commit 521e1f10adcffb8577b5013d8b823d5e0c27bcb6 Author: Leonard <[email protected]> AuthorDate: Tue Jul 4 15:51:00 2023 +0200 Add copyright component --- src/components/Copyright/index.tsx | 32 +++++++++++++++++++++++++++++++ src/components/Copyright/style.module.css | 16 ++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/components/Copyright/index.tsx b/src/components/Copyright/index.tsx new file mode 100644 index 0000000..84bd526 --- /dev/null +++ b/src/components/Copyright/index.tsx @@ -0,0 +1,32 @@ +import cn from 'clsx'; + +import styles from './style.module.css'; + +interface CopyrightProps { + copyrights: { + name: string; + url: string; + }[]; +} + +export const Copyright: React.FC<CopyrightProps> = ({ copyrights }) => { + return ( + <div + className={cn( + 'maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner', + styles.copyright + )} + > + {copyrights.map((c, i) => { + return ( + <span key={i}> + {'© '} + <a href={c.url} target="_blank" rel="noopener noreferrer"> + {c.name} + </a> + </span> + ); + })} + </div> + ); +}; diff --git a/src/components/Copyright/style.module.css b/src/components/Copyright/style.module.css new file mode 100644 index 0000000..58339e7 --- /dev/null +++ b/src/components/Copyright/style.module.css @@ -0,0 +1,16 @@ +.copyright { + position: absolute; + left: 0; + bottom: 0; + z-index: 1; + margin: 0.5rem; + padding: 0.2rem 0.4rem; + border-radius: 9999px; + background-color: white; + font-size: 0.75rem; + color: black; +} + +.copyright a:hover { + text-decoration: underline; +}
