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:
@ -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,
|
||||||
|
@ -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,
|
||||||
|
Reference in New Issue
Block a user