Skip to content

Commit d1a87d2

Browse files
committed
refactor: update to v4
1 parent 2f793d1 commit d1a87d2

File tree

17 files changed

+440
-876
lines changed

17 files changed

+440
-876
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "react-app",
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error"
6+
}
7+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: "all",
4+
singleQuote: true,
5+
printWidth: 100,
6+
tabWidth: 2
7+
};

migration.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,57 @@
1111
- `float-left` to `float-start`
1212
- `float-right` to `float-end`
1313

14-
## Badges
14+
## Components
1515

16-
- variant="pill" --> shape="rounded-pill"
17-
- variant="square" --> shape="rounded-0"
16+
- Deprecated component `CEmbed`
17+
- Deprecated component `CJumbotron`
1818

19-
## Forms
19+
### Badges
20+
21+
- variant="pill" => shape="rounded-pill"
22+
- variant="square" => shape="rounded-0"
23+
24+
### Forms
2025

2126
- `CInput` => `CFormControl`
27+
- `CInputCheckbox` => `CFormCheck`
2228
- `CLabel` => `CFormLabel`
2329
- `CSelect` => `CFormSelect`
30+
- `CValidFeedback` => `CFormFeedback valid`
31+
- `CInvalidFeedback` => `CFormFeedback invalid`
2432

2533
- Deprecated component `CFormGroup`
2634
- Deprecated component `CInputGroupAppend`
2735
- Deprecated component `CInputGroupPrepend`
36+
- Depreacted component `CSwitch`, use `CFormCheck switch` instead of.
37+
- Deprecated `.help-block`
2838

29-
## Header
39+
### Header
3040

3141
- Deprecated pro `withSubheader`
3242
- Deprecated component `CHeaderNavItem`, use `CNavItem` instead of.
3343
- Deprecated component `CHeaderNavLink`, use `CNavLink` instead of.
3444

35-
## List Group
45+
### List Group
3646

3747
- Depracated prop `action` Use `component="a"` or `component="b"` instead of `action`.
3848

39-
## Modal
49+
### Modal
4050

4151
- Depracated prop `show` Use `visible` instead of.
4252

43-
## Popover
53+
### Popover
4454

4555
- Depracated prop `header` Use `title` instead of.
4656

47-
## Progress Bar
57+
### Progress Bar
4858

4959
- Depracated prop `precision`
5060
- Depracated prop `showLabel`
5161
- Depracated prop `showPercentage`
5262
- Depracated prop `showValue`
5363

54-
## Tabs
64+
### Tabs
5565

