@@ -115,14 +115,22 @@ export function HeaderProfile(props: { user: User }) {
115115 const { user } = props ;
116116 const fetchingUser = useSelector ( isFetchingUser ) ;
117117 const templateId = useSelector ( getTemplateId ) ;
118+ const isPublicApp = useSelector ( isPublicApplication ) ;
119+
118120 if ( fetchingUser ) {
119121 return < Skeleton . Avatar shape = "circle" size = { 28 } /> ;
120122 }
121123 return (
122124 < div >
123125 { user . isAnonymous ? (
124126 ! templateId ? (
125- < LoginBtn buttonType = "primary" onClick = { ( ) => history . push ( AUTH_LOGIN_URL ) } >
127+ < LoginBtn buttonType = "primary" onClick = { ( ) => {
128+ if ( isPublicApp ) {
129+ window . top ?. open ( 'https://app.lowcoder.cloud/user/auth/login' ) ;
130+ } else {
131+ history . push ( AUTH_LOGIN_URL )
132+ }
133+ } } >
126134 { trans ( "userAuth.login" ) }
127135 </ LoginBtn >
128136 ) : null
@@ -147,7 +155,7 @@ const PreviewHeaderComp = () => {
147155
148156 const headerStart = (
149157 < >
150- < StyledLink onClick = { ( ) => history . push ( ALL_APPLICATIONS_URL ) } >
158+ < StyledLink onClick = { ( ) => ! isPublicApp && history . push ( ALL_APPLICATIONS_URL ) } >
151159 < LogoIcon branding = { true } />
152160 </ StyledLink >
153161 { isViewMarketplaceMode && (
@@ -204,36 +212,44 @@ const PreviewHeaderComp = () => {
204212 </ Wrapper >
205213 ) ;
206214
207- const headerMiddle = (
208- < >
209- { /* Devices */ }
210- < Segmented < DeviceType >
211- options = { [
212- { value : 'mobile' , icon : < MobileOutlined /> } ,
213- { value : 'tablet' , icon : < TabletOutlined /> } ,
214- { value : 'desktop' , icon : < DesktopOutlined /> } ,
215- ] }
216- value = { editorState . deviceType }
217- onChange = { ( value ) => {
218- editorState . setDeviceType ( value ) ;
219- } }
220- />
221-
222- { /* Orientation */ }
223- { editorState . deviceType !== 'desktop' && (
224- < Segmented < DeviceOrientation >
215+ const headerMiddle = useMemo ( ( ) => {
216+ if ( isPublicApp ) return null ;
217+
218+ return (
219+ < >
220+ { /* Devices */ }
221+ < Segmented < DeviceType >
225222 options = { [
226- { value : 'portrait' , label : "Portrait" } ,
227- { value : 'landscape' , label : "Landscape" } ,
223+ { value : 'mobile' , icon : < MobileOutlined /> } ,
224+ { value : 'tablet' , icon : < TabletOutlined /> } ,
225+ { value : 'desktop' , icon : < DesktopOutlined /> } ,
228226 ] }
229- value = { editorState . deviceOrientation }
227+ value = { editorState . deviceType }
230228 onChange = { ( value ) => {
231- editorState . setDeviceOrientation ( value ) ;
229+ editorState . setDeviceType ( value ) ;
232230 } }
233231 />
234- ) }
235- </ >
236- ) ;
232+
233+ { /* Orientation */ }
234+ { editorState . deviceType !== 'desktop' && (
235+ < Segmented < DeviceOrientation >
236+ options = { [
237+ { value : 'portrait' , label : "Portrait" } ,
238+ { value : 'landscape' , label : "Landscape" } ,
239+ ] }
240+ value = { editorState . deviceOrientation }
241+ onChange = { ( value ) => {
242+ editorState . setDeviceOrientation ( value ) ;
243+ } }
244+ />
245+ ) }
246+ </ >
247+ ) ;
248+ } , [
249+ isPublicApp ,
250+ editorState . deviceType ,
251+ editorState . deviceOrientation ,
252+ ] ) ;
237253
238254 return (
239255 < Header
0 commit comments