Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26a7749

Browse files
fixed public editor issues
1 parent5608340 commit26a7749

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

‎client/packages/lowcoder/src/pages/common/headerStartDropdown.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function HeaderStartDropdown(props: { setEdit: () => void, isViewMarketpl
100100
})}
101101
</CommonTextLabel>
102102
),
103-
visible:true,
103+
visible:!isPublicApp,
104104
},
105105
];
106106

‎client/packages/lowcoder/src/pages/common/previewHeader.tsx‎

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,22 @@ export function HeaderProfile(props: { user: User }) {
115115
const{ user}=props;
116116
constfetchingUser=useSelector(isFetchingUser);
117117
consttemplateId=useSelector(getTemplateId);
118+
constisPublicApp=useSelector(isPublicApplication);
119+
118120
if(fetchingUser){
119121
return<Skeleton.Avatarshape="circle"size={28}/>;
120122
}
121123
return(
122124
<div>
123125
{user.isAnonymous ?(
124126
!templateId ?(
125-
<LoginBtnbuttonType="primary"onClick={()=>history.push(AUTH_LOGIN_URL)}>
127+
<LoginBtnbuttonType="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
constheaderStart=(
149157
<>
150-
<StyledLinkonClick={()=>history.push(ALL_APPLICATIONS_URL)}>
158+
<StyledLinkonClick={()=>!isPublicApp&&history.push(ALL_APPLICATIONS_URL)}>
151159
<LogoIconbranding={true}/>
152160
</StyledLink>
153161
{isViewMarketplaceMode&&(
@@ -204,36 +212,44 @@ const PreviewHeaderComp = () => {
204212
</Wrapper>
205213
);
206214

207-
constheaderMiddle=(
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+
constheaderMiddle=useMemo(()=>{
216+
if(isPublicApp)returnnull;
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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp