Skip to content

Commit fe90711

Browse files
authored
Merge pull request #156 from raktima-opensignlabs/login-header3
2 parents 31baefc + 5ba1f79 commit fe90711

File tree

5 files changed

+746
-755
lines changed

5 files changed

+746
-755
lines changed

microfrontends/SignDocuments/src/Component/component/header.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function Header({
3737
}) {
3838
const isMobile = window.innerWidth < 767;
3939
const navigate = useNavigate();
40-
40+
const isGuestSigner = localStorage.getItem("isGuestSigner");
4141
//for go to previous page
4242
function previousPage() {
4343
changePage(-1);
@@ -81,14 +81,16 @@ function Header({
8181

8282
return (
8383
<div
84-
style={{ paddingBottom: "5px", paddingTop: "5px" }}
84+
style={{ padding: !isGuestSigner && "5px 0px 5px 0px" }}
8585
className="mobileHead"
8686
>
8787
{isMobile && isShowHeader ? (
8888
<div
8989
id="navbar"
90-
className="stickyHead"
91-
style={{ width: window.innerWidth - 30 + "px" }}
90+
className={isGuestSigner ? "stickySignerHead" : "stickyHead"}
91+
style={{
92+
width: isGuestSigner ? window.innerWidth : window.innerWidth - 30 + "px"
93+
}}
9294
>
9395
<div className="preBtn2">
9496
<div

microfrontends/SignDocuments/src/Component/component/renderPdf.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ function RenderPdf({
4242
const isMobile = window.innerWidth < 767;
4343
const newWidth = window.innerWidth;
4444
const scale = isMobile ? pdfOriginalWidth / newWidth : 1;
45+
//check isGuestSigner is present in local if yes than handle login flow header in mobile view
46+
const isGuestSigner = localStorage.getItem("isGuestSigner");
47+
4548
//function for render placeholder block over pdf document
4649

4750
const checkSignedSignes = (data) => {
@@ -235,7 +238,8 @@ function RenderPdf({
235238
{isMobile && scale ? (
236239
<div
237240
style={{
238-
border: "0.1px solid #ebe8e8"
241+
border: "0.1px solid #ebe8e8",
242+
marginTop: isGuestSigner && "30px"
239243
}}
240244
ref={drop}
241245
id="container"
@@ -1281,4 +1285,4 @@ function RenderPdf({
12811285
);
12821286
}
12831287

1284-
export default RenderPdf;
1288+
export default RenderPdf;

microfrontends/SignDocuments/src/Component/login.js

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,15 @@ function Login() {
3838

3939
const handleChange = (event) => {
4040
const { value } = event.target;
41-
4241
setOTP(value);
4342
};
4443

4544
//send email OTP function
46-
4745
const SendOtp = async (e) => {
4846
const serverUrl =
4947
localStorage.getItem("baseUrl") && localStorage.getItem("baseUrl");
50-
5148
const parseId =
5249
localStorage.getItem("parseAppId") && localStorage.getItem("parseAppId");
53-
5450
if (serverUrl && localStorage) {
5551
setLoading(true);
5652
e.preventDefault();
@@ -84,13 +80,10 @@ function Login() {
8480
e.preventDefault();
8581
const serverUrl =
8682
localStorage.getItem("baseUrl") && localStorage.getItem("baseUrl");
87-
8883
const parseId =
8984
localStorage.getItem("parseAppId") && localStorage.getItem("parseAppId");
90-
9185
if (OTP) {
9286
setLoading(true);
93-
9487
try {
9588
let url = `${serverUrl}functions/AuthLoginAsMail/`;
9689
const headers = {
@@ -102,7 +95,6 @@ function Login() {
10295
otp: OTP
10396
};
10497
let user = await axios.post(url, body, { headers: headers });
105-
10698
if (user.data.result === "Invalid Otp") {
10799
alert("Invalid Otp");
108100
setLoading(false);
@@ -114,10 +106,12 @@ function Login() {
114106
localStorage.setItem("UserInformation", JSON.stringify(_user));
115107
localStorage.setItem("username", _user.name);
116108
localStorage.setItem("accesstoken", _user.sessionToken);
109+
//save isGuestSigner true in local to handle login flow header in mobile view
110+
localStorage.setItem("isGuestSigner", true);
117111
setLoading(false);
118-
//navigate user to on signature page
119-
// navigate(`/recipientSignPdf/${id}/${contactBookId}`);
120-
navigate(`/loadmf/signmicroapp/recipientSignPdf/${id}/${contactBookId}`);
112+
navigate(
113+
`/loadmf/signmicroapp/recipientSignPdf/${id}/${contactBookId}`
114+
);
121115
}
122116
} catch (error) {}
123117
} else {
@@ -173,9 +167,7 @@ function Login() {
173167
<span className="KNLO">
174168
Verification code is sent to your email
175169
</span>
176-
<div className="card card-box"
177-
style={{borderRadius:"0px"}}
178-
>
170+
<div className="card card-box" style={{ borderRadius: "0px" }}>
179171
<div className="card-body">
180172
<input
181173
type="email"
@@ -190,7 +182,6 @@ function Login() {
190182
<div className="btnContainer">
191183
{loading ? (
192184
<button
193-
// className="btn btn-info loadinBtn "
194185
type="button"
195186
style={{
196187
background: themeColor(),
@@ -214,15 +205,7 @@ function Login() {
214205
color: "white",
215206
marginLeft: "0px !important"
216207
}}
217-
// className="btn btn-sm otpButton"
218208
onClick={(e) => SendOtp(e)}
219-
// style={{
220-
// marginBottom: "4px",
221-
// width: "210px",
222-
// background: themeColor(),
223-
// color: "white",
224-
// fontWeight: "600"
225-
// }}
226209
>
227210
Send OTP
228211
</button>

microfrontends/SignDocuments/src/Component/recipientSignPdf.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function EmbedPdfImage() {
7474
return object.pageNumber === pageNumber;
7575
});
7676
const divRef = useRef(null);
77-
77+
//check isGuestSigner is present in local if yes than handle login flow header in mobile view
78+
const isGuestSigner = localStorage.getItem("isGuestSigner");
7879
useEffect(() => {
7980
const clientWidth = window.innerWidth;
8081
const pdfWidth = clientWidth - 160 - 220 - 30;
@@ -1010,8 +1011,8 @@ function EmbedPdfImage() {
10101011
{/* pdf render view */}
10111012
<div
10121013
style={{
1013-
marginLeft: pdfOriginalWidth > 500 && "20px",
1014-
marginRight: pdfOriginalWidth > 500 && "20px"
1014+
marginLeft: !isGuestSigner && pdfOriginalWidth > 500 && "20px",
1015+
marginRight: !isGuestSigner && pdfOriginalWidth > 500 && "20px"
10151016
}}
10161017
>
10171018
{/* this modal is used show this document is already sign */}
@@ -1126,9 +1127,9 @@ function EmbedPdfImage() {
11261127
)}
11271128
</div>
11281129
)}
1129-
{/* ndD5gdaxqw */}
1130+
11301131
</DndProvider>
11311132
);
11321133
}
11331134

1134-
export default EmbedPdfImage;
1135+
export default EmbedPdfImage;

0 commit comments

Comments
 (0)