Skip to content

Commit ccd094b

Browse files
authored
fix(repo): use className instead of class for react
2 parents 6afd299 + 0a493f8 commit ccd094b

File tree

128 files changed

+688
-1937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+688
-1937
lines changed

packages/webapp/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"react-router": "5.3.4",
107107
"react-router-breadcrumbs-hoc": "^3.2.10",
108108
"react-router-dom": "^5.3.3",
109+
"react-router-dom-v5-compat": "6",
109110
"react-scripts": "5.0.1",
110111
"react-scroll-sync": "^0.7.1",
111112
"react-scrollbars-custom": "^4.0.21",

packages/webapp/src/components/Dashboard/BigcapitalLoading.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
// @ts-nocheck
2-
import React from 'react';
3-
import classNames from 'classnames';
41
import { Icon } from '@/components';
2+
import classNames from 'classnames';
3+
import React from 'react';
54

65
import '@/style/components/BigcapitalLoading.scss';
76

87
/**
98
* Bigcapital logo loading.
109
*/
11-
export default function BigcapitalLoading({ className }) {
10+
export default function BigcapitalLoading({ className }: { className: string }) {
1211
return (
1312
<div className={classNames('bigcapital-loading', className)}>
14-
<div class="center">
13+
<div className="center">
1514
<Icon icon="bigcapital" height={37} width={228} />
1615
</div>
1716
</div>

packages/webapp/src/components/Dashboard/DashboardBackLink.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ function DashboardBackLink({ dashboardBackLink, breadcrumbs }) {
1313
const crumb = breadcrumbs[breadcrumbs.length - 2];
1414

1515
const handleClick = (event) => {
16-
const url =
17-
typeof dashboardBackLink === 'string'
18-
? dashboardBackLink
19-
: crumb.match.url;
16+
const url = typeof dashboardBackLink === 'string' ? dashboardBackLink : crumb.match.url;
2017
history.push(url);
2118
event.preventDefault();
2219
};
2320

2421
return (
2522
<If condition={dashboardBackLink && crumb}>
26-
<div class="dashboard__back-link">
23+
<div className="dashboard__back-link">
2724
<a href="#no-link" onClick={handleClick}>
2825
<Icon icon={'arrow-left'} iconSize={18} /> <T id={'back_to_list'} />
2926
</a>

packages/webapp/src/components/Dashboard/DashboardErrorBoundary.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ import { FormattedMessage as T, Icon } from '@/components';
44

55
export default function DashboardErrorBoundary({}) {
66
return (
7-
<div class="dashboard__error-boundary">
8-
<h1><T id={'sorry_about_that_something_went_wrong'} /></h1>
9-
<p><T id={'if_the_problem_stuck_please_contact_us_as_soon_as_possible'} /></p>
7+
<div className="dashboard__error-boundary">
8+
<h1>
9+
<T id={'sorry_about_that_something_went_wrong'} />
10+
</h1>
11+
<p>
12+
<T id={'if_the_problem_stuck_please_contact_us_as_soon_as_possible'} />
13+
</p>
1014
<Icon icon="bigcapital" height={30} width={160} />
1115
</div>
12-
)
13-
}
16+
);
17+
}

packages/webapp/src/components/Dashboard/DashboardFooter.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { For } from '@/components';
55

66
function FooterLinkItem({ title, link }) {
77
return (
8-
<div class="">
8+
<div className="">
99
<a href={link} target="_blank" rel="noopener noreferrer">
1010
{title}
1111
</a>
@@ -17,8 +17,8 @@ export default function DashboardFooter() {
1717
const footerLinks = getFooterLinks();
1818

1919
return (
20-
<div class="dashboard__footer">
21-
<div class="footer-links">
20+
<div className="dashboard__footer">
21+
<div className="footer-links">
2222
<For render={FooterLinkItem} of={footerLinks} />
2323
</div>
2424
</div>

packages/webapp/src/components/Dashboard/DashboardPage.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,13 @@ function DashboardPage({
7777
return () => {
7878
resetResourceTypeUniversalSearch();
7979
};
80-
}, [
81-
defaultSearchResource,
82-
resetResourceTypeUniversalSearch,
83-
setResourceTypeUniversalSearch,
84-
]);
80+
}, [defaultSearchResource, resetResourceTypeUniversalSearch, setResourceTypeUniversalSearch]);
8581

8682
return (
8783
<div className={CLASSES.DASHBOARD_PAGE}>
8884
<Suspense
8985
fallback={
90-
<div class="dashboard__fallback-loading">
86+
<div className="dashboard__fallback-loading">
9187
<Spinner size={40} value={null} />
9288
</div>
9389
}

packages/webapp/src/components/Dashboard/DashboardPageContent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import React from 'react';
55
* Dashboard page content.
66
*/
77
export function DashboardPageContent({ children }) {
8-
return <div class="dashboard__page-content">{children}</div>;
8+
return <div className="dashboard__page-content">{children}</div>;
99
}

packages/webapp/src/components/Dashboard/DashboardTopbar/DashboardTopbar.tsx

+14-36
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
// @ts-nocheck
22
import React from 'react';
33
import { useHistory } from 'react-router';
4-
import {
5-
Navbar,
6-
NavbarGroup,
7-
NavbarDivider,
8-
Button,
9-
Classes,
10-
Tooltip,
11-
Position,
12-
} from '@blueprintjs/core';
4+
import { Navbar, NavbarGroup, NavbarDivider, Button, Classes, Tooltip, Position } from '@blueprintjs/core';
135
import { FormattedMessage as T, Icon, Hint, If } from '@/components';
146

157
import DashboardTopbarUser from '@/components/Dashboard/TopbarUser';
@@ -53,28 +45,22 @@ function DashboardTopbar({
5345
};
5446

5547
return (
56-
<div class="dashboard__topbar" data-testId={'dashboard-topbar'}>
57-
<div class="dashboard__topbar-left">
58-
<div class="dashboard__topbar-sidebar-toggle">
48+
<div className="dashboard__topbar" data-testId={'dashboard-topbar'}>
49+
<div className="dashboard__topbar-left">
50+
<div className="dashboard__topbar-sidebar-toggle">
5951
<Tooltip
60-
content={
61-
!sidebarExpended ? (
62-
<T id={'open_sidebar'} />
63-
) : (
64-
<T id={'close_sidebar'} />
65-
)
66-
}
52+
content={!sidebarExpended ? <T id={'open_sidebar'} /> : <T id={'close_sidebar'} />}
6753
position={Position.RIGHT}
6854
>
6955
<DashboardHamburgerButton onClick={handleSidebarToggleBtn} />
7056
</Tooltip>
7157
</div>
7258

73-
<div class="dashboard__title">
59+
<div className="dashboard__title">
7460
<h1>{pageTitle}</h1>
7561

7662
<If condition={pageHint}>
77-
<div class="dashboard__hint">
63+
<div className="dashboard__hint">
7864
<Hint content={pageHint} />
7965
</div>
8066
</If>
@@ -88,28 +74,20 @@ function DashboardTopbar({
8874
</If>
8975
</div>
9076

91-
<div class="dashboard__breadcrumbs">
77+
<div className="dashboard__breadcrumbs">
9278
<DashboardBreadcrumbs />
9379
</div>
9480
<DashboardBackLink />
9581
</div>
9682

97-
<div class="dashboard__topbar-right">
98-
<Navbar class="dashboard__topbar-navbar">
83+
<div className="dashboard__topbar-right">
84+
<Navbar className="dashboard__topbar-navbar">
9985
<NavbarGroup>
100-
<DashboardQuickSearchButton
101-
onClick={() => openGlobalSearch(true)}
102-
/>
86+
<DashboardQuickSearchButton onClick={() => openGlobalSearch(true)} />
10387
<QuickNewDropdown />
10488

105-
<Tooltip
106-
content={<T id={'notifications'} />}
107-
position={Position.BOTTOM}
108-
>
109-
<Button
110-
className={Classes.MINIMAL}
111-
icon={<Icon icon={'notification-24'} iconSize={20} />}
112-
/>
89+
<Tooltip content={<T id={'notifications'} />} position={Position.BOTTOM}>
90+
<Button className={Classes.MINIMAL} icon={<Icon icon={'notification-24'} iconSize={20} />} />
11391
</Tooltip>
11492

11593
<Button
@@ -121,7 +99,7 @@ function DashboardTopbar({
12199
</NavbarGroup>
122100
</Navbar>
123101

124-
<div class="dashboard__topbar-user">
102+
<div className="dashboard__topbar-user">
125103
<DashboardTopbarUser />
126104
</div>
127105
</div>

packages/webapp/src/components/Dashboard/DashboardTopbar/_components.tsx

+3-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Icon, FormattedMessage as T } from '@/components';
66

77
export function DashboardTopbarSubscriptionMessage() {
88
return (
9-
<div class="dashboard__topbar-subscription-msg">
9+
<div className="dashboard__topbar-subscription-msg">
1010
<span>
1111
<T id={'dashboard.subscription_msg.period_over'} />
1212
</span>
@@ -17,14 +17,7 @@ export function DashboardTopbarSubscriptionMessage() {
1717
export function DashboardHamburgerButton({ ...props }) {
1818
return (
1919
<Button minimal={true} {...props}>
20-
<svg
21-
xmlns="http://www.w3.org/2000/svg"
22-
width="20"
23-
height="20"
24-
viewBox="0 0 20 20"
25-
role="img"
26-
focusable="false"
27-
>
20+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" role="img" focusable="false">
2821
<title>
2922
<T id={'menu'} />
3023
</title>
@@ -58,4 +51,4 @@ export function DashboardQuickSearchButton({ ...rest }) {
5851
{...rest}
5952
/>
6053
);
61-
}
54+
}

packages/webapp/src/components/Dashboard/DashboardViewsTabs.tsx

+4-12
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,12 @@ export function DashboardViewsTabs({
2828
const [currentView, setCurrentView] = useState(initialViewSlug || 0);
2929

3030
useEffect(() => {
31-
if (
32-
typeof currentViewSlug !== 'undefined' &&
33-
currentViewSlug !== currentView
34-
) {
31+
if (typeof currentViewSlug !== 'undefined' && currentViewSlug !== currentView) {
3532
setCurrentView(currentViewSlug || 0);
3633
}
3734
}, [currentView, setCurrentView, currentViewSlug]);
3835

39-
const throttledOnChange = useRef(
40-
debounce((viewId) => saveInvoke(OnThrottledChange, viewId), throttleTime),
41-
);
36+
const throttledOnChange = useRef(debounce((viewId) => saveInvoke(OnThrottledChange, viewId), throttleTime));
4237

4338
// Trigger `onChange` and `onThrottledChange` events.
4439
const triggerOnChange = (viewSlug) => {
@@ -60,7 +55,7 @@ export function DashboardViewsTabs({
6055
};
6156

6257
return (
63-
<div class="dashboard__views-tabs">
58+
<div className="dashboard__views-tabs">
6459
<Tabs
6560
id="navbar"
6661
large={true}
@@ -75,10 +70,7 @@ export function DashboardViewsTabs({
7570
<Tab id={tab.slug} title={tab.name} />
7671
))}
7772
<If condition={newViewTab}>
78-
<Tooltip
79-
content={<T id={'create_a_new_view'} />}
80-
position={Position.RIGHT}
81-
>
73+
<Tooltip content={<T id={'create_a_new_view'} />} position={Position.RIGHT}>
8274
<Button
8375
className="button--new-view"
8476
icon={<Icon icon="plus" />}

packages/webapp/src/components/Dashboard/TopbarUser.tsx

+7-24
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
// @ts-nocheck
22
import React from 'react';
33
import { useHistory } from 'react-router-dom';
4-
import {
5-
Menu,
6-
MenuItem,
7-
MenuDivider,
8-
Button,
9-
Popover,
10-
Position,
11-
} from '@blueprintjs/core';
4+
import { Menu, MenuItem, MenuDivider, Button, Popover, Position } from '@blueprintjs/core';
125
import { FormattedMessage as T } from '@/components';
136

147
import { useAuthActions } from '@/hooks/state';
@@ -48,37 +41,27 @@ function DashboardTopbarUser({
4841
className={'menu-item--profile'}
4942
text={
5043
<div>
51-
<div class="person">
44+
<div className="person">
5245
{user.first_name} {user.last_name}
5346
</div>
54-
<div class="org">
47+
<div className="org">
5548
<T id="organization_id" />: {user.tenant_id}
5649
</div>
5750
</div>
5851
}
5952
/>
6053
<MenuDivider />
61-
<MenuItem
62-
text={<T id={'keyboard_shortcuts'} />}
63-
onClick={onKeyboardShortcut}
64-
/>
65-
<MenuItem
66-
text={<T id={'preferences'} />}
67-
onClick={() => history.push('/preferences')}
68-
/>
54+
<MenuItem text={<T id={'keyboard_shortcuts'} />} onClick={onKeyboardShortcut} />
55+
<MenuItem text={<T id={'preferences'} />} onClick={() => history.push('/preferences')} />
6956
<MenuItem text={<T id={'logout'} />} onClick={onClickLogout} />
7057
</Menu>
7158
}
7259
position={Position.BOTTOM}
7360
>
7461
<Button>
75-
<div className="user-text">
76-
{firstLettersArgs(user.first_name, user.last_name)}
77-
</div>
62+
<div className="user-text">{firstLettersArgs(user.first_name, user.last_name)}</div>
7863
</Button>
7964
</Popover>
8065
);
8166
}
82-
export default compose(
83-
withDialogActions,
84-
)(DashboardTopbarUser);
67+
export default compose(withDialogActions)(DashboardTopbarUser);

packages/webapp/src/components/Datatable/Cells.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import React from 'react';
33

44
export function CellTextSpan({ cell: { value } }) {
5-
return (<span class="cell-text">{ value }</span>)
5+
return <span className="cell-text">{value}</span>;
66
}

0 commit comments

Comments
 (0)