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

Commit 1070a09

Browse files
committed
🎨 format code
1 parent aaded56 commit 1070a09

File tree

26 files changed

+242
-47
lines changed

26 files changed

+242
-47
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = {
6565
endOfLine: 'lf',
6666
semi: true,
6767
singleQuote: true,
68-
printWidth: 162,
68+
printWidth: 142,
6969
tabWidth: 2,
7070
},
7171
],

src/components/base/atoms/Icon/icon.tsx

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,21 @@ const CloseIcon: VFC = () => (
2626

2727
const ClipBoardPlus: VFC = () => (
2828
<>
29-
<path fillRule="evenodd" d="M8 7a.5.5 0 0 1 .5.5V9H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V10H6a.5.5 0 0 1 0-1h1.5V7.5A.5.5 0 0 1 8 7z" />
29+
<path
30+
fillRule="evenodd"
31+
d="M8 7a.5.5 0 0 1 .5.5V9H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V10H6a.5.5 0 0 1 0-1h1.5V7.5A.5.5 0 0 1 8 7z"
32+
/>
3033
<path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
3134
<path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
3235
</>
3336
);
3437

3538
const PlusBoardIcon: VFC = () => (
3639
<>
37-
<path fillRule="evenodd" d="M8 7a.5.5 0 0 1 .5.5V9H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V10H6a.5.5 0 0 1 0-1h1.5V7.5A.5.5 0 0 1 8 7z" />
40+
<path
41+
fillRule="evenodd"
42+
d="M8 7a.5.5 0 0 1 .5.5V9H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V10H6a.5.5 0 0 1 0-1h1.5V7.5A.5.5 0 0 1 8 7z"
43+
/>
3844
<path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
3945
<path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
4046
</>
@@ -143,29 +149,51 @@ const ArrowDownIcon: VFC = () => (
143149
/>
144150
);
145151

146-
const CaretRight: VFC = () => <path d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />;
152+
const CaretRight: VFC = () => (
153+
<path d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />
154+
);
147155

148-
const CaretDown: VFC = () => <path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z" />;
156+
const CaretDown: VFC = () => (
157+
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z" />
158+
);
149159

150160
const ChevronDoubleLeft: VFC = () => (
151161
<>
152-
<path fillRule="evenodd" d="M8.354 1.646a.5.5 0 0 1 0 .708L2.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
153-
<path fillRule="evenodd" d="M12.354 1.646a.5.5 0 0 1 0 .708L6.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
162+
<path
163+
fillRule="evenodd"
164+
d="M8.354 1.646a.5.5 0 0 1 0 .708L2.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"
165+
/>
166+
<path
167+
fillRule="evenodd"
168+
d="M12.354 1.646a.5.5 0 0 1 0 .708L6.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"
169+
/>
154170
</>
155171
);
156172

157173
const ChevronLeft: VFC = () => (
158-
<path fillRule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
174+
<path
175+
fillRule="evenodd"
176+
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"
177+
/>
159178
);
160179

161180
const ChevronDoubleRight: VFC = () => (
162181
<>
163-
<path fillRule="evenodd" d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708z" />
164-
<path fillRule="evenodd" d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708z" />
182+
<path
183+
fillRule="evenodd"
184+
d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708z"
185+
/>
186+
<path
187+
fillRule="evenodd"
188+
d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708z"
189+
/>
165190
</>
166191
);
167192
const ChevronRight: VFC = () => (
168-
<path fillRule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
193+
<path
194+
fillRule="evenodd"
195+
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
196+
/>
169197
);
170198

171199
const Google: VFC = () => (

src/components/base/molecules/IconButton/IconButton.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ type Props = {
1515
} & ComponentProps<typeof Icon>;
1616

1717
export const IconButton: VFC<Props> = (props) => {
18-
const { width, height, isActive, disabled, isRemovePadding = false, icon, text, color, activeColor, buttonColor, buttonSize, onClickButton } = props;
18+
const {
19+
width,
20+
height,
21+
isActive,
22+
disabled,
23+
isRemovePadding = false,
24+
icon,
25+
text,
26+
color,
27+
activeColor,
28+
buttonColor,
29+
buttonSize,
30+
onClickButton,
31+
} = props;
1932
const textColor = isActive ? activeColor : color;
2033

2134
const handleClickButton = (e: MouseEvent<HTMLButtonElement>) => {

src/components/common/Parts/PaginationWrapper/PaginationWrapper.spec.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import renderer from 'react-test-renderer';
22
import { PaginationWrapper } from './index';
33

44
test('PaginationWrapper', () => {
5-
const tree = renderer.create(<PaginationWrapper totalItemsCount={100} pagingLimit={20} activePage={3} mutateActivePage={expect.any(Function)} />).toJSON();
5+
const tree = renderer
6+
.create(<PaginationWrapper totalItemsCount={100} pagingLimit={20} activePage={3} mutateActivePage={expect.any(Function)} />)
7+
.toJSON();
68

79
expect(tree).toMatchSnapshot();
810
});

src/components/common/Parts/TopSubnavBar/TopSubnavBar.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,35 @@ export const TopSubnavBar: VFC<Props> = ({
5454
{speech.isEnabled && page.body && (
5555
<>
5656
{isReading ? (
57-
<IconButton icon="PAUSE_CIRCLE" color="WHITE" activeColor="SUCCESS" width={24} height={24} isRemovePadding onClickButton={onClickPauseButton} />
57+
<IconButton
58+
icon="PAUSE_CIRCLE"
59+
color="WHITE"
60+
activeColor="SUCCESS"
61+
width={24}
62+
height={24}
63+
isRemovePadding
64+
onClickButton={onClickPauseButton}
65+
/>
5866
) : (
59-
<IconButton icon="PLAY_CIRCLE" color="WHITE" activeColor="SUCCESS" width={24} height={24} isRemovePadding onClickButton={onClickPlayButton} />
67+
<IconButton
68+
icon="PLAY_CIRCLE"
69+
color="WHITE"
70+
activeColor="SUCCESS"
71+
width={24}
72+
height={24}
73+
isRemovePadding
74+
onClickButton={onClickPlayButton}
75+
/>
6076
)}
61-
<IconButton icon="STOP_CIRCLE" color="WHITE" activeColor="SUCCESS" width={24} height={24} isRemovePadding onClickButton={onClickStopButton} />
77+
<IconButton
78+
icon="STOP_CIRCLE"
79+
color="WHITE"
80+
activeColor="SUCCESS"
81+
width={24}
82+
height={24}
83+
isRemovePadding
84+
onClickButton={onClickStopButton}
85+
/>
6286
</>
6387
)}
6488
</div>

src/components/common/SortButtonGroup.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ export const SortButtonGroup: VFC = () => {
1010

1111
return (
1212
<div className="btn-group btn-group-sm" role="group">
13-
<button className={`btn btn-outline-primary text-white text-nowrap ${!isSortCreatedAt ? 'active' : ''}`} onClick={() => mutateIsSortCreatedAt(false)}>
13+
<button
14+
className={`btn btn-outline-primary text-white text-nowrap ${!isSortCreatedAt ? 'active' : ''}`}
15+
onClick={() => mutateIsSortCreatedAt(false)}
16+
>
1417
{t.latest_order}
1518
</button>
16-
<button className={`btn btn-outline-primary text-white text-nowrap ${isSortCreatedAt ? 'active' : ''}`} onClick={() => mutateIsSortCreatedAt(true)}>
19+
<button
20+
className={`btn btn-outline-primary text-white text-nowrap ${isSortCreatedAt ? 'active' : ''}`}
21+
onClick={() => mutateIsSortCreatedAt(true)}
22+
>
1723
{t.oldest_order}
1824
</button>
1925
</div>

src/components/domain/Directory/molecules/DirectoryCreateModal/DirectoryCreateModal.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ export const DirectoryCreateModal: VFC = () => {
4141

4242
return (
4343
<Modal isOpen={parentDirectoryForCreateDirectory != null} toggle={closeDeleteModal} title={t.create_directory}>
44-
{parentDirectoryForCreateDirectory != null && <p className="text-center">{t.create_child_directory(parentDirectoryForCreateDirectory.name)}</p>}
44+
{parentDirectoryForCreateDirectory != null && (
45+
<p className="text-center">{t.create_child_directory(parentDirectoryForCreateDirectory.name)}</p>
46+
)}
4547
<form className="input-group my-2" onSubmit={handleSubmitCreateDirectory}>
46-
<input type="text" value={name} onChange={(e) => setName(e.target.value)} className="form-control bg-white" placeholder="...name" autoFocus />
48+
<input
49+
type="text"
50+
value={name}
51+
onChange={(e) => setName(e.target.value)}
52+
className="form-control bg-white"
53+
placeholder="...name"
54+
autoFocus
55+
/>
4756
<button className="btn btn-success" type="submit">
4857
{t.create}
4958
</button>

src/components/domain/Directory/molecules/DirectoryRenameModal/DirectoryRenameModal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ export const DirectoryRenameModal: VFC = () => {
5050
return (
5151
<Modal isOpen={directoryForRename != null} toggle={closeDeleteModal} title={t.rename_directory}>
5252
<form className="input-group my-2" onSubmit={handleSubmit}>
53-
<input type="text" value={name} onChange={(e) => setName(e.target.value)} className="form-control bg-white" placeholder="...name" autoFocus />
53+
<input
54+
type="text"
55+
value={name}
56+
onChange={(e) => setName(e.target.value)}
57+
className="form-control bg-white"
58+
placeholder="...name"
59+
autoFocus
60+
/>
5461
<button className="btn btn-success" type="submit" disabled={name.trim() === '' || name === directoryForRename?.name}>
5562
{t.save}
5663
</button>

src/components/domain/Directory/molecules/DirectorySidebarList/SidebarDirectoryList.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import { Directory } from '~/domains/Directory';
1919
export const SidebarDirectoryList: VFC = () => {
2020
const { t } = useLocale();
2121

22-
const { data: directoryPaginationResult, mutate: mutateDirectoryPaginationResult } = useDirectoryPaginationResult({ searchKeyWord: '', isRoot: true });
22+
const { data: directoryPaginationResult, mutate: mutateDirectoryPaginationResult } = useDirectoryPaginationResult({
23+
searchKeyWord: '',
24+
isRoot: true,
25+
});
2326
const { createDirectory } = useCreateDirectory();
2427

2528
const [isCreatingNewDirectory, setIsCreatingNewDirectory] = useState(false);
@@ -146,7 +149,14 @@ export const SidebarDirectoryList: VFC = () => {
146149
<StyledDiv className="text-center mx-3 mt-2">
147150
{isCreatingNewDirectory ? (
148151
<form className="input-group ps-3" onSubmit={onSubmit}>
149-
<input type="text" value={name} onChange={(e) => setName(e.target.value)} className="form-control bg-white" placeholder="...name" autoFocus />
152+
<input
153+
type="text"
154+
value={name}
155+
onChange={(e) => setName(e.target.value)}
156+
className="form-control bg-white"
157+
placeholder="...name"
158+
autoFocus
159+
/>
150160
</form>
151161
) : (
152162
<IconButton icon="PLUS_DOTTED" color="LIGHT" activeColor="LIGHT" onClickButton={() => setIsCreatingNewDirectory(true)} />

src/components/domain/Directory/molecules/DirectorySidebarListItem/DirectorySidebarListItem.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const DirectorySidebarListItem: VFC<Props> = ({ directory, index }) => {
3636
const [isOpen, setIsOpen] = useState(false);
3737
const [isFetchDirectory, setIsFetchDirectory] = useState(false);
3838

39-
const { data: childrenDirectoryTrees, mutate: mutateChildrenDirectoriesForDisplay } = useDirectoryChildren(isFetchDirectory ? directory._id : undefined);
39+
const { data: childrenDirectoryTrees, mutate: mutateChildrenDirectoriesForDisplay } = useDirectoryChildren(
40+
isFetchDirectory ? directory._id : undefined,
41+
);
4042

4143
const [isHoverDirectoryItem, setIsHoverDirectoryItem] = useState(false);
4244
const [isCreatingNewDirectory, setIsCreatingNewDirectory] = useState(false);
@@ -144,7 +146,14 @@ export const DirectorySidebarListItem: VFC<Props> = ({ directory, index }) => {
144146
<div className="ps-3 pt-1">
145147
{isCreatingNewDirectory && (
146148
<form className="input-group my-2 ps-3" onSubmit={handleSubmitCreateDirectory}>
147-
<input type="text" value={name} onChange={(e) => setName(e.target.value)} className="form-control bg-white" placeholder="...name" autoFocus />
149+
<input
150+
type="text"
151+
value={name}
152+
onChange={(e) => setName(e.target.value)}
153+
className="form-control bg-white"
154+
placeholder="...name"
155+
autoFocus
156+
/>
148157
</form>
149158
)}
150159
{childrenDirectoryTrees ? (

0 commit comments

Comments
 (0)