Skip to content

Commit

Permalink
popup: warn type
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Jul 17, 2023
1 parent c80464d commit 0071ec1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ patch: ${JSON.stringify(
// https://github.com/fonsp/Pluto.jl/issues/55
// https://github.com/fonsp/Pluto.jl/issues/2398
open_pluto_popup({
type: "info",
type: "warn",
source_element: null,
body: html`<p>A new server was started - this notebook session is no longer running.</p>
<p>Would you like to go back to the main menu?</p>
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const help_circle_icon = new URL("https://cdn.jsdelivr.net/gh/ionic-team/

/**
* @typedef MiscPopupDetails
* @property {string} type
* @property {"info" | "warn"} type
* @property {import("../imports/Preact.js").ReactElement} body
* @property {HTMLElement?} source_element
*/
Expand Down Expand Up @@ -95,6 +95,7 @@ export const Popup = ({ notebook, disable_input }) => {
return html`<pluto-popup
class=${cl({
visible: recent_event != null,
[type ?? ""]: type != null,
})}
style="${pos_ref.current}"
>
Expand All @@ -105,7 +106,7 @@ export const Popup = ({ notebook, disable_input }) => {
recent_event=${recent_event}
clear_recent_event=${() => set_recent_event(null)}
/>`
: type === "info"
: type === "info" || type === "warn"
? html`<div>${recent_event?.body}</div>`
: null}
</pluto-popup>`
Expand Down
5 changes: 5 additions & 0 deletions frontend/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,11 @@ pluto-popup > * {
position: absolute;
}

pluto-popup.warn > * {
background: var(--pluto-logs-warn-color);
border-color: var(--pluto-logs-warn-accent-color);
}

pluto-popup code.auto_disabled_variable {
font-family: var(--julia-mono-font-stack);
font-size: 0.8rem;
Expand Down
2 changes: 1 addition & 1 deletion frontend/light_color.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

/*saveall container*/
--overlay-button-bg: #ffffff;
--overlay-button-border: #f3f2f2;
--overlay-button-border: hsl(0 4% 91% / 1);
--overlay-button-border-save: #f3f2f2;

/*input_context_menu*/
Expand Down

0 comments on commit 0071ec1

Please sign in to comment.