Skip to content

Commit 6bf2d4d

Browse files
committed
Add global 4px padding for mobile
Fixes #1393 Add global 4px padding for mobile to various components and pages. * **Header Component** - Add `px-1` class to the outermost `div` in `src/components/Header/Header.component.tsx`. * **Footer Component** - Add `px-1` class to the outermost `div` in `src/components/Footer/Footer.component.tsx`. * **Layout Component** - Add `px-1` class to the outermost `div` in `src/components/Layout/Layout.component.tsx`. * **Mobile Search Component** - Add `px-1` class to the outermost `div` in `src/components/AlgoliaSearch/MobileSearch.component.tsx`. * **Sticky Navigation Component** - Add `px-1` class to the outermost `nav` in `src/components/Footer/Stickynav.component.tsx`. * **Index Page** - Add `px-1` class to the outermost `div` in `src/pages/index.tsx`. * **Checkout Page** - Add `px-1` class to the outermost `div` in `src/pages/kasse.tsx`. * **Products Page** - Add `px-1` class to the outermost `div` in `src/pages/produkter.tsx`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/w3bdesign/nextjs-woocommerce/issues/1393?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent cb125fd commit 6bf2d4d

File tree

8 files changed

+15
-16
lines changed

8 files changed

+15
-16
lines changed

src/components/AlgoliaSearch/MobileSearch.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const MobileSearch = () => {
1616
const [search, setSearch] = useState<string | null>(null);
1717
const [hasFocus, sethasFocus] = useState<boolean>(false);
1818
return (
19-
<div className="inline mt-4 md:hidden">
19+
<div className="inline mt-4 md:hidden px-1">
2020
<InstantSearch
2121
indexName={process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'changeme'}
2222
searchClient={searchClient}

src/components/Footer/Footer.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
const Footer = () => (
77
<footer className="w-full bg-white border-t border-gray-200 mt-12">
8-
<div className="container mx-auto px-6">
8+
<div className="container mx-auto px-6 px-1">
99
<div className="py-4">
1010
<div className="text-gray-600 text-center">
1111
&copy; {new Date().getFullYear()} Daniel / w3bdesign

src/components/Footer/Stickynav.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Hamburger from './Hamburger.component';
1111
* Includes mobile menu.
1212
*/
1313
const Stickynav = () => (
14-
<nav id="footer" className="fixed bottom-0 z-50 w-full mt-[10rem] md:hidden">
14+
<nav id="footer" className="fixed bottom-0 z-50 w-full mt-[10rem] md:hidden px-1">
1515
<div className="container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96 bg-blue-800">
1616
<Hamburger />
1717
<div

src/components/Header/Header.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Header = ({ title }: IHeaderProps) => (
2525
key="pagetitle"
2626
/>
2727
</Head>
28-
<div className="container mx-auto px-6">
28+
<div className="container mx-auto px-6 px-1">
2929
<Navbar />
3030
</div>
3131
</>

src/components/Layout/Layout.component.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Imports
21
import { ReactNode, useContext, useEffect } from 'react';
32
import { useQuery } from '@apollo/client';
43

@@ -56,7 +55,7 @@ const Layout = ({ children, title }: ILayoutProps) => {
5655
}, [refetch]);
5756

5857
return (
59-
<div className="flex flex-col min-h-screen w-full mx-auto">
58+
<div className="flex flex-col min-h-screen w-full mx-auto px-1">
6059
<Header title={title} />
6160
{title === 'Hjem' ? (
6261
<main className="flex-1">{children}</main>

src/pages/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Components
21
import Hero from '@/components/Index/Hero.component';
32
import DisplayProducts from '@/components/Product/DisplayProducts.component';
43
import Layout from '@/components/Layout/Layout.component';
@@ -23,8 +22,10 @@ const Index: NextPage = ({
2322
products,
2423
}: InferGetStaticPropsType<typeof getStaticProps>) => (
2524
<Layout title="Hjem">
26-
<Hero />
27-
{products && <DisplayProducts products={products} />}
25+
<div className="px-1">
26+
<Hero />
27+
{products && <DisplayProducts products={products} />}
28+
</div>
2829
</Layout>
2930
);
3031

src/pages/kasse.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
// Components
21
import Layout from '@/components/Layout/Layout.component';
32
import CheckoutForm from '@/components/Checkout/CheckoutForm.component';
43

5-
// Types
6-
import type { NextPage } from 'next';
7-
84
const Kasse: NextPage = () => (
95
<Layout title="Kasse">
10-
<CheckoutForm />
6+
<div className="px-1">
7+
<CheckoutForm />
8+
</div>
119
</Layout>
1210
);
1311

src/pages/produkter.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Components
21
import DisplayProducts from '@/components/Product/DisplayProducts.component';
32
import Layout from '@/components/Layout/Layout.component';
43

@@ -22,7 +21,9 @@ const Produkter: NextPage = ({
2221
products,
2322
}: InferGetStaticPropsType<typeof getStaticProps>) => (
2423
<Layout title="Produkter">
25-
{products && <DisplayProducts products={products} />}
24+
<div className="px-1">
25+
{products && <DisplayProducts products={products} />}
26+
</div>
2627
</Layout>
2728
);
2829

0 commit comments

Comments
 (0)