Skip to content

Commit

Permalink
Merge pull request #96 from femioladeji/fix-responsiveness-issue
Browse files Browse the repository at this point in the history
Fix responsiveness issue
  • Loading branch information
femioladeji authored Aug 18, 2020
2 parents 56ff197 + b411718 commit 88d3fdc
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 17 deletions.
4 changes: 3 additions & 1 deletion docs/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ h3 {
width: 75%;
}

.each-fade h2 {
.each-fade p {
width: 25%;
font-size: 1em;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
margin: 0;
Expand Down
10 changes: 6 additions & 4 deletions docs/views/codeStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ export const fadeEffectCSS = `
width: 75%;
}
.each-fade h2 {
.each-fade p {
width: 25%;
font-size: 1em;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
margin: 0;
Expand Down Expand Up @@ -386,15 +388,15 @@ const PauseHoverExample = () => {
<Slide {...fadeProperties}>
<div className="each-fade">
<img src={images[0]} />
<h2>First Slide</h2>
<p>First Slide</p>
</div>
<div className="each-fade">
<h2>Second Slide</h2>
<p>Second Slide</p>
<img src={images[1]} />
</div>
<div className="each-fade">
<img src={images[2]} />
<h2>Third Slide</h2>
<p>Third Slide</p>
</div>
</Slide>
</div>
Expand Down
11 changes: 9 additions & 2 deletions docs/views/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import React from "react";
import { Link } from "react-router-dom";
import React, { useEffect } from "react";
import { Link, useLocation } from "react-router-dom";

const Navbar = ({ toggleSidebar, isOpen }) => {
let location = useLocation();
useEffect(() => {
if (window.screen.width <= 768) {
toggleSidebar()
}
}, [location]);

return (
<div className="navbar">
<div className="navbar-div">
Expand Down
2 changes: 1 addition & 1 deletion docs/views/components/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NavLink } from "react-router-dom";
const Sidebar = ({ isOpen }) => {
const [dropDowns, setDropDowns] = useState(false);

const setMargin = isOpen ? "0" : "-50%";
const setMargin = isOpen ? "0" : "-60%";

return (
<div className="sidebar" style={{ marginLeft: setMargin }}>
Expand Down
2 changes: 1 addition & 1 deletion docs/views/pages/Examples/Methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MethodsExample = () => {
const style = {
textAlign: "center",
background: "teal",
padding: "200px",
padding: "200px 0",
fontSize: "30px"
}

Expand Down
6 changes: 3 additions & 3 deletions docs/views/pages/Examples/PauseHover.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const PauseOnHoverExample = () => {
<Slide {...fadeProperties}>
<div className="each-fade">
<img src={fadeImages[0]} />
<h2>First Slide</h2>
<p>First Slide</p>
</div>
<div className="each-fade">
<h2>Second Slide</h2>
<p>Second Slide</p>
<img src={fadeImages[1]} />
</div>
<div className="each-fade">
<img src={fadeImages[2]} />
<h2>Third Slide</h2>
<p>Third Slide</p>
</div>
</Slide>
</div>
Expand Down
12 changes: 7 additions & 5 deletions docs/views/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body {
}

.app-container {
margin-top: calc(80px + 20px);
margin-top: calc(80px);
margin-left: 13%;
background: #fff;
padding: 10px 3%;
Expand Down Expand Up @@ -57,14 +57,15 @@ li:hover {
.sidebar {
display: block;
position: fixed;
overflow-y: auto;
/* overflow-x: hidden; */
top: 80px;
left: 0;
height: 100vh;
width: 13%;
margin-left: 0;
z-index: 200;
background: #f4f4f4;
padding-top: 20px;
}

.sidebar-items {
Expand All @@ -90,6 +91,7 @@ li:hover {
font-size: 20px;
cursor: pointer;
width: 100%;
box-sizing: border-box;
color: #000;
}

Expand Down Expand Up @@ -226,10 +228,10 @@ tr:nth-child(odd) {
}

.sidebar {
width: 45%;
width: 60%;
top: 80px;
margin-left: -50%;
height: 150vh;
margin-left: -60%;
height: calc(100vh - 80px);
transition: 500ms;
}

Expand Down
1 change: 1 addition & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
height: 10px;
border-color: #000;
border-style: solid;
box-sizing: border-box;
transform: rotate(45deg);
}

Expand Down

0 comments on commit 88d3fdc

Please sign in to comment.