From 5e7629a055e8568a0775436b1dbf5797a5640056 Mon Sep 17 00:00:00 2001 From: Blaster4385 Date: Sun, 3 Mar 2024 19:02:40 +0530 Subject: feat: formated code --- .../src/components/CustomSelect/CustomSelect.jsx | 2 +- .../CustomSelect/CustomSelect.module.css | 2 +- client/src/components/Editor/Editor.jsx | 47 +++-- client/src/components/Editor/Editor.module.css | 1 - client/src/components/Header/Header.jsx | 6 +- client/src/components/Header/Header.module.css | 4 +- .../components/prism-themes/prism-gruvbox-dark.css | 227 +++++++++++---------- 7 files changed, 149 insertions(+), 140 deletions(-) (limited to 'client/src/components') diff --git a/client/src/components/CustomSelect/CustomSelect.jsx b/client/src/components/CustomSelect/CustomSelect.jsx index 2f98b34..f588d38 100644 --- a/client/src/components/CustomSelect/CustomSelect.jsx +++ b/client/src/components/CustomSelect/CustomSelect.jsx @@ -4,7 +4,7 @@ import styles from "./CustomSelect.module.css"; const CustomSelect = ({ options, onSelect }) => { const [isOpen, setIsOpen] = useState(false); const [selectedOption, setSelectedOption] = useState( - options.length > 0 ? options[0] : null + options.length > 0 ? options[0] : null, ); const toggleDropdown = () => { diff --git a/client/src/components/CustomSelect/CustomSelect.module.css b/client/src/components/CustomSelect/CustomSelect.module.css index 1cd7b64..81f9e62 100644 --- a/client/src/components/CustomSelect/CustomSelect.module.css +++ b/client/src/components/CustomSelect/CustomSelect.module.css @@ -46,7 +46,7 @@ width: 8rem; font-size: 14px; } - + .selected__option { padding: 8px; } diff --git a/client/src/components/Editor/Editor.jsx b/client/src/components/Editor/Editor.jsx index 0a78ca8..8ff2ff7 100644 --- a/client/src/components/Editor/Editor.jsx +++ b/client/src/components/Editor/Editor.jsx @@ -49,29 +49,34 @@ const Editor = () => { if (response.ok) { const isURL = URL_REGEX.test(text); if (isURL) { - navigator.clipboard.writeText(`${CLIENT_BASE_URL}/r/${data.id}`).then(function () { - alert("Short URL copied to clipboard!"); - }, function (err) { - try { - var successful = document.execCommand('copy'); + navigator.clipboard.writeText(`${CLIENT_BASE_URL}/r/${data.id}`).then( + function () { alert("Short URL copied to clipboard!"); - } catch (err) { - console.log('Oops, unable to copy'); - } - }); - } - else { - navigator.clipboard.writeText(`${CLIENT_BASE_URL}/r/${data.id}`).then(function () { - navigator.clipboard.writeText(`${CLIENT_BASE_URL}/${data.id}`); - alert("URL copied to clipboard!"); - }, function (err) { - try { - var successful = document.execCommand('copy'); + }, + function (err) { + try { + var successful = document.execCommand("copy"); + alert("Short URL copied to clipboard!"); + } catch (err) { + console.log("Oops, unable to copy"); + } + }, + ); + } else { + navigator.clipboard.writeText(`${CLIENT_BASE_URL}/r/${data.id}`).then( + function () { + navigator.clipboard.writeText(`${CLIENT_BASE_URL}/${data.id}`); alert("URL copied to clipboard!"); - } catch (err) { - console.log('Oops, unable to copy'); - } - }); + }, + function (err) { + try { + var successful = document.execCommand("copy"); + alert("URL copied to clipboard!"); + } catch (err) { + console.log("Oops, unable to copy"); + } + }, + ); } navigate(`/${data.id}`); } else { diff --git a/client/src/components/Editor/Editor.module.css b/client/src/components/Editor/Editor.module.css index 702847d..62c6759 100644 --- a/client/src/components/Editor/Editor.module.css +++ b/client/src/components/Editor/Editor.module.css @@ -69,7 +69,6 @@ } @media screen and (max-width: 768px) { - .btn__save { bottom: 2rem; right: 2rem; diff --git a/client/src/components/Header/Header.jsx b/client/src/components/Header/Header.jsx index 712696c..9682104 100644 --- a/client/src/components/Header/Header.jsx +++ b/client/src/components/Header/Header.jsx @@ -7,7 +7,11 @@ import CustomSelect from "../CustomSelect/CustomSelect"; const Header = ({ isSelectVisible, onLanguageChange }) => { return (
-

minibin

+ +

+ minibin +

+ {isSelectVisible && (