Skip to content

Commit

Permalink
Move Libraries to live under CompilerOpts
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Sep 25, 2023
1 parent 8c87318 commit 713fa61
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 204 deletions.
86 changes: 0 additions & 86 deletions frontend/src/components/Scratch/LibraryPanel.module.css

This file was deleted.

105 changes: 0 additions & 105 deletions frontend/src/components/Scratch/LibraryPanel.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/src/components/Scratch/Scratch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import AboutScratch from "./AboutScratch"
import DecompilationPanel from "./DecompilePanel"
import FamilyPanel from "./FamilyPanel"
import useLanguageServer from "./hooks/useLanguageServer"
import LibraryPanel from "./LibraryPanel"
import styles from "./Scratch.module.scss"
import ScratchMatchBanner from "./ScratchMatchBanner"
import ScratchToolbar from "./ScratchToolbar"
Expand All @@ -34,7 +33,6 @@ enum TabId {
DIFF = "scratch_diff",
DECOMPILATION = "scratch_decompilation",
FAMILY = "scratch_family",
LIBRARIES = "libraries",
}

const DEFAULT_LAYOUTS: Record<"desktop_2col" | "mobile_2row", Layout> = {
Expand All @@ -54,7 +52,6 @@ const DEFAULT_LAYOUTS: Record<"desktop_2col" | "mobile_2row", Layout> = {
TabId.SOURCE_CODE,
TabId.CONTEXT,
TabId.OPTIONS,
TabId.LIBRARIES,
],
},
{
Expand Down Expand Up @@ -95,7 +92,6 @@ const DEFAULT_LAYOUTS: Record<"desktop_2col" | "mobile_2row", Layout> = {
TabId.SOURCE_CODE,
TabId.CONTEXT,
TabId.OPTIONS,
TabId.LIBRARIES,
],
},
],
Expand Down Expand Up @@ -278,10 +274,6 @@ export default function Scratch({
return <Tab key={id} tabKey={id} label="Family">
{() => <FamilyPanel scratch={scratch} />}
</Tab>
case TabId.LIBRARIES:
return <Tab key={id} tabKey={id} label="Libraries">
<LibraryPanel scratch={scratch} onChange={setScratch} />
</Tab>
default:
return <Tab key={id} tabKey={id} label={id} disabled />
}
Expand Down
67 changes: 67 additions & 0 deletions frontend/src/components/compiler/CompilerOpts.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,70 @@
display: block;
width: 100%;
}

.library {
display: inline-flex;
flex-direction: row;

width: 100%;
border-radius: 0.5em;
}

.libraryName {
cursor: default;
font-size: 0.8rem;

font-size: 1.0em;
font-weight: 500;

padding: .5em;

}

.librarySelect {
flex-grow: 1;
}

.deleteButton {
display: flex;
align-items: center;
gap: 4px;
padding: 4px 8px;

cursor: pointer;

color: var(--g1900);
background: none;
border: 0;

}
.deleteButton > svg {
width: 1em;
color: var(--g1200);
}

.deleteButton:hover {
border-radius: 4px;
color: var(--g2000);
background: var(--g400);
}

.addLibraryRow {
display: inline-flex;
margin: 1em;
margin-bottom: 0em;
width: 100%;
}

.addLibraryRow > button {
margin-left: 1em;
margin-right: 1em;
}

.librariesGrid {
margin-top: 1.5em;
display: grid;
grid-template-columns: max-content 1fr max-content;
grid-auto-flow: row;
gap: 0.4em 0;
}
Loading

0 comments on commit 713fa61

Please sign in to comment.