Tidy up the light bit of theming
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { useContext, useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
import { IdeContext } from 'src/components/IdeToolbarNew'
|
import { IdeContext } from 'src/components/IdeToolbarNew'
|
||||||
|
import { matchEditorVsDarkTheme } from 'src/components/IdeEditor'
|
||||||
|
|
||||||
const IdeConsole = () => {
|
const IdeConsole = () => {
|
||||||
const { state } = useContext(IdeContext)
|
const { state } = useContext(IdeContext)
|
||||||
@@ -9,21 +10,19 @@ const IdeConsole = () => {
|
|||||||
element.scrollTop = element.scrollHeight - element.clientHeight
|
element.scrollTop = element.scrollHeight - element.clientHeight
|
||||||
}
|
}
|
||||||
}, [state.consoleMessages])
|
}, [state.consoleMessages])
|
||||||
const matchEditorVsDarkThemeBg = { backgroundColor: 'rgb(30,30,30)' }
|
|
||||||
const matchEditorVsDarkThemeText = { color: 'rgb(212,212,212)' }
|
|
||||||
const matchEditorVsDarkThemeTextBrown = { color: 'rgb(206,144,120)' }
|
|
||||||
return (
|
return (
|
||||||
<div className="p-2 px-4 min-h-full" style={matchEditorVsDarkThemeBg}>
|
<div className="p-2 px-4 min-h-full" style={matchEditorVsDarkTheme.Bg}>
|
||||||
<div>
|
<div>
|
||||||
{state.consoleMessages?.map(({ type, message, time }, index) => (
|
{state.consoleMessages?.map(({ type, message, time }, index) => (
|
||||||
<pre
|
<pre
|
||||||
className="font-mono text-sm"
|
className="font-mono text-sm"
|
||||||
style={matchEditorVsDarkThemeText}
|
style={matchEditorVsDarkTheme.Text}
|
||||||
key={message + index}
|
key={message + index}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="text-xs font-bold pt-2"
|
className="text-xs font-bold pt-2"
|
||||||
style={matchEditorVsDarkThemeTextBrown}
|
style={matchEditorVsDarkTheme.TextBrown}
|
||||||
>
|
>
|
||||||
{time?.toLocaleString()}
|
{time?.toLocaleString()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useContext, useRef, useEffect } from 'react'
|
|||||||
import { Mosaic, MosaicWindow } from 'react-mosaic-component'
|
import { Mosaic, MosaicWindow } from 'react-mosaic-component'
|
||||||
import { IdeContext } from 'src/components/IdeToolbarNew'
|
import { IdeContext } from 'src/components/IdeToolbarNew'
|
||||||
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
||||||
import IdeEditor from 'src/components/IdeEditor'
|
import IdeEditor, { matchEditorVsDarkTheme } from 'src/components/IdeEditor'
|
||||||
import IdeViewer from 'src/components/IdeViewer'
|
import IdeViewer from 'src/components/IdeViewer'
|
||||||
import IdeConsole from 'src/components/IdeConsole'
|
import IdeConsole from 'src/components/IdeConsole'
|
||||||
import 'react-mosaic-component/react-mosaic-component.css'
|
import 'react-mosaic-component/react-mosaic-component.css'
|
||||||
@@ -67,7 +67,7 @@ const IdeContainer = () => {
|
|||||||
renderToolbar={() => (
|
renderToolbar={() => (
|
||||||
<div
|
<div
|
||||||
className="text-xs text-gray-400 pl-4 w-full py-px font-bold leading-loose border-b border-gray-700"
|
className="text-xs text-gray-400 pl-4 w-full py-px font-bold leading-loose border-b border-gray-700"
|
||||||
style={{ backgroundColor: 'rgb(55,55,55)' }}
|
style={matchEditorVsDarkTheme.lighterBg}
|
||||||
>
|
>
|
||||||
{id}
|
{id}
|
||||||
{id === 'Editor' && ` (${state.ideType})`}
|
{id === 'Editor' && ` (${state.ideType})`}
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ import { codeStorageKey } from 'src/helpers/hooks/useIdeState'
|
|||||||
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
||||||
const Editor = lazy(() => import('@monaco-editor/react'))
|
const Editor = lazy(() => import('@monaco-editor/react'))
|
||||||
|
|
||||||
|
export const matchEditorVsDarkTheme = {
|
||||||
|
// Some colors to roughly match the vs-dark editor theme
|
||||||
|
Bg: { backgroundColor: 'rgb(30,30,30)' },
|
||||||
|
lighterBg: { backgroundColor: 'rgb(55,55,55)' },
|
||||||
|
Text: { color: 'rgb(212,212,212)' },
|
||||||
|
TextBrown: { color: 'rgb(206,144,120)' },
|
||||||
|
}
|
||||||
|
|
||||||
const IdeEditor = () => {
|
const IdeEditor = () => {
|
||||||
const { state, thunkDispatch } = useContext(IdeContext)
|
const { state, thunkDispatch } = useContext(IdeContext)
|
||||||
const ideTypeToLanguageMap = {
|
const ideTypeToLanguageMap = {
|
||||||
|
|||||||
Reference in New Issue
Block a user