mariko-h пре 1 месец
родитељ
комит
a855a1721e

+ 0 - 1
apps/app/src/client/components/PageEditor/EditorGuideModal/components/GuideRow.module.scss

@@ -12,7 +12,6 @@
 
 
 .codeBox {
 .codeBox {
   width: fit-content;
   width: fit-content;
-  background-color: var(--bs-dark);
 }
 }
 
 
 .codePre {
 .codePre {

+ 9 - 2
apps/app/src/client/components/PageEditor/EditorGuideModal/components/GuideRow.tsx

@@ -1,6 +1,7 @@
 import type React from 'react';
 import type React from 'react';
 import { useCallback } from 'react';
 import { useCallback } from 'react';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
+import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
 
 
 import { toastError, toastSuccess } from '~/client/util/toastr';
 import { toastError, toastSuccess } from '~/client/util/toastr';
 
 
@@ -36,6 +37,10 @@ export const GuideRow = ({
 
 
   const isFullWidth = minWidth === '100%' || !preview;
   const isFullWidth = minWidth === '100%' || !preview;
 
 
+  const { background, color } = oneDark[
+    'pre[class*="language-"]'
+  ] as React.CSSProperties;
+
   return (
   return (
     <section className={title !== '' ? 'mt-4 mb-2' : 'mb-2'}>
     <section className={title !== '' ? 'mt-4 mb-2' : 'mb-2'}>
       {title !== '' && <h3 className="fw-bold mb-2 fs-5 text-body">{title}</h3>}
       {title !== '' && <h3 className="fw-bold mb-2 fs-5 text-body">{title}</h3>}
@@ -47,10 +52,12 @@ export const GuideRow = ({
           style={{ minWidth: isFullWidth ? '100%' : minWidth }}
           style={{ minWidth: isFullWidth ? '100%' : minWidth }}
         >
         >
           <div
           <div
-            className={`${styles.codeBox} text-light p-2 ps-3 pe-5 rounded position-relative ${isFullWidth ? 'w-100' : ''}`}
+            className={`${styles.codeBox} rounded overflow-hidden position-relative ${isFullWidth ? 'w-100' : ''}`}
+            style={{ background }}
           >
           >
             <pre
             <pre
-              className={`${styles.codePre} small font-monospace text-white-50 ${isFullWidth ? 'text-wrap' : ''}`}
+              className={`${styles.codePre} small font-monospace ${isFullWidth ? 'text-wrap' : ''}`}
+              style={{ color }}
             >
             >
               {code}
               {code}
             </pre>
             </pre>