Use tooltip instead of title and added aria label to DiffButton

This commit is contained in:
Sebastian Sdorra
2020-02-11 08:35:55 +01:00
parent 78e31f690a
commit 73de95efc7
4 changed files with 1690 additions and 1343 deletions

View File

@@ -10,10 +10,16 @@ import { DiffEventContext, File } from "./DiffTypes";
import Toast from "../toast/Toast";
import { getPath } from "./diffs";
import DiffButton from "./DiffButton";
import styled from "styled-components";
const diffFiles = parser.parse(simpleDiff);
const Container = styled.div`
padding: 2rem 6rem;
`;
storiesOf("Diff", module)
.addDecorator(storyFn => <Container>{storyFn()}</Container>)
.add("Default", () => <Diff diff={diffFiles} />)
.add("Side-By-Side", () => <Diff diff={diffFiles} sideBySide={true} />)
.add("Collapsed", () => <Diff diff={diffFiles} defaultCollapse={true} />)
@@ -21,7 +27,11 @@ storiesOf("Diff", module)
<Diff
diff={diffFiles}
fileControlFactory={() => (
<DiffButton title="Die!" icon="skull-crossbones" onClick={() => alert("Arrrgggghhhh ...")} />
<DiffButton
tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
icon="skull-crossbones"
onClick={() => alert("Arrrgggghhhh ...")}
/>
)}
/>
))