index.community/frontend/src/components/atoms/GraphHideEdgesButton.tsx

20 lines
596 B
TypeScript
Raw Normal View History

2019-08-04 12:41:44 +00:00
import { Switch } from "@blueprintjs/core";
import * as React from "react";
import styled from "styled-components";
import FloatingCard from "./FloatingCard";
const StyledSwitch = styled(Switch)`
margin: 0;
`;
2020-05-19 13:45:27 +00:00
interface GraphHideEdgesButtonProps {
2019-08-04 12:41:44 +00:00
isShowingEdges: boolean;
toggleEdges: () => void;
}
2020-05-19 13:45:27 +00:00
const GraphHideEdgesButton: React.FC<GraphHideEdgesButtonProps> = ({ isShowingEdges, toggleEdges }) => (
2019-08-04 12:41:44 +00:00
<FloatingCard>
2020-04-21 19:31:29 +00:00
<StyledSwitch checked={isShowingEdges} label="Show connections" onChange={toggleEdges} tabIndex={-1} />
2019-08-04 12:41:44 +00:00
</FloatingCard>
);
export default GraphHideEdgesButton;