Skip to content
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

fix: responsive navbar on small devices #1547

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class App extends Component {
<div className='sans-serif h-100' onClick={getNavHelper(this.props.doUpdateUrl)}>
{/* Tinted overlay that appears when dragging and dropping an item */}
{ canDrop && isOver && <div className='w-100 h-100 top-0 left-0 absolute' style={{ background: 'rgba(99, 202, 210, 0.2)' }} /> }
<div className='flex flex-row-reverse-l flex-column-reverse' style={{ minHeight: '100vh' }}>
<div className='flex flex-row-reverse-l flex-column-reverse justify-end justify-start-l' style={{ minHeight: '100vh' }}>
<div className='flex-auto-l'>
<div className='flex items-center ph3 ph4-l' style={{ WebkitAppRegion: 'drag', height: 75, background: '#F0F6FA', paddingTop: '20px', paddingBottom: '15px' }}>
<div className='joyride-app-explore' style={{ width: 560 }}>
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/navigation.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* global webuiUrl, waitForTitle, page, describe, it, expect, beforeAll */

const scrollLinkContainer = async () => {
const linkContainer = '[role="menubar"]'
await page.waitForSelector(linkContainer)
await page.evaluate(selector => {
const scrollableSection = document.querySelector(selector)

scrollableSection.scrollLeft = scrollableSection.offsetWidth
}, linkContainer)
}

describe('Navigation menu', () => {
beforeAll(async () => {
await page.goto(webuiUrl + '#/blank', { waitUntil: 'networkidle0' })
Expand All @@ -25,6 +35,7 @@ describe('Navigation menu', () => {
const link = 'a[href="#/explore"]'
await page.waitForSelector(link)
await expect(page).toMatch('Explore')
await scrollLinkContainer()
await page.click(link)
await waitForTitle('Explore - IPLD')
})
Expand All @@ -33,6 +44,7 @@ describe('Navigation menu', () => {
const link = 'a[href="#/peers"]'
await page.waitForSelector(link)
await expect(page).toMatch('Peers')
await scrollLinkContainer()
await page.click(link)
await waitForTitle('Peers - IPFS')
})
Expand All @@ -41,6 +53,7 @@ describe('Navigation menu', () => {
const link = 'a[href="#/settings"]'
await page.waitForSelector(link)
await expect(page).toMatch('Settings')
await scrollLinkContainer()
await page.click(link)
await waitForTitle('Settings - IPFS')
})
Expand Down