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

fix: Remove autofocus on dialog text input, reduce category image size #395

Merged
merged 2 commits into from
Apr 18, 2024
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
7 changes: 6 additions & 1 deletion ui/src/components/Player/DetectionCategoryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export default function DetectionCategoryButton({
alignItems: "center",
}}
>
<Image src={icon.src} alt={`${title} icon`} width={100} height={100} />
<Box sx={{ display: { xs: "block", sm: "none" } }}>
<Image src={icon.src} alt={`${title} icon`} width={20} height={20} />
</Box>
<Box sx={{ display: { xs: "none", sm: "block" } }}>
<Image src={icon.src} alt={`${title} icon`} width={100} height={100} />
</Box>
{title}
</Box>
);
Expand Down
13 changes: 4 additions & 9 deletions ui/src/components/Player/DetectionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import {
ToggleButton,
ToggleButtonGroup,
Typography,
useMediaQuery,
} from "@mui/material";
import { useTheme } from "@mui/material/styles";
import type { StaticImageData } from "next/legacy/image";
import { useState } from "react";

Expand Down Expand Up @@ -48,8 +46,6 @@ export default function DetectionDialog({
const [description, setDescription] = useState("");
const [playerOffset, setPlayerOffset] = useState<number>();
const [playlistTimestamp, setPlaylistTimestamp] = useState<number>();
const theme = useTheme();
const isDesktop = useMediaQuery(theme.breakpoints.up("sm"));

const submitDetection = useSubmitDetectionMutation({
onSuccess: () => {
Expand Down Expand Up @@ -175,9 +171,9 @@ export default function DetectionDialog({
size="large"
aria-label="Report sound"
fullWidth
orientation={isDesktop ? "horizontal" : "vertical"}
orientation="horizontal"
sx={{
marginY: isDesktop ? 4 : 1,
marginY: [1, 4],
}}
>
{categoryButtons.map(({ id, iconImage }) => (
Expand All @@ -188,8 +184,8 @@ export default function DetectionDialog({
component={Paper}
sx={{
"&&&": {
marginX: isDesktop ? 5 : 0,
marginY: isDesktop ? 0 : 1,
marginX: [1, 2],
marginY: [1, 0],
borderRadius: 1,
overflow: "visible",
border: "solid 2px",
Expand All @@ -209,7 +205,6 @@ export default function DetectionDialog({
))}
</ToggleButtonGroup>
<TextField
autoFocus
margin="dense"
placeholder="Describe what you heard (optional)"
type="text"
Expand Down
Loading