Skip to content

Commit b629326

Browse files
committed
chore: Format
1 parent e3d9e09 commit b629326

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

packages/components/src/entry-input-layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,14 @@ interface EntryInputLayoutProps extends HTMLAttributes<HTMLElement>, EntryContai
191191
clickHandler: React.Dispatch<React.SetStateAction<boolean>>
192192
}
193193

194-
export const EntryInputLayout: React.FC<EntryInputLayoutProps> = ({ text, time, actions, term, clickHandler, ...rest }) => {
194+
export const EntryInputLayout: React.FC<EntryInputLayoutProps> = ({
195+
text,
196+
time,
197+
actions,
198+
term,
199+
clickHandler,
200+
...rest
201+
}) => {
195202
console.log(term)
196203
return (
197204
<>
Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
21
interface highlighterProps {
32
term: string
43
children: string
54
}
65

7-
const Highlighter: React.FC<highlighterProps> = ({term, children}) => {
6+
const Highlighter: React.FC<highlighterProps> = ({ term, children }) => {
87
if (!term) {
9-
return (
10-
<>{children}</>
11-
)
8+
return <>{children}</>
129
}
13-
const regex = new RegExp(`(${term})`, 'gi');
14-
const parts = children.split(regex);
10+
const regex = new RegExp(`(${term})`, 'gi')
11+
const parts = children.split(regex)
1512
console.log(parts)
1613

17-
return(
14+
return (
1815
<>
19-
<div>test</div>
20-
{parts.map((part: string, index: number)=>
16+
<div>test</div>
17+
{parts.map((part: string, index: number) =>
2118
regex.test(part) ? (
22-
<span key={index} style={{margin: 0, backgroundColor: "rgb(84 198 247)", padding: 0, whiteSpace: "pre-wrap", wordBreak: "break-word", fontWeight: "bold"}}>
19+
<span
20+
key={index}
21+
style={{
22+
margin: 0,
23+
backgroundColor: 'rgb(84 198 247)',
24+
padding: 0,
25+
whiteSpace: 'pre-wrap',
26+
wordBreak: 'break-word',
27+
fontWeight: 'bold',
28+
}}
29+
>
2330
{part}
2431
</span>
25-
) : (part)
32+
) : (
33+
part
34+
)
2635
)}
2736
</>
2837
)
2938
}
3039

31-
export default Highlighter
40+
export default Highlighter

packages/frontend/src/components/entries-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const EntriesInput: React.FC<EntriesInputProps> = ({
109109
.sort((a, b) => a.orderId - b.orderId)
110110
.map((entry) => (
111111
<EntryInput
112-
term={term}
112+
term={term}
113113
handleStatusChange={handleStatusChange}
114114
key={entry.id}
115115
disabled={disabled}

packages/frontend/src/pages/archive-page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const ArchivePage: React.FunctionComponent = () => {
216216
let weekEnd: number | undefined = undefined
217217
let searchText: string | undefined = undefined
218218

219-
setTerm(value)
219+
setTerm(value)
220220

221221
const yearMatch = yearMonthRegex.exec(value)
222222
if (yearMonthRegex.test(value) && yearMatch) {
@@ -349,8 +349,8 @@ const ArchivePage: React.FunctionComponent = () => {
349349

350350
const link =
351351
data?.currentUser?.__typename === UserTypeEnum.Trainer
352-
? `/report/${traineeId}/${year}/${week}/${term ? term: ""}`
353-
: `/report/${year}/${week}/${term ? term: ""}`
352+
? `/report/${traineeId}/${year}/${week}/${term ? term : ''}`
353+
: `/report/${year}/${week}/${term ? term : ''}`
354354

355355
return (
356356
<StyledArchiveTableRow key={report.id}>

packages/frontend/src/pages/report-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const ReportPage: React.FunctionComponent = () => {
282282
{report?.days.map((day) => (
283283
<StyledTopBorderWrapper key={day.id}>
284284
<DayInput
285-
term={term ? term : ""}
285+
term={term ? term : ''}
286286
day={day}
287287
disabled={reportArchived || reportReview || day.status === DayStatusEnum.Holiday}
288288
reportStatus={report.status}

0 commit comments

Comments
 (0)