22
33from reflex .components .component import ComponentNamespace
44from reflex .components .core .colors import color
5- from reflex .components .core .cond import color_mode_cond , cond
6- from reflex .components .core .responsive import tablet_and_desktop
5+ from reflex .components .core .cond import color_mode_cond
6+ from reflex .components .core .responsive import desktop_only
77from reflex .components .el .elements .inline import A
88from reflex .components .el .elements .media import Path , Rect , Svg
99from reflex .components .radix .themes .typography .text import Text
10- from reflex .experimental .client_state import ClientStateVar
1110from reflex .style import Style
12- from reflex .vars .base import Var , VarData
1311
1412
1513class StickyLogo (Svg ):
@@ -87,7 +85,7 @@ def create(cls):
8785 """
8886 return super ().create (
8987 StickyLogo .create (),
90- tablet_and_desktop (StickyLabel .create ()),
88+ desktop_only (StickyLabel .create ()),
9189 href = "https://reflex.dev" ,
9290 target = "_blank" ,
9391 width = "auto" ,
@@ -102,36 +100,12 @@ def add_style(self):
102100 Returns:
103101 The style of the component.
104102 """
105- is_localhost_cs = ClientStateVar .create (
106- "is_localhost" ,
107- default = True ,
108- global_ref = False ,
109- )
110- localhost_hostnames = Var .create (
111- ["localhost" , "127.0.0.1" , "[::1]" ]
112- ).guess_type ()
113- is_localhost_expr = localhost_hostnames .contains (
114- Var ("window.location.hostname" , _var_type = str ).guess_type (),
115- )
116- check_is_localhost = Var (
117- f"useEffect(({ is_localhost_cs } ) => { is_localhost_cs .set } ({ is_localhost_expr } ), [])" ,
118- _var_data = VarData (
119- imports = {"react" : "useEffect" },
120- ),
121- )
122- is_localhost = is_localhost_cs .value ._replace (
123- merge_var_data = VarData .merge (
124- check_is_localhost ._get_all_var_data (),
125- VarData (hooks = {str (check_is_localhost ): None }),
126- ),
127- )
128103 return Style (
129104 {
130105 "position" : "fixed" ,
131106 "bottom" : "1rem" ,
132107 "right" : "1rem" ,
133- # Do not show the badge on localhost.
134- "display" : cond (is_localhost , "none" , "flex" ),
108+ "display" : "flex" ,
135109 "flex-direction" : "row" ,
136110 "gap" : "0.375rem" ,
137111 "align-items" : "center" ,
0 commit comments