-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from FoxComm/feature/categories-for-mobile
Sidebar for mobiles
- Loading branch information
Showing
16 changed files
with
248 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
/* @flow */ | ||
|
||
import React from 'react'; | ||
import type { HTMLElement } from '../../types'; | ||
|
||
const Home = () => { | ||
return <h2>Storefront Demo</h2>; | ||
type HomeParams = { | ||
params: Object; | ||
} | ||
|
||
const Home = (props: HomeParams) : HTMLElement => { | ||
return ( | ||
<div> | ||
<h2>Storefront Demo</h2> | ||
<p>Current category: {props.params.categoryName ? props.params.categoryName : 'all'}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
@import "colors.css"; | ||
|
||
.sidebar-hidden { | ||
display: none; | ||
} | ||
|
||
.sidebar-shown { | ||
display: block; | ||
position: fixed; | ||
} | ||
|
||
.overlay { | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
position: fixed; | ||
background: var(--light-grayish); | ||
} | ||
|
||
.container { | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
width: 280px; | ||
position: fixed; | ||
background: var(--blackish); | ||
color: var(--whitish); | ||
} | ||
|
||
.controls { | ||
margin-left: 20px; | ||
margin-top: 20px; | ||
color: var(--whitish); | ||
} | ||
|
||
.controls-close { | ||
|
||
} | ||
|
||
.close-button { | ||
color: var(--whitish); | ||
text-decoration: none; | ||
} | ||
|
||
.close-button { | ||
stroke: var(--whitish); | ||
} | ||
|
||
.controls-categories { | ||
margin-left: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* @flow */ | ||
|
||
import React from 'react'; | ||
import type { HTMLElement } from '../../types'; | ||
import { connect } from 'react-redux'; | ||
import classNames from 'classnames'; | ||
import cssModules from 'react-css-modules'; | ||
import styles from './sidebar.css'; | ||
|
||
import Icon from '../common/icon'; | ||
import Categories from '../categories/categories'; | ||
|
||
import * as actions from '../../modules/sidebar'; | ||
|
||
type SidebarProps = { | ||
isVisible: boolean; | ||
toggleSidebar: Function; | ||
}; | ||
|
||
const getState = state => ({ ...state.sidebar }); | ||
|
||
const Sidebar = (props : SidebarProps) : HTMLElement => { | ||
const sidebarClass = classNames({ | ||
'sidebar-hidden': !props.isVisible, | ||
'sidebar-shown': props.isVisible, | ||
}); | ||
|
||
const changeCategoryCallback = () => { | ||
props.toggleSidebar(); | ||
}; | ||
|
||
return ( | ||
<div styleName={sidebarClass}> | ||
<div styleName="overlay" onClick={props.toggleSidebar}></div> | ||
<div styleName="container"> | ||
<div styleName="controls"> | ||
<div styleName="controls-close"> | ||
<a styleName="close-button" onClick={props.toggleSidebar}> | ||
<Icon name="fc-close" className="close-icon"/> | ||
</a> | ||
</div> | ||
<div styleName="controls-categories"> | ||
<Categories onClick={changeCategoryCallback} /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default connect(getState, actions)(cssModules(Sidebar, styles)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.