Skip to content

Commit

Permalink
feat!: Deprecate the Modal component (#956)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The Modal component has been removed. The USWDS Modal will be added when reaching parity with USWDS 2.11.x
  • Loading branch information
brandonlenz committed May 12, 2021
1 parent c063047 commit 7ae4e30
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 708 deletions.
2 changes: 1 addition & 1 deletion docs/adding_new_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ There is a significant difference between thinking about the component props in
### Common Components in `react-uswds`

- Components that apply uswds styles to a standard HTMLElement - `Button`, `Table`
- Components that encapsulate user interaction flows - `Accordion`, `Modal`
- Components that encapsulate user interaction flows - `Accordion`
- Components for a common gov tech use case - `Search`, `SocialLinks`
- Components that render children - `Card`, `Header`, `Footer`
- Components related to forms, especially form inputs - `DateInput`, `TextInput` `Checkbox`, `Label`
3 changes: 0 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"formik": "^2.2.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"yup": "^0.32.9"
},
"scripts": {
Expand Down Expand Up @@ -43,7 +41,6 @@
"@types/node": "^14.14.31",
"@types/react": "^17.0.4",
"@types/react-dom": "^17.0.3",
"@types/react-redux": "^7.1.16",
"@types/react-router-dom": "^5.1.7",
"@types/yup": "^0.29.11",
"customize-cra": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import App from './App';
// TODO Add additional app testing
test('renders the app without error', () => {
const { getByText } = render(<App />)
expect(getByText('Modals')).toBeInTheDocument()
expect(getByText('Examples')).toBeInTheDocument()
})
9 changes: 1 addition & 8 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {

import HomePage from './pages/Home'
import ExamplePage from './pages/Example'
import ModalsPage from './pages/Modals'
import FormsPage from './pages/Forms'
import IconsPage from './pages/Icons'
import { Routes } from './routes'
Expand All @@ -29,7 +28,7 @@ import './App.css'

const App = () => {
const [mobileNavOpen, setMobileNavOpen] = useState(false)
const { HOME_PAGE, EXAMPLES_PAGE, MODALS_PAGE, FORMS_PAGE, ICONS_PAGE } = Routes
const { HOME_PAGE, EXAMPLES_PAGE, FORMS_PAGE, ICONS_PAGE } = Routes

const toggleMobileNav = (): void => {
setMobileNavOpen((prevOpen) => !prevOpen)
Expand All @@ -42,9 +41,6 @@ const App = () => {
<NavLink to={EXAMPLES_PAGE} activeClassName="usa-current">
Examples
</NavLink>,
<NavLink to={MODALS_PAGE} activeClassName="usa-current">
Modals
</NavLink>,
<NavLink to={ICONS_PAGE} activeClassName="usa-current">
Icons
</NavLink>,
Expand Down Expand Up @@ -81,9 +77,6 @@ const App = () => {
<Route path={EXAMPLES_PAGE}>
<ExamplePage />
</Route>
<Route path={MODALS_PAGE}>
<ModalsPage />
</Route>
<Route path={ICONS_PAGE}>
<IconsPage />
</Route>
Expand Down
10 changes: 1 addition & 9 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import * as serviceWorker from './serviceWorker'
import { createStore } from 'redux'
import { Provider } from 'react-redux'

import { rootReducer } from './redux/reducers'

const store = createStore(rootReducer)

ReactDOM.render(
<Provider store={store}>
<React.StrictMode>
<App />
</React.StrictMode>
</Provider>,
</React.StrictMode>,
document.getElementById('root')
)

Expand Down
4 changes: 2 additions & 2 deletions example/src/pages/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const ExamplePage = (): React.ReactElement => (
</li>
<li>
<USWDSLink
to="/modals"
to="/icons"
asCustom={Link}
variant="external"
target="_blank">
Modals
Icons
</USWDSLink>
</li>
</ul>
Expand Down
98 changes: 0 additions & 98 deletions example/src/pages/Modals.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions example/src/redux/actions.test.ts

This file was deleted.

16 changes: 0 additions & 16 deletions example/src/redux/actions.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions example/src/redux/reducer.test.ts

This file was deleted.

36 changes: 0 additions & 36 deletions example/src/redux/reducers.ts

This file was deleted.

24 changes: 0 additions & 24 deletions example/src/redux/types.ts

This file was deleted.

1 change: 0 additions & 1 deletion example/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const Routes = {
HOME_PAGE: '/',
EXAMPLES_PAGE: '/examples',
FORMS_PAGE: '/forms',
MODALS_PAGE: '/modals',
ICONS_PAGE: '/icons',
}

Expand Down
Loading

0 comments on commit 7ae4e30

Please sign in to comment.