Skip to content

Commit

Permalink
Add input to toast to fix AT issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Kudinov committed Sep 4, 2024
1 parent e13623e commit c5920d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
29 changes: 29 additions & 0 deletions frontend/app/modules/toast/ToastInner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react'
import { styled } from 'styled-components'

const Div = styled.div`
border: 0px;
max-height: 1px;
height: 1px;
width: 100%;
position: relative;
input {
border: 0px;
max-height: 1px;
height: 1px;
background: transparent;
color: transparent;
}
`

const ToastInner = ({ text }: { text: string }) => (
<>
{text}
<Div>
<input type="text" value={text} />
</Div>
</>
)

export default ToastInner
6 changes: 4 additions & 2 deletions frontend/app/modules/toast/toast.store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { toast, ToastPosition } from 'react-toastify'
import { toast, ToastPosition, TypeOptions } from 'react-toastify'
import { RootStore } from '../../store/rootStore'
import ToastInner from './ToastInner'

export class ToastStore {
rootStore: RootStore
Expand All @@ -19,8 +20,9 @@ export class ToastStore {
theme: this.isDarkTheme ? 'dark' : 'light',
position: 'bottom-left' as ToastPosition,
autoClose: timeout,
type: 'info' as TypeOptions,
}

toast.info(text, toastOptions)
toast(ToastInner({ text }), toastOptions)
}
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-feature-smartapp",
"version": "2.4.0",
"version": "2.4.1",
"description": "SmartApp with all features",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit c5920d8

Please sign in to comment.