fix(codebase): flip code viewer syntax highlighting to oneLight theme
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Loader2, AlertCircle, FileText, Copy, Check } from "lucide-react";
|
||||
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";
|
||||
import { oneLight } from "react-syntax-highlighter/dist/esm/styles/prism";
|
||||
import { THEME } from "@/components/project/dashboard-ui";
|
||||
|
||||
interface GiteaFileViewerProps {
|
||||
@@ -132,6 +132,11 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
flexDirection: "column",
|
||||
minHeight: 0,
|
||||
position: "relative",
|
||||
background: THEME.cardBg,
|
||||
border: `1px solid ${THEME.border}`,
|
||||
borderRadius: THEME.radiusSm,
|
||||
boxShadow: THEME.shadow,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -140,17 +145,16 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
padding: "8px 12px",
|
||||
background: "#1e1e1e",
|
||||
borderTopLeftRadius: THEME.radiusSm,
|
||||
borderTopRightRadius: THEME.radiusSm,
|
||||
borderBottom: "1px solid #333",
|
||||
background: THEME.subtleBg,
|
||||
borderBottom: `1px solid ${THEME.borderSoft}`,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
fontSize: "0.8rem",
|
||||
color: "#a1a1aa",
|
||||
color: THEME.mid,
|
||||
fontFamily: "ui-monospace, monospace",
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
{basename(path)}
|
||||
@@ -163,9 +167,10 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
gap: 6,
|
||||
background: "transparent",
|
||||
border: "none",
|
||||
color: copied ? "#10b981" : "#a1a1aa",
|
||||
color: copied ? "#059669" : THEME.mid,
|
||||
fontSize: "0.75rem",
|
||||
cursor: "pointer",
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
{copied ? <Check size={13} /> : <Copy size={13} />}
|
||||
@@ -175,11 +180,11 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
<div style={wrap}>
|
||||
<SyntaxHighlighter
|
||||
language={language}
|
||||
style={vscDarkPlus}
|
||||
style={oneLight}
|
||||
customStyle={{
|
||||
margin: 0,
|
||||
padding: "16px",
|
||||
background: "#1e1e1e",
|
||||
background: THEME.cardBg,
|
||||
fontSize: "0.8rem",
|
||||
fontFamily:
|
||||
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
||||
@@ -189,7 +194,7 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
lineNumberStyle={{
|
||||
minWidth: "3em",
|
||||
paddingRight: "1em",
|
||||
color: "#6e7681",
|
||||
color: THEME.muted,
|
||||
textAlign: "right",
|
||||
}}
|
||||
>
|
||||
@@ -228,7 +233,5 @@ const wrap: React.CSSProperties = {
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
overflow: "auto",
|
||||
background: "#1e1e1e",
|
||||
borderBottomLeftRadius: THEME.radiusSm,
|
||||
borderBottomRightRadius: THEME.radiusSm,
|
||||
background: THEME.cardBg,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user