2022-03-17 15:56:08 +00:00
import { Alert , AlertTitle , Button , Grid , Typography } from "@mui/material"
import React , { Component } from 'react'
import MediaQuery from 'react-responsive'
export default class UnsafeAlert extends Component {
constructor ( props ) {
super ( props ) ;
}
state = {
show : true ,
} ;
getHost ( ) {
var url = ( window . location != window . parent . location ) ? this . getHost ( document . referrer ) : document . location . href ;
return url . split ( '/' ) [ 2 ]
}
safe _urls = [
'robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion' ,
'robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion' ,
'robodevs7ixniseezbv7uryxhamtz3hvcelzfwpx3rvoipttjomrmpqd.onion' ,
]
render ( ) {
return (
( ! this . safe _urls . includes ( this . getHost ( ) ) & this . state . show ) ?
2022-03-18 21:21:13 +00:00
< div >
2022-03-17 15:56:08 +00:00
< MediaQuery minWidth = { 800 } >
2022-03-18 21:21:13 +00:00
< Alert severity = "warning" sx = { { maxHeight : 100 , zIndex : 9999 } } z - index = { 9999 }
2022-03-17 15:56:08 +00:00
action = { < Button onClick = { ( ) => this . setState ( { show : false } ) } > Hide < / B u t t o n > }
>
< AlertTitle > You are not using RoboSats privately < / A l e r t T i t l e >
Some features are disabled for your protection ( e . g . chat ) and you will not be able to complete a
trade without them . To protect your privacy and fully enable RoboSats , use < a href = 'https://www.torproject.org/download/' target = "_blank" > Tor Browser < /a> and visit the <a href='http:/ / robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid . onion ' target = "_blank" > Onion < / a > s i t e .
< / A l e r t >
< / M e d i a Q u e r y >
< MediaQuery maxWidth = { 799 } >
2022-03-18 21:21:13 +00:00
< Alert severity = "warning" sx = { { maxHeight : 100 , zIndex : 9999 } } z - index = { 9999 } >
2022-03-17 15:56:08 +00:00
< AlertTitle > You are not using RoboSats privately < / A l e r t T i t l e >
You will not be able to complete a
trade . Use < a href = 'https://www.torproject.org/download/' target = "_blank" > Tor Browser < /a> and visit the <a href='http:/ / robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid . onion ' target = "_blank" > Onion < / a > s i t e .
< div style = { { width : '100%' } } >
< / d i v >
< div align = "center" >
< Button onClick = { ( ) => this . setState ( { show : false } ) } > Hide < / B u t t o n >
< / d i v >
< / A l e r t >
< / M e d i a Q u e r y >
2022-03-18 21:21:13 +00:00
< / d i v >
2022-03-17 15:56:08 +00:00
:
null
)
}
}