Skip to content

Commit 41c68ef

Browse files
committed
style(custom status field): restyling code with prettier
1 parent 0eb2af2 commit 41c68ef

File tree

1 file changed

+55
-54
lines changed

1 file changed

+55
-54
lines changed

src/pages/Bugs/Drawer/CustomStatusField.tsx

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ export const CustomStatusField = ({
4545

4646
const selectedWithNaB = currentIsNaBugExcluded
4747
? [
48-
...selected,
49-
{
50-
id: customStatusNotABugInfo.actionIdentifier,
51-
name: customStatusNotABugInfo.drawerTitle,
52-
},
53-
]
48+
...selected,
49+
{
50+
id: customStatusNotABugInfo.actionIdentifier,
51+
name: customStatusNotABugInfo.drawerTitle,
52+
},
53+
]
5454
: [...selected];
5555

5656
const shallDisable = (item: BugCustomStatus): boolean => {
@@ -87,20 +87,21 @@ export const CustomStatusField = ({
8787
>
8888
{selectedWithNaB && selectedWithNaB.length
8989
? `${selectedWithNaB
90-
.slice(0, maxItemsToShow)
91-
.map((item) =>
92-
item.id === customStatusNotABugInfo.actionIdentifier
93-
? customStatusNotABugInfo.drawerTitle
94-
: getCustomStatusInfo(item?.name as BugState, t).text
95-
)
96-
.join(', ')
97-
.toLowerCase()} ${selectedWithNaB.length > maxItemsToShow
98-
? `+${selectedWithNaB.length - maxItemsToShow}`
99-
: ''
100-
}`
90+
.slice(0, maxItemsToShow)
91+
.map((item) =>
92+
item.id === customStatusNotABugInfo.actionIdentifier
93+
? customStatusNotABugInfo.drawerTitle
94+
: getCustomStatusInfo(item?.name as BugState, t).text
95+
)
96+
.join(', ')
97+
.toLowerCase()} ${
98+
selectedWithNaB.length > maxItemsToShow
99+
? `+${selectedWithNaB.length - maxItemsToShow}`
100+
: ''
101+
}`
101102
: t(
102-
'__BUGS_PAGE_FILTER_DRAWER_BODY_FILTER_CUSTOM_STATUS_ALL_LABEL'
103-
)}
103+
'__BUGS_PAGE_FILTER_DRAWER_BODY_FILTER_CUSTOM_STATUS_ALL_LABEL'
104+
)}
104105
</SM>
105106
</Accordion.Label>
106107
</Accordion.Header>
@@ -134,43 +135,43 @@ export const CustomStatusField = ({
134135
</Field>
135136
{available.length
136137
? available
137-
.slice(0, showMore ? undefined : maxItemsToShow)
138-
.map((item) => (
139-
<Field style={{ marginBottom: globalTheme.space.xs }}>
140-
<Checkbox
141-
value={item.name}
142-
name="filter-custom-status"
143-
disabled={shallDisable(item)}
144-
checked={selected.map((i) => i.id).includes(item.id)}
145-
onChange={() => {
146-
dispatch(
147-
updateFilters({
148-
filters: {
149-
customStatuses: [
150-
...(selected
151-
.map((i) => i.id)
152-
.includes(item.id)
153-
? selected.filter((i) => i.id !== item.id)
154-
: [...selected, item]),
155-
],
156-
},
157-
})
158-
);
159-
}}
160-
>
161-
<LabelSpaceBetween
162-
isRegular
163-
style={{
164-
color: globalTheme.palette.grey[700],
165-
...(shallDisable(item) && disabledStyle),
138+
.slice(0, showMore ? undefined : maxItemsToShow)
139+
.map((item) => (
140+
<Field style={{ marginBottom: globalTheme.space.xs }}>
141+
<Checkbox
142+
value={item.name}
143+
name="filter-custom-status"
144+
disabled={shallDisable(item)}
145+
checked={selected.map((i) => i.id).includes(item.id)}
146+
onChange={() => {
147+
dispatch(
148+
updateFilters({
149+
filters: {
150+
customStatuses: [
151+
...(selected
152+
.map((i) => i.id)
153+
.includes(item.id)
154+
? selected.filter((i) => i.id !== item.id)
155+
: [...selected, item]),
156+
],
157+
},
158+
})
159+
);
166160
}}
167161
>
168-
{getCustomStatusInfo(item?.name as BugState, t).text}
169-
<MD>{counters[item.id] || 0}</MD>
170-
</LabelSpaceBetween>
171-
</Checkbox>
172-
</Field>
173-
))
162+
<LabelSpaceBetween
163+
isRegular
164+
style={{
165+
color: globalTheme.palette.grey[700],
166+
...(shallDisable(item) && disabledStyle),
167+
}}
168+
>
169+
{getCustomStatusInfo(item?.name as BugState, t).text}
170+
<MD>{counters[item.id] || 0}</MD>
171+
</LabelSpaceBetween>
172+
</Checkbox>
173+
</Field>
174+
))
174175
: null}
175176

176177
{available.length > maxItemsToShow ? (

0 commit comments

Comments
 (0)