Skip to content

Commit

Permalink
UI/UX fine update
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed Oct 18, 2024
1 parent 1745d04 commit aa877c3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/components/home/HomeTabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext } from "react";
import { Tabs, Tab, SxProps, Theme } from "@mui/material";
import {
Star as StarIcon,
CompassCalibration as CompassCalibrationIcon,
NearMe as NearMeIcon,
Bookmark as BookmarkIcon,
} from "@mui/icons-material";
import { useTranslation } from "react-i18next";
Expand All @@ -28,7 +28,7 @@ const HomeTabbar = ({ homeTab, onChangeTab }: HomeTabbarProps) => {
>
<Tab
iconPosition="start"
icon={<CompassCalibrationIcon />}
icon={<NearMeIcon />}
label={t("附近")}
value="nearby"
disableRipple
Expand Down Expand Up @@ -91,5 +91,11 @@ const tabbarSx: SxProps<Theme> = {
},
[`& .MuiTabs-flexContainer`]: {
justifyContent: "flex-start",
"& svg": {
fontSize: "1rem",
},
"& .MuiTab-root": {
fontSize: "0.8em",
},
},
};
1 change: 1 addition & 0 deletions src/components/home/SuccinctEtas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const secondarySx: SxProps<Theme> = {
lineHeight: "1.43",
whiteSpace: "nowrap",
textAlign: "right",
opacity: 0.8,
};

const waitTimeSx: SxProps<Theme> = {
Expand Down
12 changes: 11 additions & 1 deletion src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
WbSunny as WbSunnyIcon,
DarkMode as DarkModeIcon,
WifiOff as WifiOffIcon,
Search as SearchIcon,
} from "@mui/icons-material";
import { visuallyHidden } from "@mui/utils";
import AppContext from "../../context/AppContext";
Expand Down Expand Up @@ -124,6 +125,7 @@ const Header = () => {
type="text"
value={searchRoute}
placeholder={t("路線")}
startAdornment={<SearchIcon fontSize="small" sx={{ opacity: 0.8 }} />}
onChange={(e) => {
if (
e.target.value.toUpperCase() in routeList ||
Expand All @@ -142,7 +144,7 @@ const Header = () => {
navigate(`/${language}/board`, { replace: true });
}}
/>
<Box sx={funcPanelSx}>
<Box sx={weatherPanelSx}>
{weatherCodes.slice(0, 2).map((code) => (
<Avatar
onClick={() =>
Expand All @@ -158,6 +160,8 @@ const Header = () => {
sx={weatherImg}
/>
))}
</Box>
<Box sx={funcPanelSx}>
{geoPermission === "granted" && (
<IconButton
aria-label="relocate"
Expand Down Expand Up @@ -237,9 +241,15 @@ const searchRouteInputSx: SxProps<Theme> = {
},
};

const weatherPanelSx: SxProps<Theme> = {
display: "flex",
alignContent: "center",
};

const funcPanelSx: SxProps<Theme> = {
display: "flex",
alignItems: "center",
opacity: 0.7,
};

const languageSx: SxProps<Theme> = {
Expand Down

0 comments on commit aa877c3

Please sign in to comment.