Merge branch 'main' into develop

This commit is contained in:
MAZE 2024-04-22 23:44:09 +03:30
commit 908fe01c5e
6 changed files with 37 additions and 7 deletions

View File

@ -1,11 +1,11 @@
FROM node:20-alpine3.18 AS build FROM docker.io/node:20-alpine3.18 AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM nginx:alpine AS runtime FROM docker.io/nginx:alpine AS runtime
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html

View File

@ -86,5 +86,9 @@
&:hover { &:hover {
background-color: var(--color-neutral-100); background-color: var(--color-neutral-100);
} }
&:focus-visible {
outline: 1px solid white;
}
} }
} }

View File

@ -27,4 +27,8 @@
& span { & span {
font-size: var(--font-lg); font-size: var(--font-lg);
} }
&:focus-visible {
outline: 1px solid white;
}
} }

View File

@ -23,6 +23,10 @@
&:hover { &:hover {
background-color: var(--color-neutral-200); background-color: var(--color-neutral-200);
} }
&:focus-visible {
outline: 1px solid white;
}
} }
.tooltip { .tooltip {

View File

@ -24,4 +24,8 @@
&.isFavorite { &.isFavorite {
color: var(--color-foreground); color: var(--color-foreground);
} }
&:focus-visible {
outline: 1px solid white;
}
} }

View File

@ -65,20 +65,34 @@ export function Sound({
}, [unselect, setVolume, id]); }, [unselect, setVolume, id]);
const toggle = useCallback(() => { const toggle = useCallback(() => {
if (isSelected) return _unselect(); if (isSelected) _unselect();
else _select();
}, [isSelected, _select, _unselect]);
_select(); const handleClick = useCallback(() => {
}, [isSelected, _unselect, _select]); toggle();
}, [toggle]);
const handleKeyDown = useCallback(
(event: React.KeyboardEvent<HTMLDivElement>) => {
if (event.key === 'Enter') {
toggle();
}
},
[toggle],
);
return ( return (
<div <div
role="button"
tabIndex={0}
className={cn( className={cn(
styles.sound, styles.sound,
isSelected && styles.selected, isSelected && styles.selected,
hidden && styles.hidden, hidden && styles.hidden,
)} )}
onClick={toggle} onClick={handleClick}
onKeyDown={toggle} onKeyDown={handleKeyDown}
> >
<Favorite id={id} /> <Favorite id={id} />
<div className={styles.icon}> <div className={styles.icon}>