refactor: rename App to Bootstrap

This commit is contained in:
Jeremy Kahn 2022-08-09 09:35:49 -05:00
parent 5daf919bd0
commit c46242f282
6 changed files with 41 additions and 38 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editors
Session.vim

View File

@ -1,27 +0,0 @@
import React from 'react'
import logo from './logo.svg'
import './App.sass'
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
)
}
export default App

View File

@ -1,15 +1,15 @@
.App
.Bootstrap
text-align: center
.App-logo
.Bootstrap-logo
height: 40vmin
pointer-events: none
@media (prefers-reduced-motion: no-preference)
.App-logo
animation: App-logo-spin infinite 20s linear
.Bootstrap-logo
animation: Bootstrap-logo-spin infinite 20s linear
.App-header
.Bootstrap-header
background-color: #282c34
min-height: 100vh
display: flex
@ -19,10 +19,10 @@
font-size: calc(10px + 2vmin)
color: white
.App-link
.Bootstrap-link
color: #61dafb
@keyframes App-logo-spin
@keyframes Bootstrap-logo-spin
from
transform: rotate(0deg)
to

View File

@ -1,10 +1,10 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import App from './App'
import Bootstrap from './Bootstrap'
test('renders learn react link', () => {
render(<App />)
render(<Bootstrap />)
const linkElement = screen.getByText(/learn react/i)
expect(linkElement).toBeInTheDocument()
})

27
src/Bootstrap.tsx Normal file
View File

@ -0,0 +1,27 @@
import React from 'react'
import logo from './logo.svg'
import './Bootstrap.sass'
function Bootstrap() {
return (
<div className="Bootstrap">
<header className="Bootstrap-header">
<img src={logo} className="Bootstrap-logo" alt="logo" />
<p>
Edit <code>src/Bootstrap.tsx</code> and save to reload.
</p>
<a
className="Bootstrap-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
)
}
export default Bootstrap

View File

@ -4,14 +4,14 @@ import { HashRouter as Router } from 'react-router-dom'
import * as serviceWorkerRegistration from './serviceWorkerRegistration'
import './index.sass'
import App from './App'
import Bootstrap from './Bootstrap'
import reportWebVitals from './reportWebVitals'
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
<React.StrictMode>
<Router>
<App />
<Bootstrap />
</Router>
</React.StrictMode>
)