Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(app): add scss import as an example
Browse files Browse the repository at this point in the history
fix(app): add scss import as an example
  • Loading branch information
Metnew committed Feb 19, 2018
1 parent db0a0fa commit acc1db6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
5 changes: 5 additions & 0 deletions src/common/containers/App/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Scss is written as a case study and a proof of CSS support
#page-dimmer {
z-index: 55 !important;
cursor: pointer;
}
12 changes: 7 additions & 5 deletions src/common/containers/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import {TOGGLE_SIDEBAR, WINDOW_RESIZE} from 'actions/layout'
import {getLayoutState, getLayoutMobileStatuses} from 'selectors'
import ReactGA from 'react-ga'
// Import styled components
import {PageLayout, SidebarSemanticPusherStyled, SidebarSemanticPushable, StyledDimmer} from './style'
import {Container} from 'semantic-ui-react'
import {PageLayout, SidebarSemanticPusherStyled, SidebarSemanticPushable} from './style'
import {Container, Dimmer} from 'semantic-ui-react'
import _ from 'lodash'
// Scss is written as a case study and a proof of CSS support
import './App.scss'

type Props = {
children: React$Node,
Expand Down Expand Up @@ -82,7 +84,7 @@ class App extends Component<Props> {
<Sidebar />
<SidebarSemanticPusherStyled sidebar_opened={sidebarOpened ? '1' : ''}>
{/* React throws warnings about no "key" prop in this <div> */}
<StyledDimmer key={1} {...dimmerProps} />
<Dimmer id="page-dimmer" key={1} {...dimmerProps} />
<Header />
<div className="main-layout">
<main className="main-content">
Expand All @@ -97,7 +99,7 @@ class App extends Component<Props> {
}
}

const mapStateToProps = (state) => {
const mapStateToProps = state => {
const {sidebarOpened} = getLayoutState(state)
const {isMobile} = getLayoutMobileStatuses(state)

Expand All @@ -107,7 +109,7 @@ const mapStateToProps = (state) => {
}
}

const mapDispatchToProps = (dispatch) => {
const mapDispatchToProps = dispatch => {
let resizer
return {
toggleSidebar () {
Expand Down
14 changes: 2 additions & 12 deletions src/common/containers/App/style.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import styled, {css} from 'styled-components'
import {Dimmer, Sidebar} from 'semantic-ui-react'
import {Sidebar} from 'semantic-ui-react'

export const SidebarSemanticPushable = Sidebar.Pushable
export const SidebarSemanticPusherStyled = styled(Sidebar.Pusher)`
height: 100%;
-webkit-overflow-scrolling: touch;
${({sidebar_opened: sidebarOpened}) => {
// `sidebar_opened` attr instead of `media` util -> SSRed app looks better
return (
sidebarOpened &&
css`
max-width: calc(100% - 150px);
`
)
return sidebarOpened && css`max-width: calc(100% - 150px);`
}};
`

Expand Down Expand Up @@ -58,8 +53,3 @@ export const PageLayout = styled.div`
}
}
`

export const StyledDimmer = styled(Dimmer)`
z-index: 55 !important;
cursor: pointer;
`

0 comments on commit acc1db6

Please sign in to comment.