-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: upgrade to Create React App 4 #1276
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// @flow strict | ||
import React, { type Node } from 'react'; | ||
import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom'; | ||
import App from './components/App.js'; | ||
import CardPage from './components/CardPage.js'; | ||
import routes from './components/routes.js'; | ||
import sidebarIndex from './components/sidebarIndex.js'; | ||
|
||
import './docs.css'; | ||
import 'gestalt/dist/gestalt.css'; | ||
import 'gestalt-datepicker/dist/gestalt-datepicker.css'; | ||
|
||
const mapRoutes = (pages) => | ||
pages.map((page, i) => ( | ||
<Route | ||
path={`/${page}`} | ||
key={i} | ||
render={() => <CardPage cards={routes[page]} page={page} />} | ||
/> | ||
)); | ||
|
||
function AppWrapper(): Node { | ||
return ( | ||
<BrowserRouter> | ||
<App> | ||
<Switch> | ||
<Route exact path="/" render={() => <Redirect to="/What's New" />} /> | ||
{sidebarIndex.map((section) => mapRoutes(section.pages))} | ||
</Switch> | ||
</App> | ||
</BrowserRouter> | ||
); | ||
} | ||
|
||
export default AppWrapper; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,8 +55,8 @@ describe('Button', () => { | |
render(<Button text="test" disabled ref={ref} />); | ||
expect(ref.current instanceof HTMLButtonElement).toEqual(true); | ||
expect( | ||
ref.current instanceof HTMLButtonElement && ref.current?.tabIndex | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AlbertCarreras could you verify that this is correct? When I looked at a disabled
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
).toEqual(-1); | ||
ref.current instanceof HTMLButtonElement && ref.current?.disabled | ||
).toEqual(true); | ||
}); | ||
|
||
it('renders a disabled link button', () => { | ||
|
@@ -75,9 +75,6 @@ describe('Button', () => { | |
expect( | ||
ref.current instanceof HTMLAnchorElement && ref.current?.href | ||
).toEqual(''); | ||
expect( | ||
ref.current instanceof HTMLAnchorElement && ref.current?.tabIndex | ||
).toEqual(-1); | ||
}); | ||
|
||
it('renders a button removed from sequential keyboard navigation via tabIndex', () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayeshakmaz @AlbertCarreras fyi had to move this wrapper outside of
index.js
since otherwise fast refresh does not detect incremental changes to the docs