Skip to content

modify language button display location - #4

Open
Nini0415 wants to merge 5 commits into
masterfrom
language-button-ui
Open

modify language button display location#4
Nini0415 wants to merge 5 commits into
masterfrom
language-button-ui

Conversation

@Nini0415

Copy link
Copy Markdown
Collaborator

Add 2 button to display at different screen width condition

Comment thread src/components/YepsNavBar.css Outdated
border: 1px solid transparent;
border-radius: 4px;
}
@media (min-width: 768px) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get this value from chrome inspect

@jsy1218-zz jsy1218-zz Oct 29, 2018

Copy link
Copy Markdown
Owner

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. I can think of two ways: 1) detect the device type 2) use the DOM object to get its current dev width.

Comment thread src/components/YepsNavBar.css Outdated
.test-language-button {
position: relative;
float: right!important;
margin-top: 8px;

Copy link
Copy Markdown
Owner

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.

Comment thread src/components/YepsNavBar.tsx Outdated
<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>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The 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

@jsy1218-zz jsy1218-zz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Mainly thinking of responsive design, since the design principle in this website is mobile first - we expect around ~90% of traffic from mobile.

Also, think about how to handle button click as a form post.

Good job anyway!

WangNini and others added 4 commits October 28, 2018 21:07
… collapse-expand context instead of checking the device source, for better accuracy. If the expand is undefined, then the nav items must not be collapsed, a golden source of truth

@jsy1218-zz jsy1218-zz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check in first.

@jsy1218-zz jsy1218-zz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work. Let's not merge this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants