diff --git a/src/components/DeviceLocation.tsx b/src/components/DeviceLocation.tsx index 748bf2d8..028c9335 100644 --- a/src/components/DeviceLocation.tsx +++ b/src/components/DeviceLocation.tsx @@ -153,7 +153,7 @@ const DeviceLocation: VoidComponent = (props) => { return (
-
+
diff --git a/src/components/RouteStaticMap.tsx b/src/components/RouteStaticMap.tsx index 0492a68e..d1c2e6ec 100644 --- a/src/components/RouteStaticMap.tsx +++ b/src/components/RouteStaticMap.tsx @@ -30,7 +30,7 @@ const getStaticMapUrl = (gpsPoints: GPSPathPoint[]): string | undefined => { path.push([lng, lat]) }) const themeId = getThemeId() - return getPathStaticMapUrl(themeId, path, 343, 256, true) + return getPathStaticMapUrl(themeId, path, 512, 512, true) } const State = (props: { diff --git a/src/components/material/ButtonBase.tsx b/src/components/material/ButtonBase.tsx index 6dce1566..10487209 100644 --- a/src/components/material/ButtonBase.tsx +++ b/src/components/material/ButtonBase.tsx @@ -7,6 +7,7 @@ export type ButtonBaseProps = JSX.ButtonHTMLAttributes & { class?: string onClick?: (e: MouseEvent) => void href?: string + activeClass?: string } const ButtonBase: Component = (props) => { @@ -32,8 +33,9 @@ const ButtonBase: Component = (props) => { {(href) => ( {props.children} diff --git a/src/components/material/Card.tsx b/src/components/material/Card.tsx index 87e340d1..9bc746a7 100644 --- a/src/components/material/Card.tsx +++ b/src/components/material/Card.tsx @@ -13,9 +13,7 @@ type CardHeaderProps = { export const CardHeader: VoidComponent = (props) => { return ( -
+
{props.leading}
{props.headline && {props.headline}} @@ -75,17 +73,19 @@ type CardProps = { class?: string onClick?: () => void href?: string + activeClass?: string } const Card: ParentComponent = (props) => { return ( {props.children} diff --git a/src/components/material/List.tsx b/src/components/material/List.tsx index 1caa7ab0..aebea934 100644 --- a/src/components/material/List.tsx +++ b/src/components/material/List.tsx @@ -25,6 +25,7 @@ type ListItemProps = { trailing?: JSXElement onClick?: () => void href?: string + activeClass?: string } // TODO: guess variant from content @@ -47,6 +48,7 @@ export const ListItem: ParentComponent = (props) => { )} onClick={props.onClick} href={props.href} + activeClass={clsx('before:opacity-[.12]', props.activeClass)} > {props.leading} {props.children} diff --git a/src/pages/dashboard/Dashboard.tsx b/src/pages/dashboard/Dashboard.tsx index b6c37bd9..8518c36a 100644 --- a/src/pages/dashboard/Dashboard.tsx +++ b/src/pages/dashboard/Dashboard.tsx @@ -36,7 +36,7 @@ const DashboardDrawer: VoidComponent = (props) => { > comma connect -

+

Devices

@@ -52,7 +52,7 @@ const DashboardDrawer: VoidComponent = (props) => { ) } -const TwoPaneLayout: Component<{ +const DashboardLayout: Component<{ paneOne: JSXElement paneTwo: JSXElement paneTwoContent: boolean @@ -61,7 +61,7 @@ const TwoPaneLayout: Component<{
= () => { +const Dashboard: Component = () => { const location = useLocation() const pathParts = () => location.pathname.split('/').slice(1).filter(Boolean) @@ -107,7 +107,7 @@ const DashboardLayout: Component = () => { {(id) => ( - } paneTwo={
- Routes + Routes
diff --git a/src/pages/dashboard/activities/RouteActivity.tsx b/src/pages/dashboard/activities/RouteActivity.tsx index 89714889..bdc62fd9 100644 --- a/src/pages/dashboard/activities/RouteActivity.tsx +++ b/src/pages/dashboard/activities/RouteActivity.tsx @@ -8,13 +8,13 @@ import { import { getRoute } from '~/api/route' +import IconButton from '~/components/material/IconButton' +import TopAppBar from '~/components/material/TopAppBar' import RouteStaticMap from '~/components/RouteStaticMap' import RouteStatistics from '~/components/RouteStatistics' import Timeline from '~/components/Timeline' import { parseDateStr } from '~/utils/date' -import ActivityBar from '../components/ActivityBar' - const RouteVideoPlayer = lazy(() => import('~/components/RouteVideoPlayer')) type RouteActivityProps = { @@ -37,9 +37,9 @@ const RouteActivity: VoidComponent = (props) => { return ( <> - + arrow_back}> {startTime()} - +
= (props) => {
-

Route Map

-
+

Route Map

+
}> diff --git a/src/pages/dashboard/activities/SettingsActivity.tsx b/src/pages/dashboard/activities/SettingsActivity.tsx index 912d3d58..1b6bda41 100644 --- a/src/pages/dashboard/activities/SettingsActivity.tsx +++ b/src/pages/dashboard/activities/SettingsActivity.tsx @@ -10,9 +10,10 @@ import ButtonBase from '~/components/material/ButtonBase' import Button from '~/components/material/Button' import CircularProgress from '~/components/material/CircularProgress' import Icon from '~/components/material/Icon' +import IconButton from '~/components/material/IconButton' +import TopAppBar from '~/components/material/TopAppBar' import { createQuery } from '~/utils/createQuery' -import ActivityBar from '../components/ActivityBar' const useAction = (action: () => Promise): [() => void, Resource] => { const [source, setSource] = createSignal(false) @@ -352,9 +353,9 @@ const SettingsActivity: VoidComponent = (props) => { const [device] = createResource(() => props.dongleId, getDevice) return ( <> - + arrow_back}> Device Settings - +

comma prime

diff --git a/src/pages/dashboard/components/ActivityBar.tsx b/src/pages/dashboard/components/ActivityBar.tsx deleted file mode 100644 index fa7e3de9..00000000 --- a/src/pages/dashboard/components/ActivityBar.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { ParentComponent } from 'solid-js' - -import IconButton from '~/components/material/IconButton' -import TopAppBar from '~/components/material/TopAppBar' - -interface ActivityBarProps { - backHref: string -} - -const ActivityBar: ParentComponent = (props) => { - return arrow_back} - trailing={} - > - {props.children} - -} - -export default ActivityBar diff --git a/src/pages/dashboard/components/DeviceList.tsx b/src/pages/dashboard/components/DeviceList.tsx index cde27173..ad5bc9e2 100644 --- a/src/pages/dashboard/components/DeviceList.tsx +++ b/src/pages/dashboard/components/DeviceList.tsx @@ -37,6 +37,7 @@ const DeviceList: VoidComponent = (props) => { selected={isSelected(device)} onClick={onClick(device)} href={`/${device.dongle_id}`} + activeClass="before:bg-primary" > = (props) => { const endTime = () => dayjs(props.route.end_time_utc_millis) return ( - + -
- }> - - -
- @@ -54,7 +51,7 @@ type RouteListProps = { const RouteList: VoidComponent = (props) => { const dimensions = useDimensions() - const pageSize = () => Math.max(Math.ceil((dimensions().height / 2) / 348), 1) + const pageSize = () => Math.max(Math.ceil((dimensions().height / 2) / 140), 1) const endpoint = () => `/v1/devices/${props.dongleId}/routes_segments?limit=${pageSize()}` const getKey = (previousPageData?: RouteSegments[]): string | undefined => { if (!previousPageData) return endpoint() @@ -105,7 +102,7 @@ const RouteList: VoidComponent = (props) => { return ( {() => ( -
+
)}} >