Skip to content

Commit

Permalink
code merge
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewsmawfield committed Dec 5, 2023
1 parent f7922c7 commit 2283b1b
Show file tree
Hide file tree
Showing 10 changed files with 2,068 additions and 45,623 deletions.
3 changes: 2 additions & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
},
"homepage": "https://github.com/the-deep/reporting-module-map-vizzard#readme",
"dependencies": {
"@babel/runtime-corejs3": "^7.22.3"
"@babel/runtime-corejs3": "^7.22.3",
"@rollup/plugin-image": "^3.0.3"
},
"peerDependencies": {
"react": "^18.2.0",
Expand Down
3 changes: 2 additions & 1 deletion lib/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import filesize from 'rollup-plugin-filesize';
import eslint from '@rollup/plugin-eslint';
import image from '@rollup/plugin-image';
// import copy from 'rollup-plugin-copy';

import postcssPresetEnv from 'postcss-preset-env';
import postcssNested from 'postcss-nested';
import postcssNormalize from 'postcss-normalize';
Expand Down Expand Up @@ -43,6 +43,7 @@ const PLUGINS = [
}),
commonjs(),
filesize(),
image(),
/*
copy({
targets: [
Expand Down
8 changes: 7 additions & 1 deletion lib/src/KPIs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import styles from './styles.module.css';
import externalLink from './external-link.svg';

export interface Props {
data: {
Expand All @@ -11,6 +12,7 @@ export interface Props {
source: string;
backgroundColor: string;
color: string;
url: string;
}[],
},
}
Expand All @@ -20,6 +22,7 @@ function KPIs({ data }: Props) {
<div
// FIXME: Add key
className={styles.item}
key={`${d.title}${d.value}`}
style={{ backgroundColor: d.backgroundColor, color: d.color }}
>
<div className={styles.title}>
Expand All @@ -36,7 +39,10 @@ function KPIs({ data }: Props) {
{d.date}
</div>
<div className={styles.source}>
{d.source}
<a href={d.url} target="_blank" rel="noreferrer">
<img className="kpi_external_link" src={externalLink} alt="Link to data souce" />
{d.source}
</a>
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions lib/src/declarations/css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ declare module '*.css' {
const content: {[className: string]: string};
export default content;
}

declare module '*.svg';
Loading

0 comments on commit 2283b1b

Please sign in to comment.