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

Add navbar #5

Merged
merged 6 commits into from Sep 1, 2020
Merged

Add navbar #5

merged 6 commits into from Sep 1, 2020

Conversation

RobertoValle31
Copy link
Contributor

Description

This PR will update the navbar design. I just gave some simple changes like adding the OpticPower logo, bottom border, and changed the theme selection to a Select.

NOTE: This is my first time using TypeScript, please correct me if I'm doing something wrong on the syntax. Please let me know what you think, I'm open to suggestions. Thanks in advance.

Demo

Screen Shot 2020-08-31 at 10 46 21 AM

Screen Shot 2020-08-31 at 10 46 41 AM

Screen Shot 2020-08-31 at 10 46 31 AM

@vercel
Copy link

vercel bot commented Aug 31, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/opticpower/tracker/5d2tua6m5
✅ Preview: https://tracker-git-add-navbar.opticpower.vercel.app

components/Nav.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@jansen0825 jansen0825 left a comment

Choose a reason for hiding this comment

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

Looks great to me! The styles implementation is breaking the Vercel deploy tho.
Screen Shot 2020-08-31 at 11 42 16 AM

@jansen0825
Copy link
Contributor

I think this is a great time for us to align on which styles implementing standard we are going to use.

@mattvv
Copy link

mattvv commented Aug 31, 2020

https://styled-components.com/ might be a good option

import { Row, Col, Spacer, Select } from '@geist-ui/react';
import { Sun, Moon } from '@geist-ui/react-icons';

const opticLogo = '/images/OpticPower.png';
Copy link

Choose a reason for hiding this comment

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

You may want to conditionally include a white logo depending on the useLight variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I wanted initially, but I dint found the white logo. So I added a white shadow. It will be great if you could pass me the white version of the logo.

Copy link

Choose a reason for hiding this comment

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

@RobertoValle31 did you check the File Cabinet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the folders have the logos but the Optic Power Logos folder is empty. Maybe I can use the codepwr ? Let me know what you think.
Screen Shot 2020-09-01 at 11 30 29 AM

Copy link

Choose a reason for hiding this comment

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

@RobertoValle31 thanks for bringing this up, there are some sharing issues there, i'll try and resolve but for now you should have access

components/Nav.tsx Outdated Show resolved Hide resolved
components/Nav.tsx Outdated Show resolved Hide resolved
Comment on lines +1 to +4
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }]]
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was having problems with the styled-components because every time I refreshed the page the component was losing all its CSS styles and I was having a warning on the browser console regarding the use of className although I was not using it. After research and testing different solutions this was the only one that worked vercel/next.js#4068 (comment) I had to create this file with this config.

Copy link
Contributor

@jansen0825 jansen0825 left a comment

Choose a reason for hiding this comment

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

Nice fix find! 💪🏼

components/Nav.tsx Outdated Show resolved Hide resolved
components/Nav.tsx Outdated Show resolved Hide resolved
Copy link

@mattvv mattvv left a comment

Choose a reason for hiding this comment

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

I'm waiting for the white logo to approve :)

@RobertoValle31
Copy link
Contributor Author

@mattvv
Screen Shot 2020-09-01 at 12 48 17 PM
Screen Shot 2020-09-01 at 12 48 31 PM

@RobertoValle31 RobertoValle31 merged commit ebd1430 into master Sep 1, 2020
@RobertoValle31 RobertoValle31 deleted the Add-navbar branch September 1, 2020 17:14
</Col>
<SelectContainer>
<Select placeholder={useLight ? 'Light Mode' : 'Dark Mode'}>
<Select.Option value="Dark Mode" onClick={(): void => setUseLight(false)}>

Choose a reason for hiding this comment

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

nit: why onClick on each option instead of onChange on the Select?

I had used something like:

<Select placeholder={useLight ? 'Light Mode' : 'Dark Mode'} onChange={(ev) => setLight(ev.target.value)}>
  <Select.Option value="false">
    <Moon size={16} /> <Spacer inline x={0.35} />
    Dark Mode
  </Select.Option>
  {/* ... */}
</Select>

Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, @lardissone I was trying your suggestion but I believe that you do that on MaterialUI, and works perfectly. If that is the case the prop value on MUI it can be any type. But on react-geist, the type of value can only be a string. The only way I was able to make this work was by doing the following:

<Select placeholder={useLight ? 'Light Mode' : 'Dark Mode'} onChange={value => setUseLight(value === 'true')}>
          <Select.Option value="false">
            <Moon size={16} /> <Spacer inline x={0.35} />
            Dark Mode
          </Select.Option>
          <Select.Option value="true">
            <Sun size={16} /> <Spacer inline x={0.35} />
            Light Mode
          </Select.Option>
 </Select>

Let me know what you think.

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.

None yet

4 participants