Skip to content

Commit

Permalink
Merge pull request #545 from DemocracyEarth/mobile
Browse files Browse the repository at this point in the history
Fixes for proper mobile rendering
  • Loading branch information
santisiri authored Oct 23, 2020
2 parents 78b12da + 3553758 commit 41e9c59
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/Expand/Expand.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default class Expand extends Component {
super(props);
this.state = {
open: props.open,
img: arrowDown,
logo: this.props.icon,
img: (props.open) ? arrowDownActive : arrowDown,
logo: (props.open) ? this.props.iconActive : this.props.icon,
};

this.mouseToggle = this.mouseToggle.bind(this);
Expand Down
30 changes: 21 additions & 9 deletions src/components/Menu/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const _getMenu = (view, data, address, param) => {
}

return (
<div>
<div className="submenu">
<Item sharp hideEmpty={hideEmpty} label={`${i18n.t(defaultLabels[0])}`} score={(atHome) ? null : _getProposalCount(data.proposals, defaultLabels[0])} key={0} href={(atHome) ? `/` : baseRoute } />
<Item sharp hideEmpty={hideEmpty} label={`${i18n.t(defaultLabels[1])}`} score={(atHome) ? null : _getProposalCount(data.proposals, defaultLabels[1])} key={1} href={(atHome) ? '/period/queue' : `${baseRoute}/period/queue`} />
<Item sharp hideEmpty={hideEmpty} label={`${i18n.t(defaultLabels[2])}`} score={(atHome) ? null : _getProposalCount(data.proposals, defaultLabels[2])} key={2} href={(atHome) ? '/period/voting' : `${baseRoute}/period/voting`} />
Expand Down Expand Up @@ -223,7 +223,9 @@ const MenuQuery = ({ address, scrollUp, view, proposalId, param }) => {
<div className="separator">
{_getHeadline('proposals', address, view)}
</div>
{<div className="option-placeholder identity-placeholder" />}
<div className="submenu">
<div className="option-placeholder identity-placeholder" />
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -251,10 +253,14 @@ const MenuQuery = ({ address, scrollUp, view, proposalId, param }) => {
</div>
{
(daoList.length > 0) ?
daoList
<div className="submenu">
{daoList}
</div>
:
<div className="empty">
{i18n.t('no-memberships-found')}
<div className="submenu">
<div className="empty">
{i18n.t('no-memberships-found')}
</div>
</div>
}
</>
Expand All @@ -269,7 +275,9 @@ const MenuQuery = ({ address, scrollUp, view, proposalId, param }) => {
menuList
:
<div className="empty">
{i18n.t('no-proposals-found')}
<div className="submenu">
{i18n.t('no-proposals-found')}
</div>
</div>
}
</>
Expand All @@ -278,10 +286,12 @@ const MenuQuery = ({ address, scrollUp, view, proposalId, param }) => {
const goBack = (
<>
{(window.innerWidth < 768) ?
<Item sharp hideEmpty={false} icon={back} label={`${i18n.t('all-daos')}`} href={'/'} />
<div className="submenu">
<Item sharp hideEmpty={false} icon={back} label={`${i18n.t('all-daos')}`} href={'/'} />
</div>
:
null
}
}
</>
)

Expand Down Expand Up @@ -366,7 +376,9 @@ export default class Sidebar extends Component {
<div id="sidebar" className={_getScrollClass(this.state.scrollUp)}>
<div className="menu">
{(this.props.view === routerView.SEARCH) ?
<Item sharp hideEmpty={false} icon={back} label={`${i18n.t('all-daos')}`} href={'/'} />
<div className="submenu">
<Item sharp hideEmpty={false} icon={back} label={`${i18n.t('all-daos')}`} href={'/'} />
</div>
:
null
}
Expand Down
23 changes: 17 additions & 6 deletions src/styles/Dapp.css
Original file line number Diff line number Diff line change
Expand Up @@ -6714,7 +6714,6 @@ blockquote {
}
.menu-item {
font-weight: 400;
margin-bottom: 5px;
}
.content.content-feed {
padding-right: 10px;
Expand Down Expand Up @@ -8239,6 +8238,13 @@ h4 {
font-weight: 400;
}

.submenu {
padding: 10px 10px 2px;
background-color: #f0f0f5;
border-radius: 10px;
margin-bottom: 20px;
}

@media (max-width: 991px) {
h4 {
margin-bottom: 10px;
Expand All @@ -8252,7 +8258,7 @@ h4 {

.parameter {
padding: 0px 10px 10px;
margin: 10px 10px 0px 0px;
margin: 10px 5px 0px 0px;
}

.details-wrapper {
Expand Down Expand Up @@ -8991,10 +8997,6 @@ h4 {
top: -55px;
}

.period {
margin-bottom: -3px;
}

.parameter-value {
margin-top: 7px;
}
Expand All @@ -9004,6 +9006,15 @@ h4 {
.tab-menu {
position: absolute;
}

.details:hover {
text-decoration: none;
border: 1px solid #e6e0ee;
}

.details.details-open {
border: 1px solid var(--menu-sidebar-selected);
}
}


Expand Down

0 comments on commit 41e9c59

Please sign in to comment.