-
Notifications
You must be signed in to change notification settings - Fork 1
modify language button display location #4
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
b4eb62b
5e89ece
6f59c09
7de043b
83da9b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,31 @@ | |
border-color: transparent; | ||
} | ||
|
||
.test-language-button { | ||
position: relative; | ||
float: right!important; | ||
margin-top: 8px; | ||
margin-right: 15px; | ||
margin-bottom: 5px; | ||
background-color: transparent; | ||
background-image: none; | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
} | ||
@media (min-width: 768px) { | ||
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. Where is 768px from? Most mobile device has width of 480px or lower. Also hardcoding pixel is not responsive design. 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. Get this value from chrome inspect 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. Let's not hard code. I can think of two ways: 1) detect the device type 2) use the DOM object to get its current dev width. |
||
.test-language-button { | ||
display: none; | ||
} | ||
} | ||
|
||
.test-language-button-in-collapse { | ||
} | ||
@media (max-width: 768px) { | ||
.test-language-button-in-collapse { | ||
display: none; | ||
} | ||
} | ||
|
||
.language-button { | ||
color: #000000; | ||
background-color: transparent; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ export default class YepsNavBar extends React.Component<Props, State> { | |
render() { | ||
let logo = require('../images/logo.png'); | ||
let collapsedMenu = this.state.isExpanded ? 'collapsed-menu' : ''; | ||
let languageButton = this.state.isExpanded ? 'collapsed-menu' : ''; | ||
|
||
return ( | ||
<div className={'navbar-default'}> | ||
|
@@ -31,10 +30,12 @@ export default class YepsNavBar extends React.Component<Props, State> { | |
<img className={'logo-wrapper'} src={logo} alt="logo"/> | ||
</Navbar.Brand> | ||
<Navbar.Toggle onClick={this.expandCollapse}/> | ||
<Button className={'language-button, test-language-button'} type="submit">Language</Button> | ||
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. You may be able to achieve ideal button positioning by using Narbar.Form with pullLeft, just like below. Also, latter on we will need to unilaterally deal with the form submit with some state transition, in maybe redux store. Let me know if there's any difficulty wrapping button around in the Navbar.Form |
||
</Navbar.Header> | ||
|
||
<Navbar.Collapse> | ||
<Nav pullRight className={collapsedMenu}> | ||
<Navbar.Form pullLeft className={languageButton}> | ||
<Navbar.Form pullLeft className={'test-language-button-in-collapse'} > | ||
<Button className={'language-button'} type="submit">Language</Button> | ||
</Navbar.Form> | ||
<NavItem eventKey={1} href="#"> | ||
|
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.
Let's not hard code pixels on margin either. Maybe at least use percentage. Ideally, I think there may be some out-of-the-box solution from react-bootstrap.