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
COPY package*.json ./
RUN npm install
COPY . .
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 --from=build /app/dist /usr/share/nginx/html

View File

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

View File

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

View File

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

View File

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

View File

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