Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 847cb15

Browse files
authored
Merge pull request #515 from infinitycoders05/feature/interview-update
fix: additional fixes
2 parents f9120c2 + e003fe3 commit 847cb15

File tree

6 files changed

+42
-25
lines changed

6 files changed

+42
-25
lines changed

src/components/BaseModal/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const modalStyle = {
2222
maxWidth: "640px",
2323
width: "100%",
2424
margin: 0,
25-
"overflow-x": "hidden",
25+
overflowX: "hidden",
2626
};
2727

2828
const containerStyle = {

src/components/TimezoneSelector/index.jsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
import React from "react";
1+
import React, { useEffect, useState } from "react";
22
import PT from "prop-types";
33
import { TIME_ZONES } from "constants";
44
import moment from "moment";
55
import "./styles.module.scss";
66

77
const TimezoneSelector = ({ value, onChange }) => {
8+
const browserTimezone = moment.tz.guess(true);
9+
const [timezoneList, setTimezoneList] = useState([]);
10+
11+
useEffect(() => {
12+
const isBrowserTimezoneAvailable = TIME_ZONES.findIndex(item => item === browserTimezone);
13+
14+
if (isBrowserTimezoneAvailable === -1) {
15+
const finalList = [...TIME_ZONES, browserTimezone].sort();
16+
setTimezoneList(finalList);
17+
onChange(browserTimezone);
18+
} else {
19+
setTimezoneList(TIME_ZONES);
20+
}
21+
}, [browserTimezone]);
22+
823
return (
924
<div styleName="timezone-selector">
1025
<div styleName="label">Interview Timezone</div>
11-
<select styleName="select" onChange={onChange}>
12-
{TIME_ZONES.map((zone) => (
26+
<select styleName="select" onChange={onChange} value={value} defaultValue={value}>
27+
{timezoneList.map((zone) => (
1328
<option
29+
key={zone}
1430
value={zone}
15-
selected={zone === value}
1631
>{`${zone} - UTC${moment().tz(zone).format("Z")}`}</option>
1732
))}
1833
</select>

src/routes/CreateNewTeam/components/BaseCreateModal/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const modalStyle = {
1111
padding: "72px 0 60px 0",
1212
width: "100%",
1313
margin: 0,
14-
"overflow-x": "hidden",
14+
overflowX: "hidden",
1515
};
1616

1717
const containerStyle = {

src/routes/PositionDetails/components/InterviewPopup/ManageAvailability/index.jsx

+16-15
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ const ManageAvailability = ({ scheduleDetails, onContinue }) => {
124124
};
125125

126126
// Set time zone
127-
const onChangeTimezone = (value) => {
128-
setTimezone(value);
127+
const onChangeTimezone = (event) => {
128+
if (event && event.target) {
129+
setTimezone(event.target.value);
130+
}
129131
};
130132

131133
/**
@@ -182,10 +184,11 @@ const ManageAvailability = ({ scheduleDetails, onContinue }) => {
182184
];
183185

184186
return (
185-
<div styleName="slot">
187+
<div styleName="slot" key={slotIndex}>
186188
<div styleName="days">
187189
{days.map((day, index) => (
188190
<div
191+
key={day}
189192
onClick={() => onDayChanged(daysMapped[index], slotIndex)}
190193
styleName={cn("day", {
191194
"selected-day": slot.days.indexOf(daysMapped[index]) > -1,
@@ -264,18 +267,16 @@ const ManageAvailability = ({ scheduleDetails, onContinue }) => {
264267
};
265268

266269
ManageAvailability.propTypes = {
267-
scheduleDetails: PT.arrayOf(
268-
PT.shape({
269-
timezone: PT.string,
270-
slots: PT.arrayOf(
271-
PT.shape({
272-
days: PT.array,
273-
end: PT.string,
274-
start: PT.string,
275-
})
276-
),
277-
})
278-
),
270+
scheduleDetails: PT.shape({
271+
timezone: PT.string,
272+
slots: PT.arrayOf(
273+
PT.shape({
274+
days: PT.array,
275+
end: PT.string,
276+
start: PT.string,
277+
})
278+
),
279+
}),
279280
onContinue: PT.func,
280281
};
281282

src/routes/PositionDetails/components/InterviewPopup/index.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
22
import { useSelector } from "react-redux";
33
import cn from "classnames";
44
import PT from "prop-types";
5+
import moment from "moment";
56
import Spinner from "components/CenteredSpinner";
67
import { toastr } from "react-redux-toastr";
78

@@ -273,7 +274,7 @@ const InterviewPopup = ({
273274
"show-spinner": isLoading,
274275
})}
275276
>
276-
<Spinner stype="Oval" width="80" height="80" />
277+
<Spinner stype="Oval" width={80} height={80} />
277278
</div>
278279
<div
279280
styleName={cn("component-wrapper", {
@@ -289,7 +290,7 @@ const InterviewPopup = ({
289290
};
290291

291292
InterviewPopup.propTypes = {
292-
candidate: PT.object.isRequired,
293+
candidate: PT.object,
293294
open: PT.bool,
294295
initialStage: PT.string,
295296
onClose: PT.func.isRequired,

src/routes/PositionDetails/components/StepsIndicator/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const StepsIndicator = ({ steps, currentStep }) => {
3535
const isCompleted = index <= currentStepIndex;
3636

3737
return (
38-
<>
38+
<div key={step.id}>
3939
<div styleName="outer-dot" style={styles} />
4040
<div
4141
styleName={cn("dot", { "dot-completed": isCompleted })}
@@ -47,7 +47,7 @@ const StepsIndicator = ({ steps, currentStep }) => {
4747
>
4848
{step.label}
4949
</div>
50-
</>
50+
</div>
5151
);
5252
})}
5353
</div>

0 commit comments

Comments
 (0)