{cobranding && cobranding.logoImgUrl && (
@@ -67,6 +77,14 @@ const ToolbarHeader = React.memo(function ToolbarHeader({
+ {window.showPdfDetach && (
+
+ )}
+
{shouldDisplayTrackChangesButton && (
+}
+
+export default IconChecked
diff --git a/services/web/frontend/js/shared/context/layout-context.js b/services/web/frontend/js/shared/context/layout-context.js
index 57a5162dc6..5a76550b6c 100644
--- a/services/web/frontend/js/shared/context/layout-context.js
+++ b/services/web/frontend/js/shared/context/layout-context.js
@@ -64,8 +64,18 @@ export function LayoutProvider({ children }) {
})
}, [setPdfLayout, setView])
+ const changeLayout = useCallback(
+ (newLayout, newView) => {
+ setPdfLayout(newLayout)
+ setView(newLayout === 'sideBySide' ? 'editor' : newView)
+ localStorage.setItem('pdf.layout', newLayout)
+ },
+ [setPdfLayout, setView]
+ )
+
const value = useMemo(
() => ({
+ changeLayout,
chatIsOpen,
leftMenuShown,
pdfLayout,
@@ -79,6 +89,7 @@ export function LayoutProvider({ children }) {
view,
}),
[
+ changeLayout,
chatIsOpen,
leftMenuShown,
pdfLayout,
diff --git a/services/web/frontend/stylesheets/app/editor/toolbar.less b/services/web/frontend/stylesheets/app/editor/toolbar.less
index 7733273633..4e3b32e4ae 100644
--- a/services/web/frontend/stylesheets/app/editor/toolbar.less
+++ b/services/web/frontend/stylesheets/app/editor/toolbar.less
@@ -7,7 +7,8 @@
border-bottom: @toolbar-border-bottom;
> a,
- .toolbar-right > a {
+ .toolbar-right > a,
+ button {
position: relative;
.label {
position: absolute;
@@ -19,6 +20,13 @@
}
}
+ .toolbar-right {
+ button {
+ background: transparent;
+ box-shadow: none;
+ }
+ }
+
> a:focus {
outline: none;
}
@@ -151,6 +159,20 @@
}
}
+#layout-dropdown {
+ // override style added by required bsStyle react-bootstrap prop
+ text-decoration: none !important;
+}
+
+#layout-dropdown-list {
+ a {
+ i,
+ svg {
+ margin-right: @margin-xs;
+ }
+ }
+}
+
.header-cobranding-logo {
display: block;
width: auto;
@@ -375,3 +397,28 @@
.opacity(0.65);
.box-shadow(none);
}
+
+.menu-item-with-svg {
+ svg {
+ line,
+ rect {
+ stroke: @dropdown-link-color;
+ }
+ path {
+ fill: @dropdown-link-color;
+ }
+ }
+
+ a:hover,
+ a:focus {
+ svg {
+ line,
+ rect {
+ stroke: @dropdown-link-hover-color;
+ }
+ path {
+ fill: @dropdown-link-hover-color;
+ }
+ }
+ }
+}
diff --git a/services/web/locales/en.json b/services/web/locales/en.json
index 943c465b17..4b3b110763 100644
--- a/services/web/locales/en.json
+++ b/services/web/locales/en.json
@@ -1523,5 +1523,11 @@
"showing_x_results": "Showing __x__ results",
"showing_1_result": "Showing 1 result",
"showing_1_result_of_total": "Showing 1 result of __total__",
- "history_resync": "History Resync"
+ "history_resync": "History Resync",
+ "layout": "Layout",
+ "editor_and_pdf": "Editor & PDF",
+ "editor_only_hide_pdf": "Editor only <0>(hide PDF)0>",
+ "pdf_only_hide_editor": "PDF only <0>(hide editor)0>",
+ "selected": "Selected",
+ "project_layout_sharing_submission": "Project Layout, Sharing, and Submission"
}
diff --git a/services/web/test/frontend/features/editor-navigation-toolbar/components/layout-dropdown-button.test.js b/services/web/test/frontend/features/editor-navigation-toolbar/components/layout-dropdown-button.test.js
new file mode 100644
index 0000000000..502318dcf6
--- /dev/null
+++ b/services/web/test/frontend/features/editor-navigation-toolbar/components/layout-dropdown-button.test.js
@@ -0,0 +1,23 @@
+import { render, screen } from '@testing-library/react'
+import LayoutDropdownButton from '../../../../../frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button'
+
+describe('', function () {
+ const defaultProps = {
+ handleChangeLayout: () => {},
+ pdfLayout: 'flat',
+ view: 'editor',
+ }
+
+ it('should mark current layout option as selected (visually by checkmark, and aria-label for accessibility)', function () {
+ render()
+ screen.getByRole('menuitem', {
+ name: 'Editor & PDF',
+ })
+ screen.getByRole('menuitem', {
+ name: 'PDF only (hide editor)',
+ })
+ screen.getByRole('menuitem', {
+ name: 'Selected Editor only (hide PDF)',
+ })
+ })
+})