Refactor theme handling in ScriptDetail and SubmitScript components to use resolvedTheme instead of theme for improved consistency in dark mode styling.

This commit is contained in:
2025-08-15 23:46:28 +01:00
parent 00b79f3537
commit 5d7a1cce2d
2 changed files with 8 additions and 8 deletions

View File

@ -138,7 +138,7 @@ echo "Setting up Docker environment for $PROJECT_NAME..."
export default function ScriptDetail() { export default function ScriptDetail() {
const { scriptId } = useParams(); const { scriptId } = useParams();
const { user } = useAuth(); const { user } = useAuth();
const { theme } = useTheme(); const { resolvedTheme } = useTheme();
// API hooks // API hooks
const { data: script } = useScript(scriptId || ''); const { data: script } = useScript(scriptId || '');
@ -360,7 +360,7 @@ export default function ScriptDetail() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,
@ -404,7 +404,7 @@ export default function ScriptDetail() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,
@ -423,7 +423,7 @@ export default function ScriptDetail() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,

View File

@ -29,7 +29,7 @@ import {
export default function SubmitScript() { export default function SubmitScript() {
const { user } = useAuth(); const { user } = useAuth();
const navigate = useNavigate(); const navigate = useNavigate();
const { theme } = useTheme(); const { resolvedTheme } = useTheme();
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [showPreview, setShowPreview] = useState(false); const [showPreview, setShowPreview] = useState(false);
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
@ -336,7 +336,7 @@ export default function SubmitScript() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,
@ -484,7 +484,7 @@ export default function SubmitScript() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,
@ -525,7 +525,7 @@ export default function SubmitScript() {
<div className="rounded-lg overflow-hidden border"> <div className="rounded-lg overflow-hidden border">
<SyntaxHighlighter <SyntaxHighlighter
language="bash" language="bash"
style={theme === 'dark' ? vscDarkPlus : vs} style={resolvedTheme === 'dark' ? vscDarkPlus : vs}
customStyle={{ customStyle={{
margin: 0, margin: 0,
borderRadius: 0, borderRadius: 0,