From e7bae279434e09b73469bdffac40bd09db516de9 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:00:29 +0530 Subject: [PATCH 01/31] feat: add button --- src/components/atoms/buttons/AddButton.tsx | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/components/atoms/buttons/AddButton.tsx diff --git a/src/components/atoms/buttons/AddButton.tsx b/src/components/atoms/buttons/AddButton.tsx new file mode 100644 index 00000000..cc4f77f8 --- /dev/null +++ b/src/components/atoms/buttons/AddButton.tsx @@ -0,0 +1,36 @@ +import { IconButton } from "@mui/material"; +import { Add } from "@mui/icons-material"; +import React, { FC } from "react"; + +interface AddButtonProps { + handleClick: () => void; + size?: "small" | "medium" | "large"; + title?: string; + disabled?: boolean; + hoverEffect?: boolean; + style?: React.CSSProperties; +} + +export const AddButton: FC = ( + { handleClick, + size , + title, + disabled = false, + hoverEffect= true, + style + }) => { + return ( + + {title} + + ); +}; From e2c56be61fdcb67c7daeacb485837b1c32ab6f3c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:01:04 +0530 Subject: [PATCH 02/31] feat: breakpoint button --- .../atoms/buttons/BreakpointButton.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/atoms/buttons/BreakpointButton.tsx diff --git a/src/components/atoms/buttons/BreakpointButton.tsx b/src/components/atoms/buttons/BreakpointButton.tsx new file mode 100644 index 00000000..d9d6d483 --- /dev/null +++ b/src/components/atoms/buttons/BreakpointButton.tsx @@ -0,0 +1,31 @@ +import { IconButton } from "@mui/material"; +import { Circle } from "@mui/icons-material"; +import React, { FC } from "react"; + +interface BreakpointButtonProps { + handleClick: () => void; + size?: "small" | "medium" | "large"; + changeColor?: boolean; +} + +export const BreakpointButton = + ({ handleClick, size, changeColor }: BreakpointButtonProps) => { + return ( + + + + ); +}; From 33f37f35bc059d068e348b80b7383091a710408e Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:01:22 +0530 Subject: [PATCH 03/31] feat: clear button --- src/components/atoms/buttons/ClearButton.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/components/atoms/buttons/ClearButton.tsx diff --git a/src/components/atoms/buttons/ClearButton.tsx b/src/components/atoms/buttons/ClearButton.tsx new file mode 100644 index 00000000..d299285e --- /dev/null +++ b/src/components/atoms/buttons/ClearButton.tsx @@ -0,0 +1,17 @@ +import { IconButton } from "@mui/material"; +import { Clear } from "@mui/icons-material"; +import React, { FC } from "react"; + +interface ClearButtonProps { + handleClick: () => void; + size?: "small" | "medium" | "large"; +} + +export const ClearButton: FC = ({ handleClick, size }) => { + return ( + + + + ); +}; From 2419df9bdc2d2eb0832041a34e2f47edd3d5f141 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:01:41 +0530 Subject: [PATCH 04/31] feat: edit button --- src/components/atoms/buttons/EditButton.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/components/atoms/buttons/EditButton.tsx diff --git a/src/components/atoms/buttons/EditButton.tsx b/src/components/atoms/buttons/EditButton.tsx new file mode 100644 index 00000000..d66da56e --- /dev/null +++ b/src/components/atoms/buttons/EditButton.tsx @@ -0,0 +1,17 @@ +import { IconButton } from "@mui/material"; +import { Edit } from "@mui/icons-material"; +import React, { FC } from "react"; + +interface EditButtonProps { + handleClick: () => void; + size?: "small" | "medium" | "large"; +} + +export const EditButton: FC = ({ handleClick, size }) => { + return ( + + + + ); +}; From 6a0663e2f4ebc1ffb9c35ad290f0f6f84ce1ebec Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:01:56 +0530 Subject: [PATCH 05/31] feat: remove button --- src/components/atoms/buttons/RemoveButton.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/components/atoms/buttons/RemoveButton.tsx diff --git a/src/components/atoms/buttons/RemoveButton.tsx b/src/components/atoms/buttons/RemoveButton.tsx new file mode 100644 index 00000000..95bef0ca --- /dev/null +++ b/src/components/atoms/buttons/RemoveButton.tsx @@ -0,0 +1,17 @@ +import { IconButton } from "@mui/material"; +import { Remove } from "@mui/icons-material"; +import React, { FC } from "react"; + +interface RemoveButtonProps { + handleClick: () => void; + size?: "small" | "medium" | "large"; +} + +export const RemoveButton: FC = ({ handleClick, size }) => { + return ( + + + + ); +}; From 6074192510112d1055e3f1cbe1864cf45ded2745 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:02:17 +0530 Subject: [PATCH 06/31] feat: alert --- src/components/atoms/AlertSnackbar.tsx | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/components/atoms/AlertSnackbar.tsx diff --git a/src/components/atoms/AlertSnackbar.tsx b/src/components/atoms/AlertSnackbar.tsx new file mode 100644 index 00000000..0b3a5382 --- /dev/null +++ b/src/components/atoms/AlertSnackbar.tsx @@ -0,0 +1,40 @@ +import * as React from 'react'; +import Snackbar from '@mui/material/Snackbar'; +import MuiAlert, { AlertProps } from '@mui/material/Alert'; +import { useGlobalInfoStore } from "../../context/globalInfo"; + +const Alert = React.forwardRef(function Alert( + props, + ref, +) { + return ; +}); + +export interface AlertSnackbarProps { + severity: 'error' | 'warning' | 'info' | 'success', + message: string, + isOpen: boolean, +}; + +export const AlertSnackbar = ({ severity, message, isOpen }: AlertSnackbarProps) => { + const [open, setOpen] = React.useState(isOpen); + + const { closeNotify } = useGlobalInfoStore(); + + const handleClose = (event?: React.SyntheticEvent | Event, reason?: string) => { + if (reason === 'clickaway') { + return; + } + + closeNotify(); + setOpen(false); + }; + + return ( + + + {message} + + + ); +} From ce8562539c442c88d02ccee0151bea5bf9e552a8 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:02:30 +0530 Subject: [PATCH 07/31] feat: generic box --- src/components/atoms/Box.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/components/atoms/Box.tsx diff --git a/src/components/atoms/Box.tsx b/src/components/atoms/Box.tsx new file mode 100644 index 00000000..da6b19dd --- /dev/null +++ b/src/components/atoms/Box.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import Box from '@mui/material/Box'; +import { Typography } from "@mui/material"; + +interface BoxProps { + width: number | string, + height: number | string, + background: string, + radius: string, + children?: JSX.Element, +}; + +export const SimpleBox = ({width, height, background, radius, children}: BoxProps) => { + return ( + + {children} + + ); +} From 549f1a79c7af1bc02be6626533caf3a3bdb4f1ea Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:02:46 +0530 Subject: [PATCH 08/31] feat: dropdown --- src/components/atoms/DropdownMui.tsx | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/components/atoms/DropdownMui.tsx diff --git a/src/components/atoms/DropdownMui.tsx b/src/components/atoms/DropdownMui.tsx new file mode 100644 index 00000000..b74b5f2a --- /dev/null +++ b/src/components/atoms/DropdownMui.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { FormControl, InputLabel, Select } from "@mui/material"; +import { SelectChangeEvent } from "@mui/material/Select/Select"; + +interface DropdownProps { + id: string; + label: string; + value: string | undefined; + handleSelect: (event: SelectChangeEvent) => void; + children? : React.ReactNode; +}; + +export const Dropdown = ({id, label, value, handleSelect, children}: DropdownProps) => { + return ( + + {label} + + + ); +}; From bf33d07ef8ce967050f9f317a4e0324796115076 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:03:06 +0530 Subject: [PATCH 09/31] feat: generic modal --- src/components/atoms/GenericModal.tsx | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/components/atoms/GenericModal.tsx diff --git a/src/components/atoms/GenericModal.tsx b/src/components/atoms/GenericModal.tsx new file mode 100644 index 00000000..0e760c3d --- /dev/null +++ b/src/components/atoms/GenericModal.tsx @@ -0,0 +1,44 @@ +import React, { FC } from 'react'; +import { Modal, IconButton, Box } from '@mui/material'; +import { Clear } from "@mui/icons-material"; + +interface ModalProps { + isOpen: boolean; + onClose: () => void; + children?: JSX.Element; + modalStyle?: React.CSSProperties; + canBeClosed?: boolean; +} + +export const GenericModal: FC = ( + { isOpen, onClose, children, modalStyle , canBeClosed= true}) => { + + return ( + {}} > + + {canBeClosed ? + + + + : null + } + {children} + + + ); +}; + + const defaultModalStyle = { + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: 500, + bgcolor: 'background.paper', + boxShadow: 24, + p: 4, + height:'60%', + display:'block', + overflow:'scroll', + padding: '5px 25px 10px 25px', +}; From 1eace29d26d86e66b52165d390a24a9888a9c22d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:03:24 +0530 Subject: [PATCH 10/31] feat: generic modal --- src/components/atoms/KeyValuePair.tsx | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/components/atoms/KeyValuePair.tsx diff --git a/src/components/atoms/KeyValuePair.tsx b/src/components/atoms/KeyValuePair.tsx new file mode 100644 index 00000000..d42ffe6f --- /dev/null +++ b/src/components/atoms/KeyValuePair.tsx @@ -0,0 +1,52 @@ +import React, { forwardRef, useImperativeHandle } from "react"; +import { Box, TextField } from "@mui/material"; + +interface KeyValueFormProps { + keyLabel?: string; + valueLabel?: string; +} + +export const KeyValuePair = forwardRef(({keyLabel, valueLabel}: KeyValueFormProps, ref) => { + const [key, setKey] = React.useState(''); + const [value, setValue] = React.useState(''); + useImperativeHandle(ref, () => ({ + getKeyValuePair() { + return { key, value }; + } + })); + return ( + :not(style)': { m: 1, width: '100px' }, + }} + noValidate + autoComplete="off" + > + ) => setKey(event.target.value)} + size="small" + required + /> + ) => { + const num = Number(event.target.value); + if (isNaN(num)){ + setValue(event.target.value); + } + else { + setValue(num); + } + }} + size="small" + required + /> + + ); +}); From c266951a2a82566fbf426503f39dab4853aaf40d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:03:38 +0530 Subject: [PATCH 11/31] feat: loader --- src/components/atoms/Loader.tsx | 84 +++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/components/atoms/Loader.tsx diff --git a/src/components/atoms/Loader.tsx b/src/components/atoms/Loader.tsx new file mode 100644 index 00000000..cc855863 --- /dev/null +++ b/src/components/atoms/Loader.tsx @@ -0,0 +1,84 @@ +import styled from "styled-components"; +import { Stack } from "@mui/material"; + +export const Loader = () => { + return ( + + + Loading... + + ); +} + +const StyledParagraph = styled.p` + font-size: x-large; + font-family: inherit; + color: #1976d2; + display: grid; + justify-content: center; +`; + +const StyledLoader = styled.div` + border-radius: 50%; + color: #1976d2; + font-size: 11px; + text-indent: -99999em; + margin: 55px auto; + position: relative; + width: 10em; + height: 10em; + box-shadow: inset 0 0 0 1em; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + &:before { + position: absolute; + content: ''; + border-radius: 50%; + width: 5.2em; + height: 10.2em; + background: #ffffff; + border-radius: 10.2em 0 0 10.2em; + top: -0.1em; + left: -0.1em; + -webkit-transform-origin: 5.1em 5.1em; + transform-origin: 5.1em 5.1em; + -webkit-animation: load2 2s infinite ease 1.5s; + animation: load2 2s infinite ease 1.5s; + } + &:after { + position: absolute; + content: ''; + border-radius: 50%; + width: 5.2em; + height: 10.2em; + background: #ffffff; + border-radius: 0 10.2em 10.2em 0; + top: -0.1em; + left: 4.9em; + -webkit-transform-origin: 0.1em 5.1em; + transform-origin: 0.1em 5.1em; + -webkit-animation: load2 2s infinite ease; + animation: load2 2s infinite ease; + } + @-webkit-keyframes load2 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + @keyframes load2 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } +`; From a1a4aa00b74047380ae9dea876c9bc47f7ecda81 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:03:59 +0530 Subject: [PATCH 12/31] feat: pair div --- src/components/atoms/PairDisplayDiv.tsx | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/components/atoms/PairDisplayDiv.tsx diff --git a/src/components/atoms/PairDisplayDiv.tsx b/src/components/atoms/PairDisplayDiv.tsx new file mode 100644 index 00000000..10d88ab4 --- /dev/null +++ b/src/components/atoms/PairDisplayDiv.tsx @@ -0,0 +1,42 @@ +import React, { FC } from 'react'; +import Typography from '@mui/material/Typography'; +import { WhereWhatPair } from "@wbr-project/wbr-interpret"; +import styled from "styled-components"; + +interface PairDisplayDivProps { + index: string; + pair: WhereWhatPair; +} + +export const PairDisplayDiv: FC = ({index, pair}) => { + + return ( +
+ + {`Index: ${index}`} + { pair.id ? `, Id: ${pair.id}` : ''} + + + {"Where:"} + + +
{JSON.stringify(pair?.where, undefined, 2)}
+
+ + {"What:"} + + +
{JSON.stringify(pair?.what,undefined, 2)}
+
+
+ ); +} + +const DescriptionWrapper = styled.div` + margin: 0; + font-family: "Roboto","Helvetica","Arial",sans-serif; + font-weight: 400; + font-size: 1rem; + line-height: 1.5; + letter-spacing: 0.00938em; +`; From 3d4f302af4906c26cd82d465641ec870c74fa08e Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:04:48 +0530 Subject: [PATCH 13/31] feat: recorder icon --- src/components/atoms/RecorderIcon.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/components/atoms/RecorderIcon.tsx diff --git a/src/components/atoms/RecorderIcon.tsx b/src/components/atoms/RecorderIcon.tsx new file mode 100644 index 00000000..27fbfc6c --- /dev/null +++ b/src/components/atoms/RecorderIcon.tsx @@ -0,0 +1,22 @@ +import React from 'react'; + +export const RecordingIcon = () => { + return ( + + + + + + + + ); +}; From a09c7ef0ec2d3edc9423aa5940fb346da52a796e Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:05:02 +0530 Subject: [PATCH 14/31] feat: text compont --- src/components/atoms/texts.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/components/atoms/texts.tsx diff --git a/src/components/atoms/texts.tsx b/src/components/atoms/texts.tsx new file mode 100644 index 00000000..e31b9ceb --- /dev/null +++ b/src/components/atoms/texts.tsx @@ -0,0 +1,15 @@ +import styled from "styled-components"; + +export const WarningText = styled.p` + border: 1px solid orange; + display: flex; + margin: 10px; + flex-direction: column; + font-size: small; + background: rgba(255,165,0,0.15); + padding: 5px; + font-family: "Roboto","Helvetica","Arial",sans-serif; + font-weight: 400; + line-height: 1.5; + letter-spacing: 0.00938em; +` From e07d47d9419f629c4ec5b281d14646cc81241e89 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:06:02 +0530 Subject: [PATCH 15/31] chore: lint --- src/components/atoms/buttons/AddButton.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/atoms/buttons/AddButton.tsx b/src/components/atoms/buttons/AddButton.tsx index cc4f77f8..716e346f 100644 --- a/src/components/atoms/buttons/AddButton.tsx +++ b/src/components/atoms/buttons/AddButton.tsx @@ -13,10 +13,10 @@ interface AddButtonProps { export const AddButton: FC = ( { handleClick, - size , + size, title, disabled = false, - hoverEffect= true, + hoverEffect = true, style }) => { return ( @@ -25,12 +25,12 @@ export const AddButton: FC = ( size={size || "small"} onClick={handleClick} disabled={disabled} - sx={ hoverEffect - ? {...style, '&:hover': { background: 'rgba(0, 0, 0, 0.05)', color: 'rgba(0, 0, 0, 0.54)' }} - : {...style, '&:hover': { color: '#1976d2', backgroundColor: 'white' }} - } + sx={hoverEffect + ? { ...style, '&:hover': { background: 'rgba(0, 0, 0, 0.05)', color: 'rgba(0, 0, 0, 0.54)' } } + : { ...style, '&:hover': { color: '#1976d2', backgroundColor: 'white' } } + } > - {title} + {title} ); }; From 366d0d2cddebbc31bbcd11d130614bbae4582bee Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:06:22 +0530 Subject: [PATCH 16/31] chore: lint --- .../atoms/buttons/BreakpointButton.tsx | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/atoms/buttons/BreakpointButton.tsx b/src/components/atoms/buttons/BreakpointButton.tsx index d9d6d483..5515a0ef 100644 --- a/src/components/atoms/buttons/BreakpointButton.tsx +++ b/src/components/atoms/buttons/BreakpointButton.tsx @@ -10,22 +10,22 @@ interface BreakpointButtonProps { export const BreakpointButton = ({ handleClick, size, changeColor }: BreakpointButtonProps) => { - return ( - - - - ); -}; + return ( + + + + ); + }; From 979d02f49d477f08f647c008e398712aac4af38f Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:06:50 +0530 Subject: [PATCH 17/31] chore: lint --- src/components/atoms/buttons/ClearButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/buttons/ClearButton.tsx b/src/components/atoms/buttons/ClearButton.tsx index d299285e..4eabf9fa 100644 --- a/src/components/atoms/buttons/ClearButton.tsx +++ b/src/components/atoms/buttons/ClearButton.tsx @@ -10,8 +10,8 @@ interface ClearButtonProps { export const ClearButton: FC = ({ handleClick, size }) => { return ( - + sx={{ color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}> + ); }; From f5c6705f9c96a1e7334473e9522b87b3456c7e5f Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:07:23 +0530 Subject: [PATCH 18/31] chore: lint --- src/components/atoms/buttons/EditButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/buttons/EditButton.tsx b/src/components/atoms/buttons/EditButton.tsx index d66da56e..cfef1a23 100644 --- a/src/components/atoms/buttons/EditButton.tsx +++ b/src/components/atoms/buttons/EditButton.tsx @@ -10,8 +10,8 @@ interface EditButtonProps { export const EditButton: FC = ({ handleClick, size }) => { return ( - + sx={{ color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}> + ); }; From 31f35c42a68ed0961db5320f5e2d661ee26e0bb8 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:07:42 +0530 Subject: [PATCH 19/31] chore: lint --- src/components/atoms/buttons/RemoveButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/buttons/RemoveButton.tsx b/src/components/atoms/buttons/RemoveButton.tsx index 95bef0ca..67dcd6cd 100644 --- a/src/components/atoms/buttons/RemoveButton.tsx +++ b/src/components/atoms/buttons/RemoveButton.tsx @@ -10,8 +10,8 @@ interface RemoveButtonProps { export const RemoveButton: FC = ({ handleClick, size }) => { return ( - + sx={{ '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}> + ); }; From c9ad26ccc17076bd4f77e506caf176679749efe5 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:08:16 +0530 Subject: [PATCH 20/31] chore: lint --- src/components/atoms/AlertSnackbar.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/atoms/AlertSnackbar.tsx b/src/components/atoms/AlertSnackbar.tsx index 0b3a5382..3cf5c554 100644 --- a/src/components/atoms/AlertSnackbar.tsx +++ b/src/components/atoms/AlertSnackbar.tsx @@ -31,10 +31,10 @@ export const AlertSnackbar = ({ severity, message, isOpen }: AlertSnackbarProps) }; return ( - - - {message} - - + + + {message} + + ); } From 3a72389f36978878fefb28e2058d6362a212ae60 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:08:41 +0530 Subject: [PATCH 21/31] chore: lint --- src/components/atoms/Box.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/atoms/Box.tsx b/src/components/atoms/Box.tsx index da6b19dd..a9d503e2 100644 --- a/src/components/atoms/Box.tsx +++ b/src/components/atoms/Box.tsx @@ -10,7 +10,7 @@ interface BoxProps { children?: JSX.Element, }; -export const SimpleBox = ({width, height, background, radius, children}: BoxProps) => { +export const SimpleBox = ({ width, height, background, radius, children }: BoxProps) => { return ( Date: Sat, 15 Jun 2024 21:09:22 +0530 Subject: [PATCH 22/31] chore: lint --- src/components/atoms/canvas.tsx | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 6a2f9dea..5152cf5e 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -1,22 +1,16 @@ -import React, {useCallback, useEffect, useRef} from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import { useSocketStore } from '../../context/socket'; import { getMappedCoordinates } from "../../helpers/inputHelpers"; import { useGlobalInfoStore } from "../../context/globalInfo"; interface CreateRefCallback { - (ref: React.RefObject): void; - } interface CanvasProps { - width: number; - height: number; - onCreateRef: CreateRefCallback; - } /** @@ -40,7 +34,7 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { }; const lastMousePosition = useRef({ x: 0, y: 0 }); - //const lastWheelPosition = useRef({ deltaX: 0, deltaY: 0 }); + //const lastWheelPosition = useRef({ deltaX: 0, deltaY: 0 }); const onMouseEvent = useCallback((event: MouseEvent) => { if (socket) { @@ -57,12 +51,12 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { case 'mousemove': const coordinates = getMappedCoordinates(event, canvasRef.current, width, height); if (lastMousePosition.current.x !== coordinates.x || - lastMousePosition.current.y !== coordinates.y) { + lastMousePosition.current.y !== coordinates.y) { lastMousePosition.current = { x: coordinates.x, y: coordinates.y, }; - socket.emit('input:mousemove', { + socket.emit('input:mousemove', { x: coordinates.x, y: coordinates.y, }); @@ -122,21 +116,21 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { } }; - }else { + } else { console.log('Canvas not initialized'); } }, [onMouseEvent]); return ( - // - + // + ); }; From 1fe5082b2fda3f99dcad36d9cf6a44e48668f041 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:09:37 +0530 Subject: [PATCH 23/31] chore: lint --- src/components/atoms/DropdownMui.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/atoms/DropdownMui.tsx b/src/components/atoms/DropdownMui.tsx index b74b5f2a..ff97ff71 100644 --- a/src/components/atoms/DropdownMui.tsx +++ b/src/components/atoms/DropdownMui.tsx @@ -7,16 +7,16 @@ interface DropdownProps { label: string; value: string | undefined; handleSelect: (event: SelectChangeEvent) => void; - children? : React.ReactNode; + children?: React.ReactNode; }; -export const Dropdown = ({id, label, value, handleSelect, children}: DropdownProps) => { +export const Dropdown = ({ id, label, value, handleSelect, children }: DropdownProps) => { return ( {label}