Skip to content

Commit

Permalink
Add Entities list toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mathjazz committed Nov 20, 2023
1 parent 8921b38 commit fc3b816
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
9 changes: 9 additions & 0 deletions translate/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@
width: 100%;
}

#app > .main-content.entities-list > .panel-content {
width: 0%;
}

#app > .main-content > .panel-list {
left: -100%;
width: 0%;
}

#app > .main-content.entities-list > .panel-list {
left: 0%;
width: 100%;
}
}

/* NProgress: A nanoscopic progress bar. */
Expand Down
2 changes: 2 additions & 0 deletions translate/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { AddonPromotion } from './modules/addonpromotion/components/AddonPromoti
import { BatchActions } from './modules/batchactions/components/BatchActions';
import { useBatchactions } from './modules/batchactions/hooks';
import { EntitiesList } from './modules/entitieslist';
import { EntitiesListToggle } from './modules/entitieslist/components/EntitiesListToggle';
import { Entity } from './modules/entitydetails/components/Entity';
import { InteractiveTour } from './modules/interactivetour/components/InteractiveTour';
import { Navigation } from './modules/navbar/components/Navigation';
Expand Down Expand Up @@ -68,6 +69,7 @@ export function App() {
<AddonPromotion />
<header>
<Navigation />
<EntitiesListToggle />
<ResourceProgress />
{allProjects ? null : <ProjectInfo />}
<NotificationPanel />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.entities-list-toggle {
display: none;
float: left;
cursor: pointer;
}

@media screen and (max-width: 600px) {
.entities-list-toggle {
display: block;
}
}

.entities-list-toggle .icon {
border: 2px solid var(--icon-border-1);
border-radius: 6px;
font-size: 20px;
height: 20px;
width: 20px;
margin: 6px 5px 6px 5px;
padding: 12px;
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';

import './EntitiesListToggle.css';

/**
* Render entities list toggle.
*
* Used in a single-column layout.
*/
export function EntitiesListToggle(): React.ReactElement<'div'> {
const toggleEntitiesList = () => {
document
.querySelector('#app > .main-content')
.classList.toggle('entities-list');
};

return (
<div className='entities-list-toggle' onClick={() => toggleEntitiesList()}>
<div className='icon fa fa-bars'></div>
</div>
);
}

0 comments on commit fc3b816

Please sign in to comment.