Skip to content

Commit de25d80

Browse files
fix: documentType parsing and update horizontal mobile layout on result (#16)
* fix: document code parsing * fix: update horizontal mobile layout on result * fix: result area height * fix: media query for mobile
1 parent b8f8c4f commit de25d80

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

css/index.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ img {
283283
color: #aaaaaa;
284284
}
285285

286+
.result-container .result-area {
287+
width: 100%;
288+
height: 84%;
289+
display: flex;
290+
flex-direction: column;
291+
}
292+
286293
.result-container .scanned-image {
287294
max-height: 200px;
288295
}
@@ -554,8 +561,14 @@ img {
554561
}
555562
}
556563

557-
@media screen and (max-width: 800px) and (orientation: landscape) {
564+
/* Media query for mobile phones */
565+
@media screen and (max-width: 926px) and (orientation: landscape) {
558566
.result-container .parsed-result-area .parsed-filed {
559567
font-size: 14px;
560568
}
569+
570+
.result-container .result-area {
571+
height: 70%;
572+
flex-direction: row;
573+
}
561574
}

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ <h3 style="font-weight: normal">Quick Start Options</h3>
314314
</svg>
315315
</div>
316316
</div>
317-
<div class="scanned-image"></div>
318-
<div class="parsed-result-area"></div>
317+
<div class="result-area">
318+
<div class="scanned-image"></div>
319+
<div class="parsed-result-area"></div>
320+
</div>
319321
<div class="scan-again">
320322
<button class="btn-scan-again">Scan Again</button>
321323
</div>

js/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function extractDocumentFields(result) {
4646
};
4747

4848
const getDocumentNumber = (documentType) => {
49-
const primaryField = documentType === "P" ? "passportNumber" : "documentNumber";
49+
const primaryField = documentType?.startsWith("P") ? "passportNumber" : "documentNumber";
5050
const primaryNumber = fieldWithStatus(primaryField);
5151
const longNumber = fieldWithStatus("longDocumentNumber");
5252

0 commit comments

Comments
 (0)