Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/Overlay/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

import { OverlayWrapper } from './styles';

const Overlay = ({ isActive }) => {
return <OverlayWrapper isActive={isActive} />;
};

export { Overlay };
export default Overlay;
14 changes: 14 additions & 0 deletions src/components/Overlay/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styled from 'styled-components';

export const OverlayWrapper = styled.div`
background-color: black;
width: 100%;
min-height: 100vh;
overflow: hidden;
z-index: 2;
display: ${({ isActive }) => (isActive ? 'block' : 'none')};
position: fixed;
top: 0;
left: 0;
opacity: 0.7;
`;
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { Sidebar } from './Sidebar';
export { Job } from './Job';
export { Header } from './Header';
export { Overlay } from './Overlay';
4 changes: 3 additions & 1 deletion src/pages/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React from 'react';
import Header from '@components/Header';
import Sidebar from '@components/Sidebar';
import JobList from '@components/JobList';
//import Overlay from '@components/Overlay';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment


import { MainBackground, MainContainer, MainWrapper } from './styles';
import { MainBackground, MainContainer, MainWrapper, Overlay } from './styles';

const Main = () => (
<>
Expand All @@ -14,6 +15,7 @@ const Main = () => (
<MainWrapper>
<JobList />
</MainWrapper>
<Overlay />
<Sidebar />
</MainContainer>
</MainBackground>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/main/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ const WidgetWrapper = styled.div`
padding: 20px;
`;

export const MainBackground = styled.div`
background-image: url(${background});
width: 100%;
height: 100vh;
position: absolute;
z-index: 100%;
`;

export const MainWrapper = WidgetWrapper;
4 changes: 4 additions & 0 deletions src/sdk/body/AppView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import fx from '@assets/images/fx.svg';
import fxBottom from '@assets/images/fx_bot.svg';

import Sidebar from '@components/Sidebar/content';
import { Overlay } from '@components/Overlay';

import { Wrapper, Texture, Content, MobileMenu } from './style';

Expand Down Expand Up @@ -67,6 +68,9 @@ const AppView = ({ children }) => {
src={fxBottom}
alt="bottom fx"
/>
<span onClick={() => setSidebar(!sidebar)}>
<Overlay isActive={sidebar} />
</span>
</Wrapper>
);
};
Expand Down