Skip to content

Commit 12be747

Browse files
committed
[C] Change show/hide to expand/collapse in annotation drawer
1 parent f8e4cd4 commit 12be747

File tree

2 files changed

+15
-4
lines changed
  • client/src
    • config/app/locale/en-US/json/shared
    • global/components/Annotation/Annotation/TextContent/FromNodes

2 files changed

+15
-4
lines changed

client/src/config/app/locale/en-US/json/shared/actions.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
"view_resource": "$t(actions.view) $t(glossary.resource_one)",
9797
"visit": "Visit",
9898
"zoom": "Zoom",
99+
"expand_passage": "Expand <0>passage</0>",
100+
"collapse_passage": "Collapse <0>passage</0>",
99101
"dnd": {
100102
"move_up_position": "Move up one position",
101103
"move_down_position": "Move down one position",

client/src/global/components/Annotation/Annotation/TextContent/FromNodes/Wrapper.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
import React from "react";
22
import Collapse from "global/components/Collapse";
33
import * as Styled from "./styles";
4-
import { useTranslation } from "react-i18next";
4+
import { Trans } from "react-i18next";
55
import IconComposer from "global/components/utility/IconComposer";
66

77
export default function FromNodesWrapper({ children, overlayLight }) {
8-
const { t } = useTranslation();
98
return (
109
<Collapse stubHeight={200}>
1110
<Styled.Content focusOnVisible>
1211
<blockquote>{children}</blockquote>
1312
<Styled.Overlay $light={overlayLight} />
1413
</Styled.Content>
1514
<Styled.Toggle>
16-
<span className="toggle-show-label">{t("actions.show")}</span>
17-
<span className="toggle-hide-label">{t("actions.hide")}</span>
15+
<span className="toggle-show-label">
16+
<Trans
17+
i18nKey={"actions.expand_passage"}
18+
components={[<span className="screen-reader-text" />]}
19+
/>
20+
</span>
21+
<span className="toggle-hide-label">
22+
<Trans
23+
i18nKey={"actions.collapse_passage"}
24+
components={[<span className="screen-reader-text" />]}
25+
/>
26+
</span>
1827
<IconComposer icon="disclosureDown16" size={16} />
1928
</Styled.Toggle>
2029
</Collapse>

0 commit comments

Comments
 (0)