Skip to content

Commit

Permalink
feat: sticky qb step navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fung committed Jul 28, 2020
1 parent 4a48eed commit ec2e506
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 16 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"react-scripts": "^3.4.0",
"react-select": "^3.0.4",
"react-select-async-paginate": "^0.3.7",
"react-stickynode": "^3.0.3",
"react-syntax-highlighter": "^11.0.2",
"react-use": "^11.3.2",
"styled-components": "^5.0.1",
Expand Down
29 changes: 17 additions & 12 deletions src/app/modules/querybuilder-module/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { NavigationButton } from 'app/modules/querybuilder-module/common/Navigat
import { StepNavigatorContainer } from 'app/modules/querybuilder-module/common/StepNavigatorContainer';
import useMediaQuery from '@material-ui/core/useMediaQuery/useMediaQuery';
import { Redirect } from 'react-router-dom';
import Sticky from 'react-stickynode';

/* config & mock */
export type NavButtonModel = {
Expand Down Expand Up @@ -64,23 +65,27 @@ export const QueryBuilderLayout = () => {
<Grid container>
<Box height="40px" width="100%" />

<Grid
item
md={12}
style={{ position: 'relative' }}
<Sticky
top={80}
innerZ={10}
css={`
overflow-x: auto;
width: 100%;
`}
>
{/* todo: convoluted; refactor */}
<Box
<Grid
item
md={12}
css={`
overflow-x: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-top: 10px;
padding-bottom: 10px;
height: 70px;
background-color: white;
width: 100%;
`}
display="flex"
flexDirection="row"
justifyContent="space-between"
>
{navButtons.map((item) => (
// todo: convoluted code, needs refactoring
Expand Down Expand Up @@ -124,8 +129,8 @@ export const QueryBuilderLayout = () => {
/>
</div>
))}
</Box>
</Grid>
</Grid>
</Sticky>

<Box height="40px" width="100%" />

Expand Down
33 changes: 29 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4453,7 +4453,7 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"

[email protected], classnames@^2.2.0, classnames@^2.2.1, classnames@^2.2.3, classnames@^2.2.5, classnames@^2.2.6, classnames@~2.2.6:
[email protected], classnames@^2.0.0, classnames@^2.2.0, classnames@^2.2.1, classnames@^2.2.3, classnames@^2.2.5, classnames@^2.2.6, classnames@~2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
Expand Down Expand Up @@ -4991,7 +4991,7 @@ core-js@^2.4.0, core-js@^2.5.0:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==

core-js@^3.4.1, core-js@^3.5.0:
core-js@^3.4.1, core-js@^3.5.0, core-js@^3.6.5:
version "3.6.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==
Expand Down Expand Up @@ -6761,6 +6761,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.2.tgz#f31f8b99d45245f0edbc5b00797830ff3b388970"
integrity sha512-r/Pwupa5RIzxIHbEKCkNXqpEQIIT4uQDxmP4G/Lug/NokVUWj0joz/WzWl3OxRpC5kDrH/WdiUJoR+IrwvXJEw==

eventemitter3@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==

eventemitter3@^4.0.0:
version "4.0.4"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384"
Expand Down Expand Up @@ -12779,7 +12784,7 @@ quick-lru@^4.0.1:
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f"
integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==

raf@^3.4.0, raf@^3.4.1:
raf@^3.0.0, raf@^3.4.0, raf@^3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
Expand Down Expand Up @@ -13526,6 +13531,17 @@ react-slick@~0.25.2:
lodash.debounce "^4.0.8"
resize-observer-polyfill "^1.5.0"

react-stickynode@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/react-stickynode/-/react-stickynode-3.0.3.tgz#c01c9c522e1206dd3832faabc79a1d6d5c47b473"
integrity sha512-5uZs5IdwO/KNWkAuGvyKEZbve42iYq2IBdxviMjsW0Hw88LIoFmMs2j3KtYYmDpqoC5WPP3jDVPoOdExbuKvAQ==
dependencies:
classnames "^2.0.0"
core-js "^3.6.5"
prop-types "^15.6.0"
shallowequal "^1.0.0"
subscribe-ui-event "^2.0.6"

[email protected]:
version "8.0.1"
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-8.0.1.tgz#88f7833e3a2d3c718799f2e7776266486c82c566"
Expand Down Expand Up @@ -14461,7 +14477,7 @@ shallow-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da"
integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==

shallowequal@^1.0.2, shallowequal@^1.1.0:
shallowequal@^1.0.0, shallowequal@^1.0.2, shallowequal@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
Expand Down Expand Up @@ -15200,6 +15216,15 @@ stylus-lookup@^3.0.1:
commander "^2.8.1"
debug "^4.1.0"

subscribe-ui-event@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/subscribe-ui-event/-/subscribe-ui-event-2.0.6.tgz#44ab9bbb2e58948ded9b3a52c2f6d5979e528129"
integrity sha512-67DaMmtTOLqM6V3ukoqbQFCB0B+o6Qh9v70gaDLO0DoxWEjyyOmouxtDQpoWm+4N/h3kvcnhwm3hkLYjGhHSbA==
dependencies:
eventemitter3 "^3.0.0"
lodash "^4.17.15"
raf "^3.0.0"

[email protected], supports-color@^7.0.0, supports-color@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
Expand Down

0 comments on commit ec2e506

Please sign in to comment.