Skip to content

Commit df56a4b

Browse files
committed
Dynamic Terms and Conditions
1 parent e7f62c6 commit df56a4b

3 files changed

Lines changed: 81 additions & 54 deletions

File tree

src/components/JAF/SeasonDetails.tsx

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FormikErrors, FormikValues, FormikHandlers } from "formik";
22
import { Form, Row, Col, Select, Checkbox, Typography, Card, Divider, Alert, Space } from "antd";
33
import { useEffect, useState } from "react";
4-
import { TermsAndConditions } from "@/dummyData/TermsAndConditions";
4+
import { FullTime, Intern } from "./TermsAndConditions";
55
import axios from "axios";
66
import { API_ENDPOINTS } from "../../utils/jaf.constants";
77
import { SeasonsDto } from "../../types/jaf.types";
@@ -163,49 +163,66 @@ const SeasonDetails = ({
163163
border: '1px solid #e5e7eb'
164164
}}
165165
>
166-
<div style={{
167-
marginBottom: 20,
168-
padding: 12,
169-
backgroundColor: '#f9fafb',
170-
borderRadius: 6,
171-
border: '1px solid #e5e7eb'
172-
}}>
173-
<Space direction="vertical" size="small" style={{ width: '100%' }}>
174-
{TermsAndConditions.map((tc, index) => (
175-
<div
176-
key={index}
177-
style={{
178-
display: 'flex',
179-
gap: 10,
180-
alignItems: 'flex-start',
181-
padding: '4px 0'
182-
}}
183-
>
184-
<Text
185-
strong
186-
style={{
187-
color: '#374151',
188-
minWidth: 20,
189-
fontSize: 13,
190-
fontWeight: 600
191-
}}
192-
>
193-
{index + 1}.
194-
</Text>
195-
<Text
166+
{selectedSeasonInfo ? (
167+
<div style={{
168+
marginBottom: 20,
169+
padding: 12,
170+
backgroundColor: '#f9fafb',
171+
borderRadius: 6,
172+
border: '1px solid #e5e7eb'
173+
}}>
174+
175+
<Space direction="vertical" size="small" style={{ width: '100%' }}>
176+
{(selectedSeasonInfo.type.toLowerCase() === 'intern' ? Intern : FullTime).map((tc, index) => (
177+
<div
178+
key={index}
196179
style={{
197-
textAlign: 'justify',
198-
lineHeight: 1.4,
199-
fontSize: 13,
200-
color: '#374151'
180+
display: 'flex',
181+
gap: 10,
182+
alignItems: 'flex-start',
183+
padding: '4px 0'
201184
}}
202185
>
203-
{tc}
204-
</Text>
205-
</div>
206-
))}
207-
</Space>
208-
</div>
186+
<Text
187+
strong
188+
style={{
189+
color: '#374151',
190+
minWidth: 20,
191+
fontSize: 13,
192+
fontWeight: 600
193+
}}
194+
>
195+
{index + 1}.
196+
</Text>
197+
<Text
198+
style={{
199+
textAlign: 'justify',
200+
lineHeight: 1.4,
201+
fontSize: 13,
202+
color: '#374151',
203+
whiteSpace: 'pre-line'
204+
}}
205+
>
206+
{tc}
207+
</Text>
208+
</div>
209+
))}
210+
</Space>
211+
</div>
212+
) : (
213+
<div style={{
214+
marginBottom: 20,
215+
padding: 24,
216+
textAlign: 'center',
217+
backgroundColor: '#f9fafb',
218+
borderRadius: 6,
219+
border: '1px solid #e5e7eb'
220+
}}>
221+
<Text style={{ color: '#6b7280', fontSize: 14 }}>
222+
Please select a recruitment season to view the terms and conditions
223+
</Text>
224+
</div>
225+
)}
209226

210227
<Divider style={{ margin: '12px 0' }} />
211228

src/components/JAF/TermsAndConditions.js

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

src/dummyData/TermsAndConditions.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)