diff --git a/src/common/AsideMenu.js b/src/common/AsideMenu.js index 3f9fb51d..1b223dbb 100644 --- a/src/common/AsideMenu.js +++ b/src/common/AsideMenu.js @@ -1,8 +1,31 @@ import React from 'react'; +import { NavLink } from 'react-router-dom'; import './AsideMenu.scss'; -export default function AsideMenu() { +export default function AsideMenu({ selectedServer }) { + const serverId = selectedServer ? selectedServer.id : ''; + return ( - + ); } diff --git a/src/common/AsideMenu.scss b/src/common/AsideMenu.scss index 77691222..1cfa1f54 100644 --- a/src/common/AsideMenu.scss +++ b/src/common/AsideMenu.scss @@ -13,3 +13,39 @@ background-color: #f7f7f7; border-right: 1px solid #eee; } + +.aside-menu__nav { + margin-top: 10px; +} + +.aside-menu__item { + padding: 10px 20px; + margin: 0 -15px; + text-decoration: none !important; + cursor: pointer; +} +.aside-menu__item:hover { + background-color: $lightHoverColor; +} + +.aside-menu__item--selected { + color: #fff; + background-color: $mainColor; +} +.aside-menu__item--selected:hover { + color: #fff; + background-color: $mainColor; +} + +.aside-menu__item--divider { + border-bottom: 1px solid #eee; + margin: 20px 0; +} + +.aside-menu__item--danger { + color: $dangerColor; +} +.aside-menu__item--danger:hover { + color: #fff; + background-color: $dangerColor; +} diff --git a/src/common/MenuLayout.js b/src/common/MenuLayout.js index f0f6cdff..48874eea 100644 --- a/src/common/MenuLayout.js +++ b/src/common/MenuLayout.js @@ -1,12 +1,13 @@ import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import { connect } from 'react-redux'; import ShortUrls from '../short-urls/ShortUrls'; import AsideMenu from './AsideMenu'; -export default function MenuLayout() { +export function MenuLayout(props) { return (
- +
); } + +export default connect(state => ({ + selectedServer: state.selectedServer, + shortUrlsListParams: state.shortUrlsListParams, +}))(MenuLayout); diff --git a/src/short-urls/ShortUrlsList.js b/src/short-urls/ShortUrlsList.js index b36ddb43..128df843 100644 --- a/src/short-urls/ShortUrlsList.js +++ b/src/short-urls/ShortUrlsList.js @@ -15,10 +15,10 @@ import './ShortUrlsList.scss'; export class ShortUrlsList extends React.Component { componentDidMount() { - const { match } = this.props; - this.props.listShortUrls(match.params.serverId, { + const { match: { params } } = this.props; + this.props.listShortUrls(params.serverId, { ...this.props.shortUrlsListParams, - page: match.params.page + page: params.page }); } diff --git a/src/utils/base.scss b/src/utils/base.scss index e867449d..84ff13e1 100644 --- a/src/utils/base.scss +++ b/src/utils/base.scss @@ -11,6 +11,8 @@ $xlgMin: 1200px; // Colors $mainColor: #4696e5; +$lightHoverColor: #eee; +$dangerColor: #dc3545; // Misc $headerHeight: 57px;