Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename inspector styles for consistency #2282

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/css/admin.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "admin/viewer";
@import "admin/inspector";

#app {
font-family: sans-serif;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.viewer {
.inspector {
display: flex;
gap: 0.5em;
align-items: stretch;
}

.viewer__controls {
.inspector__controls {
display: flex;
flex: 0 0 24em;
flex-direction: column;
Expand Down Expand Up @@ -39,7 +39,7 @@
}
}

.viewer__modal {
.inspector__modal {
width: 80%;
max-width: 1024px;

Expand All @@ -64,7 +64,7 @@
}
}

.viewer__screen {
.inspector__screen {
flex: 1 1 auto;

iframe {
Expand Down
20 changes: 10 additions & 10 deletions assets/src/components/admin/inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const Inspector: ComponentType = () => {
useLayoutEffect(adjustFrame, [zoom]);

return (
<div className="viewer">
<div className="viewer__controls">
<div className="inspector">
<div className="inspector__controls">
<h1>Inspector</h1>

{config && (
Expand Down Expand Up @@ -109,7 +109,7 @@ const Inspector: ComponentType = () => {
)}
</div>

<div className="viewer__screen">
<div className="inspector__screen">
<iframe
name={INSPECTOR_FRAME_NAME}
onLoad={adjustFrame}
Expand Down Expand Up @@ -247,9 +247,9 @@ const ConfigControls: ComponentType<{ screen: ScreenWithId }> = ({
</button>
</div>

<dialog className="viewer__modal" ref={dialogRef}>
<dialog className="inspector__modal" ref={dialogRef}>
<button
className="viewer__modal__close-button"
className="inspector__modal__close-button"
onClick={() => {
dialogRef.current?.close();
setEditableConfig(null);
Expand Down Expand Up @@ -433,14 +433,14 @@ const AudioControls: ComponentType<{ screen: ScreenWithId }> = ({ screen }) => {
)}
</div>

<dialog className="viewer__modal" ref={dialogRef}>
<dialog className="inspector__modal" ref={dialogRef}>
<button
className="viewer__modal__close-button"
className="inspector__modal__close-button"
onClick={() => setSSML(null)}
>
× Close
</button>
<div className="viewer__modal__ssml">{ssml}</div>
<div className="inspector__modal__ssml">{ssml}</div>
</dialog>

{playingAt && (
Expand Down Expand Up @@ -478,11 +478,11 @@ const adjustScreenFrame = (
) => {
if (ref.current?.contentWindow) {
const doc = ref.current.contentWindow.document;
let style = doc.getElementById("viewer-injected-style");
let style = doc.getElementById("inspector-injected-style");

if (!style) {
style = doc.createElement("style");
style.id = "viewer-injected-style";
style.id = "inspector-injected-style";
doc.head.appendChild(style);
}

Expand Down
Loading