diff --git a/src/layout/header/Header.tsx b/src/layout/header/Header.tsx
index d65cc98e..8781bc41 100644
--- a/src/layout/header/Header.tsx
+++ b/src/layout/header/Header.tsx
@@ -6,7 +6,6 @@ import { MenuOutlined } from '@ant-design/icons'
import './Header.css'
import cn from 'classnames'
import ToggleThemeButton from './ToggleThemeButton'
-import { DonationButton } from './DonationButton'
import HeaderLinks from './HeaderLinks/HeaderLinks'
import { LanguageToggle } from './LanguageToggle'
@@ -22,7 +21,6 @@ const MainHeader = () => {
-
)
diff --git a/src/locale/en.json b/src/locale/en.json
index 8daae722..8a757509 100644
--- a/src/locale/en.json
+++ b/src/locale/en.json
@@ -4,7 +4,8 @@
"databus_definition": "The open platform for real data on the quality of public transportation lines in Israel",
"website_goal": "The purpose of the site is to improve the quality of public transportation in Israel by providing reliable information to journalists, citizens, transportation companies, and government officials in Israel.",
"show_button": "Show",
- "copyright": "© The Public Knowledge Workshop"
+ "copyright": "© The Public Knowledge Workshop",
+ "open_menu": "Start Exploring"
},
"homepage_title": "Home",
"dashboard_page_title": "Public transport operators according to planned trips",
diff --git a/src/locale/he.json b/src/locale/he.json
index a752b01d..d87752fc 100644
--- a/src/locale/he.json
+++ b/src/locale/he.json
@@ -4,7 +4,8 @@
"databus_definition": "הפלטפורמה הפתוחה לנתוני אמת על איכות קווי התחבורה הציבורית בישראל",
"website_goal": "מטרת האתר היא לשפר את איכות התחבורה הציבורית בארץ ע\"י מתן מידע אמין לעיתונאים, אזרחים, חברות התחבורה, וגורמי ממשל בישראל.",
"show_button": "הצג",
- "copyright": "© הסדנא לידע ציבורי (ע\"ר)"
+ "copyright": "© הסדנא לידע ציבורי (ע\"ר)",
+ "open_menu": "תתחיל לחקור"
},
"homepage_title": "ראשי",
"dashboard_page_title": "קיום נסיעות",
diff --git a/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.scss b/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.scss
index 118dd01f..9c1bcce3 100644
--- a/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.scss
+++ b/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.scss
@@ -1,8 +1,13 @@
.HbarChart {
.entry {
position: relative;
+ margin-bottom: 2%;
+ padding: 3px;
+ border-radius: 8px;
- .entryName {
+ .entryData {
+ display: flex;
+ justify-content: space-between;
margin-left: 10px;
font-size: 16px;
font-weight: 500;
@@ -15,9 +20,13 @@
align-items: center;
.barDisplay {
- height: 7px;
- border-radius: 10px;
+ height: 5px;
+ display: inline-block;
+ border-radius: 4px;
margin-left: 10px;
+ text-align: center;
+ font-weight: bold;
+ color: white;
}
.entryBarTotal {
@@ -27,4 +36,12 @@
}
}
}
+}
+
+.HbarChart:hover {
+ cursor: default;
+}
+
+.entry:hover{
+ background-color: gray
}
\ No newline at end of file
diff --git a/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.tsx b/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.tsx
index 47f5e85c..d6a0227b 100644
--- a/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.tsx
+++ b/src/pages/dashboard/WorstLinesChart/LineHbarChart/HbarChart/HbarChart.tsx
@@ -17,7 +17,6 @@ export function HbarChart({
const percents = entries
.map((o) => (o.actual / o.total) * 100)
.map((p) => (complement ? Math.max(100 - p, 0) : p))
-
const rows = entries.map((entry, idx) => ({
percent: percents[idx],
...entry,
@@ -45,23 +44,21 @@ export function HbarChart({
{rows.map((entry) => {
return (
!!entry.percent && (
-
-
- {entry.name.split('|').slice(0, 2).join(' | ')}
-
-
-
- {wrapWithTooltip(
-
,
- entry,
- )}
- {wrapWithTooltip(
-
{entry.percent.toFixed(2)}%
,
- entry,
- )}
-
+
+ {wrapWithTooltip(
+
+
+ {entry.name.split('|').slice(0, 2).join(' | ')}
+ {entry.percent.toFixed(2)}%
+
+
+
,
+ entry,
+ )}
)
)
diff --git a/src/pages/gapsPatterns/GapsPatternsPage.tsx b/src/pages/gapsPatterns/GapsPatternsPage.tsx
index f4c56af7..1dee3ea4 100644
--- a/src/pages/gapsPatterns/GapsPatternsPage.tsx
+++ b/src/pages/gapsPatterns/GapsPatternsPage.tsx
@@ -35,6 +35,7 @@ const { Title } = Typography
import { useTranslation } from 'react-i18next'
import Widget from 'src/shared/Widget'
import InfoYoutubeModal from '../components/YoutubeModal'
+
// Define prop types for the component
interface BusLineStatisticsProps {
lineRef: number
@@ -61,7 +62,10 @@ const CustomTooltip = ({ active, payload }: TooltipProps
) => {
}
function GapsByHour({ lineRef, operatorRef, fromDate, toDate }: BusLineStatisticsProps) {
- const [sortingMode, setSortingMode] = useState<'hour' | 'severity'>('hour')
+ const sorting_mode = sessionStorage.getItem('sorting_mode') as 'hour' | 'severity'
+ const [sortingMode, setSortingMode] = useState<'hour' | 'severity'>(
+ sorting_mode ? sorting_mode : 'hour',
+ )
const hourlyData = useGapsList(fromDate, toDate, operatorRef, lineRef, sortingMode)
const isLoading = !hourlyData.length
const { t } = useTranslation()
@@ -70,6 +74,11 @@ function GapsByHour({ lineRef, operatorRef, fromDate, toDate }: BusLineStatistic
...hourlyData.map((entry) => entry.actual_rides),
)
+ function changeSorting(e: RadioChangeEvent) {
+ setSortingMode(e.target.value as 'hour' | 'severity')
+ sessionStorage.setItem('sorting_mode', e.target.value as 'hour' | 'severity')
+ }
+
return (
lineRef > 0 && (
@@ -79,12 +88,10 @@ function GapsByHour({ lineRef, operatorRef, fromDate, toDate }: BusLineStatistic
<>
- setSortingMode(e.target.value as 'hour' | 'severity')
- }
+ onChange={changeSorting}
value={sortingMode}>
{t('order_by_hour')}
- {t('order_by_severity')}
+ {t('order_by_severity')}
{
/>
- {routesIsLoading && (
+ {routesIsLoading ? (
- )}
- {!routesIsLoading &&
+ ) : (
+ !routesIsLoading &&
routes &&
(routes.length === 0 ? (
{t('line_not_found')}
@@ -254,7 +261,8 @@ const GapsPatternsPage = () => {
setRouteKey={(key) => setSearch((current) => ({ ...current, routeKey: key }))}
/>
>
- ))}
+ ))
+ )}
diff --git a/src/pages/homepage/HomePage.scss b/src/pages/homepage/HomePage.scss
index dac67f17..753a3eae 100644
--- a/src/pages/homepage/HomePage.scss
+++ b/src/pages/homepage/HomePage.scss
@@ -33,14 +33,23 @@
}
}
+.menu-link{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ font-size: medium;
+ font-weight: 600;
+ justify-content: space-between;
+
+ span {
+ margin-bottom: 0.5rem;
+ }
+}
+
.links {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
-
- @media (width <= 600px) {
- margin-bottom: 3rem;
- }
}
.page-link {
@@ -67,3 +76,26 @@
}
}
}
+
+@media screen and (width > 600px) {
+ .links{
+ display:grid;
+ margin-bottom: 3rem;
+ }
+
+ .menu-link{
+ display: none
+ }
+}
+
+
+@media screen and (width < 601px) {
+ .links{
+ display:none
+ }
+
+ .menu-link{
+ display: flex;
+ margin-bottom: 3rem;
+ }
+}
\ No newline at end of file
diff --git a/src/pages/homepage/HomePage.tsx b/src/pages/homepage/HomePage.tsx
index 241cd3d1..c8e435df 100644
--- a/src/pages/homepage/HomePage.tsx
+++ b/src/pages/homepage/HomePage.tsx
@@ -6,12 +6,16 @@ import {
DirectionsBusOutlined,
HistoryOutlined,
MapOutlined,
+ MenuOutlined,
ViewKanbanOutlined,
} from '@mui/icons-material'
import { SvgIconProps } from '@mui/material'
+import { useContext } from 'react'
+import { LayoutContextInterface, LayoutCtx } from 'src/layout/LayoutContext'
export const HomePage = () => {
const { t } = useTranslation()
+ const { setDrawerOpen } = useContext(LayoutCtx)
return (
@@ -19,6 +23,13 @@ export const HomePage = () => {
{t('homepage.welcome')}
{t('homepage.databus_definition')}
{t('homepage.website_goal')}
+
+ }
+ label={t('homepage.open_menu')}
+ to={() => setDrawerOpen(true)}
+ />
+
} label={t('timeline_page_title')} to="/timeline" />
} label={t('gaps_page_title')} to="/gaps" />
@@ -41,7 +52,7 @@ const PageLink = ({
}: {
icon: React.ReactElement
label: string
- to: To
+ to: To | (() => void)
}) => {
const { t } = useTranslation()
@@ -49,7 +60,11 @@ const PageLink = ({
{icon}
{label}
-
{t('homepage.show_button')}
+ {typeof to == 'function' ? (
+
{t('homepage.show_button')}
+ ) : (
+
{t('homepage.show_button')}
+ )}
)
}