5666
- Deprecated component `<CTabs>` use `<CNav variant="tabs">` without wrapper component `<CTabs>`
5767

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"@coreui/react": "^3.4.0",
3131
"@coreui/react-chartjs": "^1.0.1",
3232
"@coreui/utils": "^1.3.1",
33+
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.2",
3334
"classnames": "^2.2.6",
3435
"core-js": "^3.8.1",
3536
"enzyme": "^3.11.0",
36-
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.2",
3737
"node-sass": "^4.14.1",
3838
"prop-types": "^15.7.2",
3939
"react": "^17.0.1",
@@ -45,6 +45,9 @@
4545
},
4646
"devDependencies": {
4747
"auto-changelog": "~2.2.1",
48+
"eslint-plugin-prettier": "^3.3.1",
49+
"gatsby-plugin-sitemap": "^3.2.0",
50+
"prettier": "2.2.1",
4851
"react-scripts": "^4.0.1"
4952
},
5053
"scripts": {

public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<!--
3-
* CoreUI Free - React.js Admin Template
4-
* @version v3.2.0
3+
* CoreUI - Free React.js Admin Template
4+
* @version v4.0.0-alpha.0
55
* @link https://coreui.io/pro/react/
6-
* Copyright (c) 2020 creativeLabs Łukasz Holeczek
6+
* Copyright (c) 2021 creativeLabs Łukasz Holeczek
77
* License MIT
88
-->
99
<html lang="en">

src/components/AppHeader.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,25 @@ const AppHeader = () => {
2525
const dispatch = useDispatch()
2626
const sidebarShow = useSelector((state) => state.sidebarShow)
2727

28-
const toggleSidebar = () => {
29-
const val = [true, 'responsive'].includes(sidebarShow) ? false : 'responsive'
30-
dispatch({ type: 'set', sidebarShow: val })
31-
}
28+
// const toggleSidebar = () => {
29+
// const val = [true, 'responsive'].includes(sidebarShow) ? false : 'responsive'
30+
// dispatch({ type: 'set', sidebarShow: val })
31+
// }
3232

33-
const toggleSidebarMobile = () => {
34-
const val = [false, 'responsive'].includes(sidebarShow) ? true : 'responsive'
35-
dispatch({ type: 'set', sidebarShow: val })
36-
}
33+
// const toggleSidebarMobile = () => {
34+
// const val = [false, 'responsive'].includes(sidebarShow) ? true : 'responsive'
35+
// dispatch({ type: 'set', sidebarShow: val })
36+
// }
3737

3838
return (
3939
<CHeader position="sticky" className="mb-4">
4040
<CContainer fluid>
41-
<CHeaderToggler inHeader className="ms-md-3 d-lg-none" onClick={toggleSidebarMobile} />
42-
<CHeaderToggler inHeader className="ms-3 d-md-down-none" onClick={toggleSidebar} />
41+
<CHeaderToggler
42+
className="ms-md-3 d-lg-none"
43+
onClick={() => dispatch({ type: 'set', sidebarShow: !sidebarShow })}
44+
>
45+
<CIcon name="cil-menu" />
46+
</CHeaderToggler>
4347
<CHeaderBrand className="mx-auto d-lg-none" to="/">
4448
<CIcon name="logo" height="48" alt="Logo" />
4549
</CHeaderBrand>

src/components/AppSidebar.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ import navigation from '../containers/_nav'
1717
const AppSidebar = () => {
1818
const dispatch = useDispatch()
1919
const unfoldable = useSelector((state) => state.sidebarUnfoldable)
20-
// const visible = useSelector(state => state.sidebarUnfoldable)
20+
const sidebarShow = useSelector((state) => state.sidebarShow)
2121

2222
return (
2323
<CSidebar
2424
position="fixed"
2525
selfHiding="md"
2626
unfoldable={unfoldable}
27-
// show={show}
27+
show={sidebarShow}
28+
onShow={() => console.log('show')}
29+
onHide={() => {
30+
console.log('hide')
31+
dispatch({ type: 'set', sidebarShow: false })
32+
}}
2833
// onShowChange={(val) => dispatch({type: 'set', sidebarShow: val })}
2934
>
3035
<CSidebarBrand className="d-md-down-none" to="/">

src/containers/_nav.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ const _nav = [
147147
anchor: 'Buttons',
148148
to: '/buttons/buttons',
149149
},
150-
{
151-
_component: 'CNavItem',
152-
as: NavLink,
153-
anchor: 'Brand buttons',
154-
to: '/buttons/brand-buttons',
155-
},
156150
{
157151
_component: 'CNavItem',
158152
as: NavLink,

src/routes.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const ProgressBar = React.lazy(() => import('./views/base/progress-bar/ProgressB
1919

2020
const Tabs = React.lazy(() => import('./views/base/tabs/Tabs'))
2121
const Tooltips = React.lazy(() => import('./views/base/tooltips/Tooltips'))
22-
const BrandButtons = React.lazy(() => import('./views/buttons/brand-buttons/BrandButtons'))
2322
const ButtonDropdowns = React.lazy(() => import('./views/buttons/button-dropdowns/ButtonDropdowns'))
2423
const ButtonGroups = React.lazy(() => import('./views/buttons/button-groups/ButtonGroups'))
2524
const Buttons = React.lazy(() => import('./views/buttons/buttons/Buttons'))
@@ -64,7 +63,6 @@ const routes = [
6463
{ path: '/buttons/buttons', name: 'Buttons', component: Buttons },
6564
{ path: '/buttons/button-dropdowns', name: 'Dropdowns', component: ButtonDropdowns },
6665
{ path: '/buttons/button-groups', name: 'Button Groups', component: ButtonGroups },
67-
{ path: '/buttons/brand-buttons', name: 'Brand Buttons', component: BrandButtons },
6866
{ path: '/charts', name: 'Charts', component: Charts },
6967
{ path: '/icons', exact: true, name: 'Icons', component: CoreUIIcons },
7068
{ path: '/icons/coreui-icons', name: 'CoreUI Icons', component: CoreUIIcons },

0 commit comments

Comments
 (0)