Skip to content

Commit 4d7bf2e

Browse files
authored
Merge pull request #70 from zesty-io/development
opening bad links fix and styles fixes
2 parents bc72ea8 + edb439d commit 4d7bf2e

File tree

4 files changed

+95
-57
lines changed

4 files changed

+95
-57
lines changed

dist/live-editor.production.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/BreadCrumbs/Subheaders.tsx

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import AddToPhotosIcon from "@mui/icons-material/AddToPhotos"
77
import ArchiveIcon from "@mui/icons-material/Archive"
88
import EditIcon from "@mui/icons-material/Edit"
99
import AutoFixHighIcon from "@mui/icons-material/AutoFixHigh"
10-
import MobileFriendlyIcon from "@mui/icons-material/MobileFriendly"
11-
import DevicesIcon from "@mui/icons-material/Devices"
1210

1311
interface Btn {
1412
name: string
@@ -32,7 +30,6 @@ export const Subheaders = ({
3230
response,
3331
onClick,
3432
}: Props) => {
35-
const [isMobile, setisMobile] = React.useState(true)
3633
const managerLinks = [
3734
{
3835
name: "Edit Schema",
@@ -58,6 +55,20 @@ export const Subheaders = ({
5855
content?.zestyInstanceZUID || headerZUID(response)
5956
}.manager.zesty.io/content/${content?.meta?.model?.zuid}/${content?.meta?.zuid}`,
6057
},
58+
{
59+
name: "",
60+
label: "",
61+
href: `https://${
62+
content?.zestyInstanceZUID || headerZUID(response)
63+
}.manager.zesty.io/content/${content?.meta?.model?.zuid}/${content?.meta?.zuid}`,
64+
},
65+
{
66+
name: "",
67+
label: "",
68+
href: `https://${
69+
content?.zestyInstanceZUID || headerZUID(response)
70+
}.manager.zesty.io/content/${content?.meta?.model?.zuid}/${content?.meta?.zuid}`,
71+
},
6172
{
6273
name: "Edit Permission",
6374
icon: (
@@ -75,16 +86,6 @@ export const Subheaders = ({
7586
// @ts-ignore
7687
window.open(url, "_blank").focus()
7788
}
78-
79-
const handleDevPreview = (isMobile: boolean) => {
80-
setisMobile(!isMobile)
81-
if (isMobile) {
82-
handleMobile()
83-
} else {
84-
handleDesktop()
85-
}
86-
}
87-
8889
return (
8990
<>
9091
<Box
@@ -113,22 +114,6 @@ export const Subheaders = ({
113114
</Box>
114115
)
115116
})}
116-
<Box>
117-
{
118-
<CustomLink onClick={() => handleDevPreview(isMobile)} theme={theme}>
119-
<Box sx={{ display: "flex", alignItems: "center", gap: ".5rem" }}>
120-
<Box style={{ fontSize: "22px" }}>
121-
{!isMobile ? (
122-
<MobileFriendlyIcon fontSize="inherit" />
123-
) : (
124-
<DevicesIcon fontSize="inherit" />
125-
)}
126-
</Box>
127-
<Box paddingBottom={1}>{"Device Preview"}</Box>
128-
</Box>
129-
</CustomLink>
130-
}
131-
</Box>
132117
</Box>
133118
<Box
134119
paddingX={2}
@@ -203,28 +188,3 @@ export const Subheaders = ({
203188
</>
204189
)
205190
}
206-
207-
export const handleMobile = (id = "__next") => {
208-
const mainSite: any = typeof window !== "undefined" && document.getElementById(id)!
209-
mainSite.style.width = "414px"
210-
mainSite.style.height = "auto"
211-
mainSite.style.overflow = "hidden"
212-
mainSite.style.position = "absolute"
213-
mainSite.style.left = "60vw"
214-
mainSite.style.top = "10vh"
215-
216-
// @ts-ignore
217-
document.getElementsByTagName("meta")["viewport"].content = "width= 400"
218-
}
219-
export const handleDesktop = (id = "__next") => {
220-
const mainSite: any = typeof window !== "undefined" && document.getElementById(id)!
221-
mainSite.style.width = "auto"
222-
mainSite.style.height = "auto"
223-
mainSite.style.overflow = "hidden"
224-
mainSite.style.position = "relative"
225-
mainSite.style.left = "0"
226-
mainSite.style.top = "0"
227-
228-
// @ts-ignore
229-
document.getElementsByTagName("meta")["viewport"].content = "width= auto"
230-
}

src/components/Ui/LoginPromp.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { Box, Typography } from "@mui/material"
22
import { NormalBtn } from "components"
3+
import { assets } from "constants"
34
import React from "react"
45

56
const loginPromp = {
67
display: "flex",
78
flexDirection: "column",
89
justifyItems: "center",
10+
justifyContent: "center",
11+
alignItems: "center",
912
position: "fixed",
1013
top: "25%",
1114
left: "15%",
@@ -17,6 +20,31 @@ const loginPromp = {
1720
export const LoginPrompt = () => {
1821
return (
1922
<Box sx={loginPromp}>
23+
<Box
24+
paddingTop={1}
25+
sx={{
26+
width: "100%",
27+
display: "flex",
28+
flexDirection: "row",
29+
justifyItems: "center",
30+
justifyContent: "center",
31+
alignItems: "center",
32+
gap: ".5rem",
33+
}}
34+
>
35+
<img
36+
src={assets.zestyLogo}
37+
alt="Zesty Explorer"
38+
width={"100"}
39+
height={"100"}
40+
/>
41+
<img
42+
src={assets.zestyName}
43+
alt="Zesty Explorer"
44+
width={"150"}
45+
height={"150"}
46+
/>
47+
</Box>
2048
<Typography sx={{ fontSize: "32px", fontWeight: "bold" }}>
2149
Please Login
2250
</Typography>

src/utils/edit.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,53 @@ export const editModeFunc = (
127127
}
128128
})
129129
}
130+
131+
// const URL = "https://www.zesty.io/"
132+
// const mainSite =
133+
// typeof window !== "undefined" && document.getElementById("view-homepage")
134+
// const handleClick = () => {
135+
// // const viewport = document.querySelector("meta[name=viewport]")
136+
// // @ts-ignore
137+
// // viewport.setAttribute(
138+
// // "content",
139+
// // "width=200px, initial-scale=1.0, maximum-scale=2.0, user-scalable=0",
140+
// // )
141+
// // @ts-ignore
142+
// // mainSite.style.width = "480px"
143+
// // @ts-ignore
144+
// // mainSite.style.width = "300px"
145+
// // @ts-ignore
146+
// // mainSite.style.overflow = "hidden"
147+
148+
// // @ts-ignore
149+
// // mainSite.style.display = "none"
150+
// // const iframe = document.createElement("iframe")
151+
// // iframe.src = URL
152+
// // iframe.style.width = "400px"
153+
// // iframe.style.height = "80vh"
154+
// // iframe.style.margin = "0 auto"
155+
// // iframe.style.position = "absolute"
156+
// // iframe.style.left = "50%"
157+
// // iframe.style.right = "50%"
158+
// // iframe.style.display = "flex"
159+
// // iframe.style.justifyContent = "center"
160+
// // iframe.style.justifyItems = "center"
161+
// // document.body.appendChild(iframe)
162+
// // @ts-ignore
163+
// // document
164+
// // .getElementById("viewport")
165+
// // .setAttribute(
166+
// // "content",
167+
// // "initial-scale=0.5; maximum-scale=1.0; user-scalable=0;",
168+
// // )
169+
// document.getElementsByTagName("meta")["viewport"].content = "width= 400"
170+
171+
// // window.open(URL, "_blank", option_string)
172+
// }
173+
// const handleClick2 = () => {
174+
// // @ts-ignore
175+
// $iframe.style.width = "auto"
176+
177+
// // @ts-ignore
178+
// document.getElementsByTagName("meta")["viewport"].content = "width= 400px;"
179+
// }

0 commit comments

Comments
 (0)