@@ -57,6 +57,8 @@ import {
5757 $project ,
5858 $publishedOrigin ,
5959 $userPlanFeatures ,
60+ $stagingUsername ,
61+ $stagingPassword ,
6062} from "~/shared/nano-states" ;
6163import {
6264 $publishDialog ,
@@ -72,6 +74,7 @@ import {
7274 GearIcon ,
7375 UpgradeIcon ,
7476 HelpIcon ,
77+ InfoCircleIcon ,
7578} from "@webstudio-is/icons" ;
7679import { AddDomain } from "./add-domain" ;
7780import { humanizeString } from "~/shared/string-utils" ;
@@ -100,6 +103,8 @@ const ChangeProjectDomain = ({
100103 const id = useId ( ) ;
101104 const publishedOrigin = useStore ( $publishedOrigin ) ;
102105 const selectedPagePath = useStore ( $selectedPagePath ) ;
106+ const stagingUsername = useStore ( $stagingUsername ) ;
107+ const stagingPassword = useStore ( $stagingPassword ) ;
103108
104109 const [ domain , setDomain ] = useState ( project . domain ) ;
105110 const [ error , setError ] = useState < string > ( ) ;
@@ -201,9 +206,11 @@ const ChangeProjectDomain = ({
201206 </ Grid >
202207 }
203208 >
204- < Grid gap = { 3 } >
205- < Grid gap = { 1 } >
206- < Label htmlFor = { id } > Domain:</ Label >
209+ < Grid gap = { 2 } >
210+ < Grid flow = "column" align = "center" gap = { 2 } >
211+ < Label htmlFor = { id } css = { { width : theme . spacing [ 20 ] } } >
212+ Domain:
213+ </ Label >
207214 < InputField
208215 text = "mono"
209216 id = { id }
@@ -231,6 +238,47 @@ const ChangeProjectDomain = ({
231238 />
232239 { error !== undefined && < Text color = "destructive" > { error } </ Text > }
233240 </ Grid >
241+ { stagingUsername && (
242+ < Grid flow = "column" align = "center" gap = { 2 } >
243+ < Label
244+ htmlFor = { `${ id } -username` }
245+ css = { { width : theme . spacing [ 20 ] } }
246+ >
247+ Username:
248+ </ Label >
249+ < InputField
250+ text = "mono"
251+ id = { `${ id } -username` }
252+ type = "text"
253+ value = { stagingUsername }
254+ readOnly
255+ />
256+ </ Grid >
257+ ) }
258+ { stagingPassword && (
259+ < Grid flow = "column" align = "center" gap = { 2 } >
260+ < Flex align = "center" gap = { 1 } css = { { width : theme . spacing [ 20 ] } } >
261+ < Label htmlFor = { `${ id } -password` } > Password:</ Label >
262+ < Tooltip
263+ content = "This password is read-only and cannot be changed. It is the same for every user. This prevents phishing attacks."
264+ variant = "wrapped"
265+ >
266+ < InfoCircleIcon
267+ tabIndex = { 0 }
268+ style = { { flexShrink : 0 } }
269+ color = { rawTheme . colors . foregroundSubtle }
270+ />
271+ </ Tooltip >
272+ </ Flex >
273+ < InputField
274+ text = "mono"
275+ id = { `${ id } -password` }
276+ type = "text"
277+ value = { stagingPassword }
278+ readOnly
279+ />
280+ </ Grid >
281+ ) }
234282 </ Grid >
235283 </ CollapsibleDomainSection >
236284 ) ;
0 commit comments