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

Minor fix for production #462

Merged
merged 4 commits into from
Mar 9, 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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"react-icons": "^4.8.0",
"react-query": "^3.39.3",
"react-router-dom": "^6.8.0",
"react-sync-board": "^1.2.5",
"react-sync-board": "^1.2.6",
"react-toastify": "^6.1.0",
"recoil": "^0.7.4",
"socket.io-client": "^4.1.2",
Expand Down
9 changes: 7 additions & 2 deletions src/gameComponents/Counter/Counter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const CounterPane = styled.div`
padding: 1rem;
margin: 0;
border: none;
margin-top: -1px;
min-width: 40px;
font-size: 1.2em;
flex: 1;
}

input {
Expand All @@ -33,11 +35,14 @@ const CounterPane = styled.div`
border-radius: 0 !important;
border: none !important;
margin: 0 -1px;
flex: 5;
}

h3 {
line-height: 1em;
user-select: none;
padding: 0;
padding-bottom: 0.5em;
margin: 0;
}
`}
Expand Down Expand Up @@ -81,7 +86,7 @@ const Counter = ({

return (
<CounterPane color={color}>
<h3>{label}</h3>
{label && <h3>{label}</h3>}
<div className="counter-content">
<button
onClick={decrement}
Expand Down
2 changes: 1 addition & 1 deletion src/gameComponents/boardBackgrounds.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ const backgrounds = [
const style = {
backgroundColor: color,
};
if (img.type) {
if (img?.type) {
const url = media2Url(img);
if (url) {
style.backgroundImage = `url(${url})`;
Expand Down
13 changes: 11 additions & 2 deletions src/hooks/useFullScreen.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import React from "react";
import { FullScreen, useFullScreenHandle } from "react-full-screen";
import { useTranslation } from "react-i18next";
import { toast } from "react-toastify";

export const FullScreenContext = React.createContext({});

export const FullScreenProvider = ({ children }) => {
const { t } = useTranslation();
const handle = useFullScreenHandle();

const toggleFullScreen = React.useCallback(() => {
handle.active ? handle.exit() : handle.enter();
}, [handle]);
try {
handle.active ? handle.exit() : handle.enter();
} catch (e) {
toast.info(t("You don't have the permissions to go fullscreen"), {
autoClose: 1000,
});
}
}, [handle, t]);

return (
<FullScreen handle={handle}>
Expand Down
10 changes: 8 additions & 2 deletions src/views/BoardView/WelcomeModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ const WelcomeModal = ({ show, setShow, welcome = true }) => {
const currentUrl = window.location.href;

const handleCopy = async () => {
await navigator.clipboard.writeText(window.location.href);
toast.info(t("Url copied to clipboard!"), { autoClose: 1000 });
try {
await navigator.clipboard.writeText(window.location.href);
toast.info(t("Url copied to clipboard!"), { autoClose: 1000 });
} catch (e) {
toast.info(t("You don't have the permissions to copy the Url"), {
autoClose: 1000,
});
}
};

return (
Expand Down
Loading