This repository was archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 232
feat(top app bar): dense variant #520
Merged
moog16
merged 6 commits into
material-components:rc0.8.0
from
mgr34:feat/top-app-bar/dense-variant
Dec 14, 2018
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9e69a6a
feat(top-app-bar): adds a dense variant
mgr34 40647a2
update component names
mgr34 a01920a
grammatical correction
mgr34 dc69fe1
WIP: add golden for dense and dense prominent
911c09d
fix(top-app-bar): correct variant name onClick
mgr34 a26a65d
fix(top-app-bar): add missing unit test for prominentDense
mgr34 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 TopAppBar from '../../../packages/top-app-bar'; | ||
|
||
import MaterialIcon from '../../../packages/material-icon'; | ||
import MainTopAppBarContent from './mainContent'; | ||
|
||
const TopAppBarDenseScreenshotTest = () => { | ||
return ( | ||
<div className='top-app-bar-container'> | ||
<TopAppBar | ||
dense | ||
title='Miami, FL' | ||
navigationIcon={<MaterialIcon | ||
icon='menu' | ||
onClick={() => console.log('dense click')} | ||
/>} | ||
actionItems={[<MaterialIcon key='item' icon='bookmark' />]} | ||
/> | ||
<MainTopAppBarContent /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TopAppBarDenseScreenshotTest; |
This file contains hidden or 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,25 @@ | ||
import React from 'react'; | ||
import TopAppBar from '../../../packages/top-app-bar'; | ||
|
||
import MaterialIcon from '../../../packages/material-icon'; | ||
import MainTopAppBarContent from './mainContent'; | ||
|
||
const TopAppBarProminentDenseScreenshotTest = () => { | ||
return ( | ||
<div className='top-app-bar-container'> | ||
<TopAppBar | ||
prominent | ||
dense | ||
title='Miami, FL' | ||
navigationIcon={<MaterialIcon | ||
icon='menu' | ||
onClick={() => console.log('prominent dense click')} | ||
/>} | ||
actionItems={[<MaterialIcon key='item' icon='bookmark' />]} | ||
/> | ||
<MainTopAppBarContent /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TopAppBarProminentDenseScreenshotTest; |
This file contains hidden or 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,8 @@ | ||
export default [ | ||
'fixed', | ||
'dense', | ||
'prominent', | ||
'prominentDense', | ||
'short', | ||
'shortCollapsed', | ||
'standard', | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -63,6 +63,17 @@ test('has correct fixed class', () => { | |
assert.isTrue(wrapper.hasClass('mdc-top-app-bar--fixed')); | ||
}); | ||
|
||
test('has correct dense class', () => { | ||
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. can you also add one for dense prominent variant? |
||
const wrapper = shallow(<TopAppBar dense />); | ||
assert.isTrue(wrapper.hasClass('mdc-top-app-bar--dense')); | ||
}); | ||
|
||
test('has correct prominent dense class', () => { | ||
const wrapper = shallow(<TopAppBar prominent dense />); | ||
assert.isTrue(wrapper.hasClass('mdc-top-app-bar--dense')); | ||
assert.isTrue(wrapper.hasClass('mdc-top-app-bar--prominent')); | ||
}); | ||
|
||
test('navigationIcon is rendered with navigation icon class', () => { | ||
const wrapper = mount( | ||
<TopAppBar | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.