Skip to content

Commit

Permalink
fix bug UI Login
Browse files Browse the repository at this point in the history
fix bug UI Login exclude (Behavior của nút nhập số điện thoại phải giống với bên GrabFood
)
  • Loading branch information
ntnhan90 committed Nov 4, 2023
1 parent de91969 commit 9af6804
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 38 deletions.
2 changes: 2 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ body {
overflow: hidden;
flex-shrink: 0;
font-size: var(--text-lg-semibold-size);
border-bottom: 1px solid #F2F4F7;
}

.full-width-header-navigation .header {
Expand Down Expand Up @@ -1095,6 +1096,7 @@ a:hover{
font-size: var(--display-sm-bold-size);
color: var(--color-yellowgreen-100);
font-family: var(--text-md-regular);
margin: 75px 0;
}
.image-login-page {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion components/LoginSteps/LoginComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const LoginComponent = ({onChange,setPhone}: StepType) => {
<div className="sign-up">
<div className="image-login-page">
<div className="image-login-page-child"></div>
<img src="/images/6387ec276a4eb-62aa10dfb2adca268416cf2fd03d82f5transformed-3@2x.png" alt="product" />
<img src="/images/login_image.png" alt="product" />
</div>
<div className="content26">
<div className="title">
Expand Down
67 changes: 32 additions & 35 deletions components/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import Link from "next/link";
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
/*
type HeaderType = {
isErrorPage?: Boolean;
}
*/

type HeaderType = {
isErrorPage?: Boolean;
Expand All @@ -14,7 +9,8 @@ type HeaderType = {
const Header = ({ isErrorPage }: HeaderType) => {
const router = useRouter();
const arrayPaths = ['/'];
const [onTop, setOnTop] = useState(( !arrayPaths.includes("/")|| isErrorPage ) ? false : true);
const [onTop, setOnTop] = useState(( !arrayPaths.includes("/router.pathname")|| isErrorPage ) ? false : true);
const [pageLogin] = useState(( router.pathname == "/login" ) ? true : false);

const headerClass = () => {
if(window.pageYOffset === 0) {
Expand All @@ -23,9 +19,7 @@ const Header = ({ isErrorPage }: HeaderType) => {
setOnTop(false);
}
}
if(!arrayPaths.includes("login") ) {
console.log("hihe")
}

useEffect(() => {
if(!arrayPaths.includes(router.pathname) || isErrorPage) {
return;
Expand Down Expand Up @@ -77,36 +71,39 @@ const Header = ({ isErrorPage }: HeaderType) => {
</div>

<div className="navigation-actions-wrapper d-flex gap-3">
<div className="navigation-actions d-flex align-items-center">
<Link href="/login">
<a className="login-button">
<span className="font-weight-600">Đăng nhập</span>
</a>
</Link>
</div>
<div className="nav-item-button d-flex">
<Link href="#footer-section">
<a className="text fw-bolder">
<img className="small-icon"
alt="small-icon"
src="/images/shoppingbag03.svg"
/>

{!pageLogin &&
<div className="navigation-actions d-flex align-items-center">
<Link href="/login">
<a className="login-button">
<span className="font-weight-600">Đăng nhập</span>
</a>
</Link>

</div>
<div className="language-button d-flex align-items-center gap-1">
<div className="language-text">VIE</div>
<Link href="#footer-section">
<a className="text fw-bolder">
<img className="small-icon"
alt=""
src="/images/vn.svg"
/>
</a>
</Link>
}
{!pageLogin &&
<div className="nav-item-button d-flex">
<Link href="#footer-section">
<a className="text fw-bolder">
<img className="small-icon"
alt="small-icon"
src="/images/shoppingbag03.svg"
/>
</a>
</Link>
</div>
}
<div className="language-button d-flex align-items-center gap-1">
<div className="language-text">VIE</div>
<Link href="#footer-section">
<a className="text fw-bolder">
<img className="small-icon"
alt=""
src="/images/vn.svg"
/>
</a>
</Link>
</div>
</div>
</div>
</header>
Expand Down
4 changes: 2 additions & 2 deletions components/item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { ProductTypeList,IngredientType } from 'types';
import Ingredient from './ingredient';


const MenuItem = ({ name, price,
const MenuItem = ({ name, price,
images, merchart, currentPrice,
cook_method, time ,
ingredient,
distance, ratings, kcal}: ProductTypeList) => {
return(
<div className="food-card d-flex flex-column ">
<div className="food-card d-flex flex-column " key={name}>
<div className="frame-parent d-flex flex-column">
<div className="discount-wrapper">
{
Expand Down
13 changes: 13 additions & 0 deletions pages/api/products.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { NextApiRequest, NextApiResponse } from 'next';

// fake data
import products from '../../utils/data/products';

export default (req: NextApiRequest, res: NextApiResponse) => {
console.log(req);

// fake loading time
setTimeout(() => {
res.status(200).json(products);
}, 800);
}
Binary file added public/images/login_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9af6804

Please sign in to comment.