Skip to content

Commit

Permalink
refactor: innerListItemMenu sorry-cypress#2
Browse files Browse the repository at this point in the history
  • Loading branch information
mathpaquette committed Aug 23, 2022
1 parent d3bd5b8 commit 241142b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion packages/dashboard/src/ciBuild/ciBuildsView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Loop as LoopIcon } from '@mui/icons-material';
import {
Compress as CompressIcon,
Loop as LoopIcon,
} from '@mui/icons-material';
import { Typography } from '@mui/material';
import { CiBuildsFeed } from '@sorry-cypress/dashboard/ciBuild/ciBuildsFeed';
import { Toolbar } from '@sorry-cypress/dashboard/components';
Expand All @@ -8,6 +11,7 @@ import { useAutoRefresh } from '../hooks';

export function CiBuildsView() {
const [search, setSearch] = useState('');
const [compactView, setCompactView] = useState(false);
const [shouldAutoRefresh, setShouldAutoRefresh] = useAutoRefresh();

useLayoutEffect(() => {
Expand All @@ -23,6 +27,17 @@ export function CiBuildsView() {
<>
<Toolbar
actions={[
{
key: 'compactView',
text: 'Compact view',
showInMenuBreakpoint: ['xs'],
icon: CompressIcon,
toggleButton: true,
selected: compactView,
onClick: () => {
setCompactView(!compactView);
},
},
{
key: 'autoRefresh',
text: 'Auto Refresh',
Expand Down
1 change: 0 additions & 1 deletion packages/dashboard/src/components/layout/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ export const Sidebar: SidebarType = ({ open, onToggleSidebar }) => {
)}
{!loading && ciBuildsView && ciBuildsView.type && (
<CiBuildsListMenu
projectColor={currentProject?.projectColor}
open={open}
selectedItem={ciBuildsView.type}
onItemClick={handleMenuItemClick}
Expand Down
2 changes: 2 additions & 0 deletions packages/dashboard/src/dashboard/dashboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const DashboardView: DashboardComponent = () => {
Home
</Typography>

<p>Welcome to Sorry-Cypress!</p>

{redirect && <Navigate to="/projects" />}
</>
);
Expand Down

0 comments on commit 241142b

Please sign in to comment.