-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/fe web layout #10
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: dev
Are you sure you want to change the base?
Changes from all commits
af27057
9dabd6f
59fd27a
a68e66b
fef93fa
eca467c
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .account { | ||
| display: flex; | ||
| color: $gray-600; | ||
| font-size: $font-size-xs; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import styles from './Account.module.scss'; | ||
|
|
||
| export default function Account() { | ||
| return ( | ||
| <div className={styles.account}> | ||
| <p>Sign In</p> / <p>Sign Up</p> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| .button { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| background-color: $primary; | ||
| padding: 16px 40px; | ||
| font-size: $font-size-md; | ||
| color: $white; | ||
| font-weight: $weight-600; | ||
| border-radius: $border-radius-button; | ||
| cursor: pointer; | ||
|
|
||
| &.small { | ||
| padding: 10px 24px; | ||
| font-size: $font-size-xs; | ||
| } | ||
|
|
||
| &.medium { | ||
| padding: 14px 32px; | ||
| font-size: $font-size-sm; | ||
| } | ||
|
|
||
| &.outline { | ||
| border: 2px solid $primary; | ||
| background-color: $white; | ||
| color: $primary; | ||
| } | ||
|
|
||
| &.activeOutline { | ||
| border: 2px solid $tertiary; | ||
| color: $tertiary; | ||
| } | ||
|
|
||
| &.active { | ||
| background-color: $tertiary; | ||
| } | ||
|
|
||
| &.ghost { | ||
| background: rgba(86, 172, 89, 0.1); | ||
| color: $primary; | ||
| } | ||
|
|
||
| &.activeGhost { | ||
| background: rgba(44, 116, 47, 0.2); | ||
| color: $tertiary; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import React, { ReactNode, useState } from 'react'; | ||
| import clsx from 'clsx'; | ||
| import styles from './Button.module.scss'; | ||
| import Image from 'next/image'; | ||
|
|
||
| interface ButtonProps { | ||
| children: string; | ||
| variant?: 'primary' | 'transparent'; | ||
| size?: 'small' | 'medium' | 'large'; | ||
| icon?: ReactNode | string; | ||
| fill?: 'filled' | 'outline'; | ||
| ghost?: boolean; | ||
| } | ||
|
|
||
| export default function Button({ | ||
| children = 'Button', | ||
| variant = 'primary', | ||
| size = 'large', | ||
| icon, | ||
| fill = 'filled', | ||
| ghost = false, | ||
| }: ButtonProps) { | ||
| const [isHovered, setIsHovered] = useState(false); | ||
|
|
||
| return ( | ||
| <div> | ||
| <button | ||
| className={clsx( | ||
| styles.button, | ||
| styles[variant], | ||
| styles[fill], | ||
| styles[size], | ||
| isHovered && | ||
|
Member
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 can remove it, and do it with css only |
||
| (fill === 'outline' ? styles.activeOutline : styles.active), | ||
| ghost && (isHovered ? styles.activeGhost : styles.ghost) | ||
| )} | ||
| onMouseEnter={() => setIsHovered(true)} | ||
| onMouseLeave={() => setIsHovered(false)} | ||
| > | ||
| {children} | ||
| </button> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .callNow { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .phoneNumber { | ||
| padding-left: 8px; | ||
| font-size: $font-size-sm; | ||
| color: $white; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||
| import Image from 'next/image'; | ||||||||||
| import Phone from '../../assets/images/PhoneCall.svg'; | ||||||||||
|
Member
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. Assets importing should be in this format // index.ts
export { ReactComponent as PhoneIcon } from './phone-icon.svg';
// Component file
import { PhoneIcon } from '@assets/icons';
<PhoneIcon/> |
||||||||||
|
|
||||||||||
| import styles from './CallNow.module.scss'; | ||||||||||
|
|
||||||||||
| const phoneNumber = 2195550114; | ||||||||||
| const phoneDisplay = '(219) 555-0114'; | ||||||||||
|
Member
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. use https://www.npmjs.com/package/react-phone-number-input for number formatting
Comment on lines
+6
to
+7
Member
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.
Suggested change
|
||||||||||
|
|
||||||||||
| export default function CallNow() { | ||||||||||
| return ( | ||||||||||
| <a className={styles.callNow} href={`tel:${phoneNumber}`}> | ||||||||||
| <Image src={Phone} alt='phone' /> | ||||||||||
| <span className={styles.phoneNumber}>{phoneDisplay}</span> | ||||||||||
| </a> | ||||||||||
| ); | ||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .company { | ||
| max-width: 336px; | ||
| width: 100%; | ||
|
|
||
| p { | ||
| padding-top: 16px; | ||
| color: $gray-500; | ||
| font-size: $font-size-sm; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import Cta from '../Cta/Cta'; | ||
| import Logo from '../Logo/Logo'; | ||
|
|
||
| import styles from './Company.module.scss'; | ||
|
|
||
| export default function Company() { | ||
| return ( | ||
| <div className={styles.company}> | ||
| <Logo colorText='white' /> | ||
| <p> | ||
| Morbi cursus porttitor enim lobortis molestie. Duis gravida turpis dui, | ||
| eget bibendum magna congue nec. | ||
| </p> | ||
| <Cta /> | ||
| </div> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .copyRight { | ||
| color: $gray-500; | ||
| font-size: $font-size-sm; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import styles from './CopyRight.module.scss'; | ||
|
|
||
| export default function CopyRight() { | ||
| return ( | ||
| <div className={styles.copyRight}> | ||
| <p>Ecobazar eCommerce © 2021. All Rights Reserved</p> | ||
|
Member
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. use current year here |
||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| .cta { | ||
| display: flex; | ||
| align-items: center; | ||
| padding-top: 16px; | ||
|
|
||
| p { | ||
| padding: 0 !important; | ||
|
Member
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. Remove important usage |
||
| color: $white !important; | ||
| font-size: $font-size-sm; | ||
| font-weight: $weight-600; | ||
| } | ||
|
|
||
| span { | ||
| padding: 0 16px; | ||
| color: $white !important; | ||
| font-size: $font-size-sm; | ||
| font-weight: $weight-600; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import styles from './Cta.module.scss'; | ||
|
|
||
| interface CtaProps { | ||
| numberPhone?: string; | ||
| email?: string; | ||
| } | ||
|
|
||
| export default function Cta({ | ||
| numberPhone = '(219) 555-0114', | ||
| email = 'Proxy@gmail.com', | ||
| }: CtaProps) { | ||
| return ( | ||
| <div className={styles.cta}> | ||
| <p>{numberPhone}</p> | ||
| <span>or</span> | ||
| <p>{email}</p> | ||
| </div> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| .details { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| color: $gray-600; | ||
| font-size: $font-size-xs; | ||
| } | ||
|
|
||
| .links { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .selector { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .divider { | ||
| padding: 0 20px; | ||
| color: $gray-200; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import Image from 'next/image'; | ||
| import Account from '../Account/Account'; | ||
| import Location from '../Location/Location'; | ||
|
|
||
| import styles from './details.module.scss'; | ||
| import InfoOption from '../InfoOption/InfoOption'; | ||
|
|
||
| export default function Details() { | ||
| return ( | ||
| <div className={styles.details}> | ||
| <Location /> | ||
|
|
||
| <div className={styles.links}> | ||
| <div className={styles.selector}> | ||
| <InfoOption>Eng</InfoOption> | ||
| <InfoOption>USD</InfoOption> | ||
| </div> | ||
|
Comment on lines
+14
to
+17
Member
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. should be separate component |
||
| <span className={styles.divider}>|</span> | ||
|
Member
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. should be separate component |
||
| <Account /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .divider { | ||
| border-top: 1px solid $gray-100; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import styles from './Divider.module.scss'; | ||
|
|
||
| export default function Divider() { | ||
| return <div className={styles.divider}></div>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| .wrapper { | ||
| width: 100%; | ||
| background-color: $gray-900; | ||
|
|
||
| main { | ||
| width: 1440px; | ||
| margin: 0 auto; | ||
| } | ||
| } | ||
|
|
||
| .copy_payment { | ||
|
Member
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. Use one style of naming for css selectors |
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| border-top: 1px solid $gray-400; | ||
| padding: 24px 0; | ||
| } | ||
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.
We need to use localization