Skip to content

Commit

Permalink
Jamakase/add credits page (#6686)
Browse files Browse the repository at this point in the history
* Create credits route

* Add base components to credits page

* Add bar chart

* Add link to sidebar
  • Loading branch information
jamakase authored Oct 4, 2021
1 parent f7f5d75 commit 34941a8
Show file tree
Hide file tree
Showing 19 changed files with 566 additions and 17 deletions.
219 changes: 212 additions & 7 deletions airbyte-webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions airbyte-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"react-use": "^15.3.8",
"react-use-intercom": "^1.4.0",
"react-widgets": "^4.6.1",
"recharts": "^2.1.3",
"rest-hooks": "^5.0.20",
"sanitize-html": "^2.3.3",
"styled-components": "^5.1.1",
Expand Down
51 changes: 51 additions & 0 deletions airbyte-webapp/src/components/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from "react";
import {
CartesianGrid,
BarChart as BasicBarChart,
ResponsiveContainer,
XAxis,
YAxis,
Bar,
} from "recharts";
import { barChartColors, theme } from "theme";

type BarChartProps = {
data?: {
name: string;
value: number | number[];
}[];
legendLabels: string[];
};

const BarChart: React.FC<BarChartProps> = ({ data, legendLabels }) => {
const chartLinesColor = theme.greyColor20;
const chartTicksColor = theme.lightTextColor;

return (
<ResponsiveContainer>
<BasicBarChart data={data} margin={{ right: 12 }}>
<CartesianGrid vertical={false} stroke={chartLinesColor} />
<XAxis
dataKey="name"
axisLine={false}
tickLine={false}
stroke={chartTicksColor}
tick={{ fontSize: "11px" }}
tickSize={10}
/>
<YAxis
axisLine={false}
tickLine={false}
stroke={chartTicksColor}
tick={{ fontSize: "11px" }}
tickSize={10}
/>
{legendLabels.map((barName, key) => (
<Bar dataKey={barName} fill={barChartColors[key]} />
))}
</BasicBarChart>
</ResponsiveContainer>
);
};

export default React.memo(BarChart);
4 changes: 4 additions & 0 deletions airbyte-webapp/src/components/BarChart/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import BarChart from "./BarChart";

export default BarChart;
export { BarChart };
Loading

0 comments on commit 34941a8

Please sign in to comment.