Skip to content

Commit

Permalink
change toast message display to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Feb 16, 2022
1 parent cce39f3 commit 039b0c3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api_docs.md.erb
Expand Up @@ -5,7 +5,7 @@
<% end %>
<% if (request.has_params? || request.has_body?) %>
<% if request.display_body.length > 4 %>
### Request
**Request**

```
<%=
Expand All @@ -14,7 +14,7 @@
```
<% end %>
<% end %>
### Response
**Response**

```
<%=
Expand Down
18 changes: 18 additions & 0 deletions frontend/css/toastr.scss
Expand Up @@ -58,6 +58,11 @@
.toast-title,
.toast-message {
color: $dark_gray;
.markdown {
* {
color: $dark_gray;
}
}
}
}
&.green,
Expand All @@ -69,6 +74,11 @@
.toast-title,
.toast-message {
color: $off_white;
.markdown {
* {
color: $off_white;
}
}
}
}
}
Expand All @@ -83,6 +93,14 @@
.toast-message {
pointer-events: none;
font-size: 1.3rem;
.markdown {
p {
width: unset;
text-overflow: unset;
overflow: unset;
white-space: unset;
}
}
}

.toast-loader {
Expand Down
4 changes: 2 additions & 2 deletions frontend/os_download/content.tsx
Expand Up @@ -65,8 +65,8 @@ const PLATFORM_DATA = (): PlatformContent[] => [
imageUrl: RPI4().imageUrl,
releaseTag: RPI4().releaseTag,
kits: [
"Genesis v1.6.1 (red cable)",
"Genesis XL v1.6.1 (red cable)",
"Genesis v1.6.1 (white cable)",
"Genesis XL v1.6.1 (white cable)",
],
}]
: []),
Expand Down
5 changes: 4 additions & 1 deletion frontend/toast/fb_toast.tsx
Expand Up @@ -3,6 +3,7 @@ import { isUndefined } from "lodash";
import { Actions } from "../constants";
import { ToastProps, ToastsProps, ToastState } from "./interfaces";
import { store } from "../redux/store";
import { Markdown } from "../ui";

export class Toast extends React.Component<ToastProps, ToastState> {
state: ToastState = {
Expand Down Expand Up @@ -66,7 +67,9 @@ export class Toast extends React.Component<ToastProps, ToastState> {
onMouseLeave={() => this.setState({ isHovered: false })}>
<h4 className={"toast-title"}>{this.props.title}</h4>
<div className={"toast-message"}>
{this.props.message.replace(/\s+/g, " ")}
<Markdown>
{this.props.message.replace(/\s+/g, " ")}
</Markdown>
</div>
<div className={"toast-loader"}>
<div className={`toast-loader-left ${color}`} style={style}></div>
Expand Down

0 comments on commit 039b0c3

Please sign in to comment.