Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use ant icon for menu toggle #155

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"timeline_page_title": "Historical timeline",
"realtime_map_page_title": "Real time map",
"gaps_page_title": "Trips that didn't take place",
"gaps_patterns_page_title": "patterns",
"singleline_map_page_title": "Map by line",
"choose_datetime": "Date and time",
"choose_date": "Date",
Expand Down
1 change: 1 addition & 0 deletions src/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"timeline_page_title": "לוח זמנים היסטורי",
"realtime_map_page_title": "מפה בזמן אמת",
"gaps_page_title": "נסיעות שלא יצאו",
"gaps_patterns_page_title": "דפוסי נסיעות שלא יצאו",
"singleline_map_page_title": "מפה לפי קו",
"choose_datetime": "תאריך ושעה",
"choose_date": "תאריך",
Expand Down
18 changes: 11 additions & 7 deletions src/pages/components/header/sidebar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ import React, { useState } from 'react'
import Menu, { MenuPage } from '../menu/Menu'
import cn from 'classnames'
import './sidebar.scss'
import { MenuOutlined } from '@ant-design/icons'

const SidebarToggle = ({ open, setOpen }: { open: boolean; setOpen: (open: boolean) => void }) => (
<div className="sidebar-menu-toggle" onClick={() => setOpen(!open)}>
<MenuOutlined />
</div>
)

const Logo = () => <h1 className={'sidebar-logo'}>דאטאבוס</h1>

export default function SideBar({ pages }: { pages: MenuPage[] }) {
const [open, setOpen] = useState(false)

return (
<aside className={cn('sidebar', { open })}>
<div className="sidebar-menu-toggle" onClick={() => setOpen(!open)}>
<div className="sidebar-menu-toggle-line" />
<div className="sidebar-menu-toggle-line" />
<div className="sidebar-menu-toggle-line" />
</div>
<h1>דאטאבוס</h1>
<Logo />
<SidebarToggle open={open} setOpen={setOpen} />
<Menu pages={pages} />
</aside>
)
Expand Down
7 changes: 0 additions & 7 deletions src/pages/components/header/sidebar/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
margin: 10px;
cursor: pointer;
font-size: 20px;

&-line {
width: 30px;
height: 3px;
background-color: black;
margin: 5px 0;
}
}
}

Expand Down
Loading