diff --git a/src/components/Pastes/CodeEditor.jsx b/src/components/Pastes/CodeEditor.jsx index ab5c8e6..8c477e2 100644 --- a/src/components/Pastes/CodeEditor.jsx +++ b/src/components/Pastes/CodeEditor.jsx @@ -34,13 +34,13 @@ const CodeEditor = ({ className = "", syntax, readOnly, onChange, value, editorE onChange={onChange} onMount={onMount} options={{ - minimap: { enabled: false }, + minimap: { enabled: true }, automaticLayout: true, fontFamily: 'Fira Code', fontLigatures: true, fontSize: 18, lineHeight: 1.5, - scrollbar: { verticalScrollbarSize: 0 }, + scrollbar: { verticalScrollbarSize: 10 }, wordWrap: "on", formatOnPaste: true, readOnly: readOnly || false, diff --git a/src/css/index.css b/src/css/index.css index 0d0111a..a6dc5a3 100644 --- a/src/css/index.css +++ b/src/css/index.css @@ -221,11 +221,11 @@ html, body, #root { } /* Tipografía global */ -div, +div:not(.monaco-editor *), +span:not(.monaco-editor *), label, input, p, -span, a, button { font-family: "Open Sans", sans-serif; diff --git a/src/util/constants.js b/src/util/constants.js deleted file mode 100644 index 1aaf0e6..0000000 --- a/src/util/constants.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const CONSTANTS = { - -}; - -export { CONSTANTS }; diff --git a/src/util/date.js b/src/util/date.js deleted file mode 100644 index c9d9dc3..0000000 --- a/src/util/date.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -const getNowAsLocalDatetime = () => { - const now = new Date(); - const offset = now.getTimezoneOffset(); // en minutos - const local = new Date(now.getTime() - offset * 60000); - return local.toISOString().slice(0, 16); -}; - -export { getNowAsLocalDatetime } \ No newline at end of file diff --git a/src/util/parsers/dateParser.js b/src/util/parsers/dateParser.js deleted file mode 100644 index dc80506..0000000 --- a/src/util/parsers/dateParser.js +++ /dev/null @@ -1,30 +0,0 @@ -export const DateParser = { - sqlToString: (sqlDate) => { - const [datePart] = sqlDate.split('T'); - const [year, month, day] = datePart.split('-'); - return `${day}/${month}/${year}`; - }, - - timestampToString: (timestamp) => { - const [datePart] = timestamp.split('T'); - const [year, month, day] = datePart.split('-'); - return `${day}/${month}/${year}`; - }, - - isoToStringWithTime: (isoString) => { - if (!isoString) return '—'; - - const date = new Date(isoString); - if (isNaN(date)) return '—'; // Para proteger aún más por si llega basura - - return new Intl.DateTimeFormat('es-ES', { - day: '2-digit', - month: '2-digit', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - hour12: false, - timeZone: 'Europe/Madrid' - }).format(date); - } -}; diff --git a/src/util/parsers/errorParser.js b/src/util/parsers/errorParser.js deleted file mode 100644 index 971bcd8..0000000 --- a/src/util/parsers/errorParser.js +++ /dev/null @@ -1,10 +0,0 @@ -export const errorParser = (err) => { - const message = err.response?.data?.message; - try { - const parsed = JSON.parse(message); - return Object.values(parsed)[0]; - // eslint-disable-next-line no-unused-vars - } catch (e) { - return message || err.message || "Unknown error"; - } -}; diff --git a/src/util/passwordGenerator.js b/src/util/passwordGenerator.js deleted file mode 100644 index 9a99610..0000000 --- a/src/util/passwordGenerator.js +++ /dev/null @@ -1,29 +0,0 @@ -export const generateSecurePassword = (length = 12) => { - const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - const lower = 'abcdefghijklmnopqrstuvwxyz'; - const digits = '0123456789'; - const symbols = '!@#$%^&*'; // <- compatibles con bcrypt - const all = upper + lower + digits + symbols; - - if (length < 8) length = 8; - - const getRand = (chars) => chars[Math.floor(Math.random() * chars.length)]; - - let password = [ - getRand(upper), - getRand(lower), - getRand(digits), - getRand(symbols), - ]; - - for (let i = password.length; i < length; i++) { - password.push(getRand(all)); - } - - for (let i = password.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - [password[i], password[j]] = [password[j], password[i]]; - } - - return password.join(''); -}; diff --git a/src/util/tokenUtils.js b/src/util/tokenUtils.js deleted file mode 100644 index 38e5970..0000000 --- a/src/util/tokenUtils.js +++ /dev/null @@ -1,7 +0,0 @@ -export const parseJwt = (token) => { - try { - return JSON.parse(atob(token.split('.')[1])); - } catch (e) { - return null; - } -};