Skip to content

feat/components/buttons: added primary, text and link buttons#20

Open
Pawel-dev5 wants to merge 3 commits intomasterfrom
feat/buttons
Open

feat/components/buttons: added primary, text and link buttons#20
Pawel-dev5 wants to merge 3 commits intomasterfrom
feat/buttons

Conversation

@Pawel-dev5
Copy link
Collaborator

@Pawel-dev5 Pawel-dev5 commented Mar 10, 2021

feat/components/buttons: added primary, text and link buttons

rel="icon"
href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/271/nerd-face_1f913.png"
/>
<link href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
Copy link
Contributor

Choose a reason for hiding this comment

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

Fonts are really heavy in size. Could you import only the weights we're using?

@@ -0,0 +1,5 @@
import React from 'react';

export default function Logo() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change all

export default function MyFunction() { ... }

to

export const MyFunction = () => { ... }

From my experience named exports work much better than default ones. VSCode can import them as autosuggestions as you type.

Change from functions to anonymous functions (arrow functions) is also a big yes. Why? You're not using this and for the most part, you shouldn't use this - it leads to confusion. It's a rule of thumb: if you're not using this in your functions, use anonymous function (arrow function)

import React from 'react';

export default function Logo() {
return <h3><span style={{ color: '#F53314' }}>Trip</span><img alt="Atomic layout" src="./Vector.png" /><span style={{ color: '#9C1B07' }} >Planner</span></h3>;
Copy link
Contributor

Choose a reason for hiding this comment

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

alt should have relevant description of the image. Change it to TripPlanner, it's more accurate than Atomic Layout

Copy link
Contributor

Choose a reason for hiding this comment

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

And looking from more holistic perspective: please use logo from Figma. Just export the whole logo, import it here and make sure it's scaled as in the designs.

Here's the guide to exports in Figma: https://help.figma.com/hc/en-us/articles/360040028114-Guide-to-exports-in-Figma#h_41b394ed-f969-4840-9e6e-c7c2790d5bc5

Comment on lines 12 to 13
left: calc(50% - 105px/2);
top: calc(50% - 34px/2 + 54px);
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you've probably copied every style from Figma. Copying every style from Figma doesn't work. Why?

Figma is just a showcase for our design system. Components have to be composable and reusable. If you specify, width, left and top, they will not look properly when using texts of different lengths, etc.

Please make sure that components are reusable, not tied up to specific use case.

Comment on lines 12 to 13
left: calc(50% - 105px/2);
top: calc(50% - 34px/2 + 54px);
Copy link
Contributor

Choose a reason for hiding this comment

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

as above

cursor: pointer;
left: calc(50% - 105px/2);
top: calc(50% - 34px/2 + 54px);
font-family: Work Sans, sans-serif;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can extract this style to global one, to not repeat yourself (keeping code DRY).

See src/GlobalStyle.ts

Comment on lines 23 to 54
const Nav = styled.ul`
width: 50%;
display: flex;
list-style-type: none;
justify-content: flex-end;
font-family: Work Sans, sans-serif;
font-style: normal;
font-weight: 500;
font-size: 13px;
line-height: 15px;
color: #919191;
& > li {
padding-right: 1rem;
}
`;

const NavBar = styled.div`
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
& > h3 {
padding-left: 1rem;
font-family: Work Sans, sans-serif;
font-style: normal;
font-weight: 600;
font-size: 17.4703px;
line-height: 20px;
letter-spacing: -0.03em;
}
`;

Copy link
Contributor

Choose a reason for hiding this comment

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

These components are not part of typography. Could you extract them to separate directories under src/components?

Also please do not style styled-components sass-style. If you have to refer to other component, please make yourself familiar with this: https://styled-components.com/docs/advanced#referring-to-other-components

@ochmanski
Copy link
Contributor

Do you have prettier and eslint installed in VSCode? Please make sure you do, it'll be so much easier for writing cleaner-looking code

Prettier: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
Eslint: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

@marcinbar7
Copy link
Collaborator

@Pawel-dev5 any progress here?

@Pawel-dev5
Copy link
Collaborator Author

Pawel-dev5 commented May 5, 2021

@marcinbar7 I made all corrections with Kacper's suggestion, waiting for approval

<script type="module" src="/src/index.tsx"></script>
</body>

</html> No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Please run prettier on this file

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

Comments