-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/home
# Conflicts: # src/App.tsx # src/hooks/usePlaylist.ts # src/providers/QueryProvider.tsx # src/screens/Home/Home.module.scss # src/screens/Home/Home.tsx
- Loading branch information
Showing
54 changed files
with
1,578 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
const { | ||
transform, | ||
...rest | ||
} = require('@snowpack/app-scripts-react/jest.config.js')(); | ||
|
||
module.exports = { | ||
...require('@snowpack/app-scripts-react/jest.config.js')(), | ||
transform: { | ||
'.+\\.(css|styl|less|sass|scss)$': 'jest-css-modules-transform', | ||
...transform, | ||
}, | ||
...rest, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
module.exports = { | ||
ci: { | ||
collect: { | ||
url : [ | ||
'http://127.0.0.1:4000' | ||
], | ||
startServerCommand : 'http-server ./build -p 4000 -g', | ||
url: ['http://127.0.0.1:4000'], | ||
startServerCommand: 'http-server ./build -p 4000 -g', | ||
startServerReadyPattern: 'Available on', | ||
numberOfRuns : 1 | ||
numberOfRuns: 1, | ||
}, | ||
upload : { | ||
'target': 'temporary-public-storage' | ||
upload: { | ||
target: 'temporary-public-storage', | ||
}, | ||
assert : { | ||
'preset': 'lighthouse:recommended', | ||
} | ||
} | ||
assert: { | ||
preset: 'lighthouse:no-pwa', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
@use '../../styles/variables'; | ||
@use '../../styles/theme'; | ||
|
||
.basis { | ||
// component styling | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import Base from './Base'; | ||
|
||
describe('Base Component tests', () => { | ||
test('dummy test', () => { | ||
render(<Base></Base>); | ||
expect(screen.getByText('hello world')).toBeInTheDocument(); | ||
describe('<Base>', () => { | ||
test('renders and matches snapshot', () => { | ||
const { container } = render(<Base />); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
import React from 'react'; | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
import QueryProvider from './providers/QueryProvider'; | ||
import Root from './components/Root/Root'; | ||
import ConfigProvider from './providers/configProvider'; | ||
import Home from './screens/Home/Home'; | ||
|
||
import QueryProvider from './providers/QueryProvider'; | ||
import './styles/main.scss'; | ||
|
||
function App() { | ||
return ( | ||
<ConfigProvider | ||
configLocation={window.configLocation} | ||
onLoading={(isLoading: boolean) => | ||
console.info(`Loading config: ${isLoading}`) | ||
} | ||
onValidationError={(error: Error) => console.error(`Config ${error}`)} | ||
> | ||
interface State { | ||
error: Error | null; | ||
} | ||
|
||
class App extends Component { | ||
public state: State = { | ||
error: null, | ||
}; | ||
|
||
componentDidCatch(error: Error) { | ||
this.setState({ error }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<QueryProvider> | ||
<div className="App"> | ||
<Home /> | ||
</div> | ||
<ConfigProvider | ||
configLocation={window.configLocation} | ||
onLoading={(isLoading: boolean) => | ||
console.info(`Loading config: ${isLoading}`) | ||
} | ||
onValidationError={(error: Error) => console.error(`Config ${error}`)} | ||
> | ||
<Router> | ||
<Root error={this.state.error} /> | ||
</Router> | ||
</ConfigProvider> | ||
</QueryProvider> | ||
</ConfigProvider> | ||
); | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@use '../../styles/variables'; | ||
@use '../../styles/theme'; | ||
@use '../../styles/mixins/responsive'; | ||
@use '../../styles/mixins/utils'; | ||
|
||
// | ||
// Navigation Button | ||
// -------------------------------- | ||
|
||
.link { | ||
position: relative; | ||
display: inline-flex; | ||
justify-content: inherit; | ||
align-items: center; | ||
min-height: 38px; | ||
padding: 0 10px; | ||
color: inherit; | ||
font-family: theme.$body-alt-font-family; | ||
font-weight: 700; | ||
text-align: center; | ||
text-decoration: none; | ||
background: transparent; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
opacity: 0.7; | ||
transition: background 0.1s ease, transform 0.1s ease; | ||
|
||
@media (hover: hover) and (pointer: fine) { | ||
&:hover, | ||
&:active { | ||
z-index: 1; | ||
background: rgba(variables.$black, 0.7); | ||
transform: scale(1.1); | ||
opacity: 1; | ||
} | ||
} | ||
} | ||
|
||
.active { | ||
color: variables.$white; | ||
opacity: 1; | ||
} | ||
|
||
// | ||
// mediaQueries | ||
// -------------------------------- | ||
|
||
@include responsive.mobile-and-tablet() { | ||
.link { | ||
padding: 12px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
|
||
import { render } from '../../testUtils'; | ||
|
||
import ButtonLink from './ButtonLink'; | ||
|
||
describe('<ButtonLink />', () => { | ||
test('renders link with route label', () => { | ||
const { getByText } = render(<ButtonLink label="home" to="/" />); | ||
expect(getByText(/home/i)).toBeTruthy(); | ||
}); | ||
|
||
it('renders and matches snapshot', () => { | ||
const { container } = render(<ButtonLink label="home" to="/" />); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { NavLink } from 'react-router-dom'; | ||
|
||
import styles from './ButtonLink.module.scss'; | ||
|
||
type Props = { | ||
label: string; | ||
to: string; | ||
}; | ||
|
||
const ButtonLink: React.FC<Props> = ({ label, to }) => { | ||
return ( | ||
<NavLink | ||
className={styles.link} | ||
activeClassName={styles.active} | ||
to={to} | ||
exact | ||
> | ||
<span className={styles.buttonLabel}>{label}</span> | ||
</NavLink> | ||
); | ||
}; | ||
|
||
export default ButtonLink; |
15 changes: 15 additions & 0 deletions
15
src/components/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ButtonLink /> renders and matches snapshot 1`] = ` | ||
<div> | ||
<a | ||
aria-current="page" | ||
class="link active" | ||
href="/" | ||
> | ||
<span> | ||
home | ||
</span> | ||
</a> | ||
</div> | ||
`; |
Oops, something went wrong.