Skip to content

Commit b592878

Browse files
authored
Merge pull request #381 from topcoder-platform/temp-reskin
improvement(reskin) : qa part 4 f2f
2 parents b8fd0e5 + 7904ef0 commit b592878

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

src-ts/lib/work-provider/work-functions/work-factory/work.factory.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import * as DesignPrices from '../../../../../src/constants'
55
import * as ProblemPrices from '../../../../../src/constants/products/DataAdvisory'
66
import * as DataPrices from '../../../../../src/constants/products/DataExploration'
77
import * as FindDataPrices from '../../../../../src/constants/products/FindMeData'
8+
import * as WebsitePrices from '../../../../../src/constants/products/WebsiteDesign'
9+
810
import { Challenge, ChallengeMetadata } from '../work-store'
911

1012
import { ChallengeStatus } from './challenge-status.enum'
@@ -50,11 +52,8 @@ function getCost(challenge: Challenge, type: WorkType): number | undefined {
5052
return DataPrices.PROMOTIONAL_PRODUCT_PRICE || DataPrices.BASE_PRODUCT_PRICE
5153

5254
case WorkType.design:
53-
const pageCount: number = getCountFromString(findMetadata(challenge, 'basicInfo.numberOfPages')?.value)
54-
const deviceCount: number = getCountFromString(findMetadata(challenge, 'basicInfo.numberOfDevices')?.value)
55-
return DesignPrices.BASE_PRODUCT_PRICE +
56-
pageCount * DesignPrices.PER_PAGE_COST +
57-
pageCount * (deviceCount - 1) * DesignPrices.PER_PAGE_COST
55+
return WebsitePrices.BASE_PRODUCT_PRICE
56+
5857

5958
case WorkType.findData:
6059
return FindDataPrices.PROMOTIONAL_PRODUCT_PRICE || FindDataPrices.BASE_PRODUCT_PRICE

src/hooks/useCheckMobileScreen.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React, { useEffect, useState } from "react";
2+
3+
const useCheckMobileScreen = () => {
4+
const [width, setWidth] = useState(window.innerWidth);
5+
const handleWindowSizeChange = () => {
6+
setWidth(window.innerWidth);
7+
};
8+
9+
useEffect(() => {
10+
window.addEventListener("resize", handleWindowSizeChange);
11+
return () => {
12+
window.removeEventListener("resize", handleWindowSizeChange);
13+
};
14+
}, []);
15+
16+
return width <= 768;
17+
};
18+
19+
export default useCheckMobileScreen;

src/routes/Products/components/BasicInfo/styles.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
@import "styles/include";
1+
@import '../../../../../src-ts/lib/styles';
22

33
.footerContent {
44
display: flex;
55
width: 100%;
66
flex-direction: row;
77
justify-content: space-between;
88

9+
@include ltemd {
10+
flex-direction: column;
11+
gap: 16px;
12+
}
13+
914
.footer-right {
1015
display: flex;
1116
gap: 16px;

src/routes/Products/components/StyleOptionsModal/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ import DislikeIcon from "../../../../assets/images/thumbsdown.svg";
1010
import PageDivider from "../../../../components/PageDivider"
1111
import "./styles.module.scss";
1212
import Modal from "components/Modal"
13+
import useCheckMobileScreen from "../../../../hooks/useCheckMobileScreen";
1314

1415
const StylesOptionsModal = ({ onDismiss, style, likes = [], dislikes = [], onLike, onDislike }) => {
16+
const isMobile = useCheckMobileScreen();
17+
const modalWidth = isMobile ? { fullWidth: true } : { halfWidth: true };
1518
return (
1619
<Modal
1720
show={true}
18-
halfWidth
21+
{...modalWidth}
1922
handleClose={onDismiss}
2023
>
2124
<div styleName="styleWrapper">

src/routes/Products/components/StyleOptionsModal/styles.module.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "styles/include";
2+
@import '../../../../../src-ts/lib/styles';
23

34
.styleWrapper {
45
min-width:500px;
@@ -22,8 +23,10 @@
2223
.preview {
2324
width: 100%;
2425
height: 450px;
25-
@include mobile {
26-
height: 200px;
26+
max-height: calc(100vh - 450px);
27+
28+
@include ltemd {
29+
max-height: calc(100vh - 550px);
2730
}
2831
}
2932

0 commit comments

Comments
 (0)