From 99d94c382c8540d0d6d9cc7ec662c470755d270c Mon Sep 17 00:00:00 2001 From: Christian Thomas Elfreich Date: Thu, 24 Sep 2020 15:21:41 -0400 Subject: [PATCH 1/3] Changed position to fixed and appbar width set to inherit its parent --- src/ItemViewAppBar.test.js | 25 +++++++++++++++++++ .../ItemViewAppBar/ItemViewAppBar.js | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/ItemViewAppBar.test.js diff --git a/src/ItemViewAppBar.test.js b/src/ItemViewAppBar.test.js new file mode 100644 index 0000000..4218681 --- /dev/null +++ b/src/ItemViewAppBar.test.js @@ -0,0 +1,25 @@ +import React from "react"; +import { render, unmountComponentAtNode} from "react-dom"; +import { act } from "react-dom/test-utils"; + +import ItemViewAppBar from "./ItemViewAppBar"; + +let container = null; +beforeEach(() => { + //Setup a DOM element as a render target + container = document.createElement("div"); + document.body.appendChild(container); +}); + +afterEach(() => { + unmountComponentAtNode(container); + container.remove(); + container = null; +}); + +it("renders only with a title", () =>{ + act(() => { + render(, container); + }) + expect(container.ItemViewAppBar).toBe(null); +}) \ No newline at end of file diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js index a150cd6..9ae4957 100644 --- a/src/components/ItemViewAppBar/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -18,7 +18,7 @@ export default function ItemViewAppBar(props){ return( <> - + Date: Thu, 24 Sep 2020 15:48:36 -0400 Subject: [PATCH 2/3] Removed unneccesary test file accidentally included in commit, and added extra toolbar to fix padding underneath fixed appbar --- src/ItemViewAppBar.test.js | 25 ------------------- .../ItemViewAppBar/ItemViewAppBar.js | 2 ++ 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 src/ItemViewAppBar.test.js diff --git a/src/ItemViewAppBar.test.js b/src/ItemViewAppBar.test.js deleted file mode 100644 index 4218681..0000000 --- a/src/ItemViewAppBar.test.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { render, unmountComponentAtNode} from "react-dom"; -import { act } from "react-dom/test-utils"; - -import ItemViewAppBar from "./ItemViewAppBar"; - -let container = null; -beforeEach(() => { - //Setup a DOM element as a render target - container = document.createElement("div"); - document.body.appendChild(container); -}); - -afterEach(() => { - unmountComponentAtNode(container); - container.remove(); - container = null; -}); - -it("renders only with a title", () =>{ - act(() => { - render(, container); - }) - expect(container.ItemViewAppBar).toBe(null); -}) \ No newline at end of file diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js index 9ae4957..448e626 100644 --- a/src/components/ItemViewAppBar/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -19,6 +19,7 @@ export default function ItemViewAppBar(props){ return( <> + + ); } From 58be4d7237cf1fd01977de765456a1dfbbe29ca8 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 24 Sep 2020 15:58:08 -0400 Subject: [PATCH 3/3] Move width declaration to JSS --- src/components/ItemViewAppBar/ItemViewAppBar.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js index 448e626..e45094e 100644 --- a/src/components/ItemViewAppBar/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -12,13 +12,16 @@ export default function ItemViewAppBar(props){ title: { flexGrow: "1" }, + appBarRoot: { + width: "inherit" + } })); const classes = useStyles(props.theme); return( <> - +