From a55090073804f540baf90d5ab11ecc0f173c97aa Mon Sep 17 00:00:00 2001 From: TTPL-RT-52 Date: Fri, 26 Jul 2024 15:23:04 +0530 Subject: [PATCH 1/3] Issue #PS-1521 fix: Upcoming Extra Sessions cards copy UI implementation --- src/components/SessionCard.tsx | 29 ++++++++++++++++++++++++++++- src/services/Sessionservice.ts | 2 ++ src/utils/Interfaces.ts | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/components/SessionCard.tsx b/src/components/SessionCard.tsx index 5f3e25a0..b0e1d7d5 100644 --- a/src/components/SessionCard.tsx +++ b/src/components/SessionCard.tsx @@ -2,6 +2,7 @@ import { Box, Typography } from '@mui/material'; import { Session, SessionsCardProps } from '@/utils/Interfaces'; import CenterSessionModal from './CenterSessionModal'; +import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import EditOutlined from '@mui/icons-material/EditOutlined'; import PlannedSession from './PlannedSession'; import React from 'react'; @@ -12,6 +13,9 @@ const SessionsCard: React.FC = ({ data, children }) => { const [open, setOpen] = React.useState(false); const handleOpen = () => setOpen(true); const handleClose = () => setOpen(false); + + console.log(data.url, 'shreyas'); + return ( = ({ data, children }) => { sx={{ display: 'flex', justifyContent: 'space-between', - padding: '8px 16px', + padding: '8px 16px 4px', }} > @@ -46,6 +50,29 @@ const SessionsCard: React.FC = ({ data, children }) => { + + + {data?.url} + + + { teacherName: 'Mahima Shastri', topic: 'real numbers', subtopic: 'irrational numbers', + url: 'https://zoom.us/j/92735086013?a3t2172..', }, { id: 2, subject: 'Mathematics', time: '11 am - 12 pm', teacherName: 'vivek kasture', + url: 'https://zoom.us/j/92735086013?a3t2172', }, { id: 3, diff --git a/src/utils/Interfaces.ts b/src/utils/Interfaces.ts index a8fdf104..5d9059d3 100644 --- a/src/utils/Interfaces.ts +++ b/src/utils/Interfaces.ts @@ -342,6 +342,7 @@ export interface Session { teacherName: string; topic?: string; subtopic?: string; + url?: string; } export interface SessionCardFooterProps { From b4ac9610ede13be6b1cd8bfab73d61df0f6109b4 Mon Sep 17 00:00:00 2001 From: TTPL-RT-52 Date: Fri, 26 Jul 2024 15:24:55 +0530 Subject: [PATCH 2/3] Issue #PS-1521 fix: Upcoming Extra Sessions cards copy UI implementation --- src/components/SessionCard.tsx | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/SessionCard.tsx b/src/components/SessionCard.tsx index b0e1d7d5..1335294f 100644 --- a/src/components/SessionCard.tsx +++ b/src/components/SessionCard.tsx @@ -1,4 +1,4 @@ -import { Box, Typography } from '@mui/material'; +import { Box, Snackbar, Typography } from '@mui/material'; import { Session, SessionsCardProps } from '@/utils/Interfaces'; import CenterSessionModal from './CenterSessionModal'; @@ -11,10 +11,24 @@ import { useTheme } from '@mui/material/styles'; const SessionsCard: React.FC = ({ data, children }) => { const theme = useTheme(); const [open, setOpen] = React.useState(false); + const [snackbarOpen, setSnackbarOpen] = React.useState(false); + const handleOpen = () => setOpen(true); const handleClose = () => setOpen(false); + const handleSnackbarClose = () => setSnackbarOpen(false); - console.log(data.url, 'shreyas'); + const handleCopyUrl = () => { + if (data?.url) { + navigator.clipboard + .writeText(data.url) + .then(() => { + setSnackbarOpen(true); + }) + .catch((err) => { + console.error('Failed to copy: ', err); + }); + } + }; return ( = ({ data, children }) => { justifyContent: 'space-between', gap: '30px', }} + onClick={handleCopyUrl} > = ({ data, children }) => { textOverflow: 'ellipsis', overflow: 'hidden', width: '100%', + cursor: 'pointer', }} > {data?.url} - + = ({ data, children }) => { {children} + ); }; From d0437cd5046e7823c1bc665e5b94093396f848a4 Mon Sep 17 00:00:00 2001 From: TTPL-RT-52 Date: Fri, 26 Jul 2024 15:28:25 +0530 Subject: [PATCH 3/3] Issue #PS-1521 fix: Upcoming Extra Sessions cards copy UI implementation --- src/components/SessionCard.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/SessionCard.tsx b/src/components/SessionCard.tsx index 1335294f..11b1d59e 100644 --- a/src/components/SessionCard.tsx +++ b/src/components/SessionCard.tsx @@ -76,7 +76,7 @@ const SessionsCard: React.FC = ({ data, children }) => { = ({ data, children }) => { {data?.url}