diff --git a/src/features/surveys/components/ShareSurveryModal/ShareSurveyModal.tsx b/src/features/surveys/components/ShareSurveryModal/ShareSurveyModal.tsx index e8f27be1..82a4dd52 100644 --- a/src/features/surveys/components/ShareSurveryModal/ShareSurveyModal.tsx +++ b/src/features/surveys/components/ShareSurveryModal/ShareSurveyModal.tsx @@ -1,5 +1,5 @@ import { LinkIcon } from '@heroicons/react/outline'; -import React, { useCallback, useRef } from 'react'; +import React from 'react'; import Button, { ButtonVariant } from 'shared/components/Button/Button'; import StyledDialog from 'shared/components/StyledDialog/StyledDialog'; import useTranslation from 'next-translate/useTranslation'; @@ -18,40 +18,24 @@ export default function ShareSurveyModal({ }: ShareSurveyModalProps) { const { t } = useTranslation('common'); const { copy } = useCopyToClipboard(); - const inputEl = useRef(null); const link = `${window.location.protocol}//${window.location.host}/survey/${surveyId}`; const handleCopy = () => { copy(link); - - if (inputEl.current) { - inputEl.current.select(); - } }; - const handleInputFocus = useCallback( - (e: React.FocusEvent) => { - e.target.select(); - }, - [] - ); - return (
- + + {link} +
diff --git a/src/shared/components/StyledDialog/StyledDialog.tsx b/src/shared/components/StyledDialog/StyledDialog.tsx index a74b7b5e..57c132e1 100644 --- a/src/shared/components/StyledDialog/StyledDialog.tsx +++ b/src/shared/components/StyledDialog/StyledDialog.tsx @@ -17,7 +17,7 @@ export default function StyledDialog({ isOpen, onClose, contentClassName = '', - centerTitle = false, + centerTitle = true, }: StyledDialogProps) { return ( @@ -47,7 +47,7 @@ export default function StyledDialog({ >