Skip to content

Commit

Permalink
Merge pull request #1394 from w3bdesign/fix-mobile-padding
Browse files Browse the repository at this point in the history
Add global 4px padding for mobile
  • Loading branch information
w3bdesign authored Jan 16, 2025
2 parents cb125fd + 02234dd commit 9282d30
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/AlgoliaSearch/MobileSearch.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const searchClient = algoliasearch(
const MobileSearch = () => {
const [search, setSearch] = useState<string | null>(null);
const [hasFocus, sethasFocus] = useState<boolean>(false);
return (
<div className="inline mt-4 md:hidden">
return (
<div className="inline mt-4 md:hidden px-1">
<InstantSearch
indexName={process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'changeme'}
searchClient={searchClient}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
const Footer = () => (
<footer className="w-full bg-white border-t border-gray-200 mt-12">
<div className="container mx-auto px-6">
<div className="container mx-auto px-6 px-1">
<div className="py-4">
<div className="text-gray-600 text-center">
&copy; {new Date().getFullYear()} Daniel / w3bdesign
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Stickynav.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Hamburger from './Hamburger.component';
* Includes mobile menu.
*/
const Stickynav = () => (
<nav id="footer" className="fixed bottom-0 z-50 w-full mt-[10rem] md:hidden">
<nav id="footer" className="fixed bottom-0 z-50 w-full mt-[10rem] md:hidden px-1">
<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">
<Hamburger />
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Header = ({ title }: IHeaderProps) => (
key="pagetitle"
/>
</Head>
<div className="container mx-auto px-6">
<div className="container mx-auto px-6 px-1">
<Navbar />
</div>
</>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Layout/Layout.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Imports
import { ReactNode, useContext, useEffect } from 'react';
import { useQuery } from '@apollo/client';

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

return (
<div className="flex flex-col min-h-screen w-full mx-auto">
<div className="flex flex-col min-h-screen w-full mx-auto px-1">
<Header title={title} />
{title === 'Hjem' ? (
<main className="flex-1">{children}</main>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Components
import Hero from '@/components/Index/Hero.component';
import DisplayProducts from '@/components/Product/DisplayProducts.component';
import Layout from '@/components/Layout/Layout.component';
Expand All @@ -23,8 +22,10 @@ const Index: NextPage = ({
products,
}: InferGetStaticPropsType<typeof getStaticProps>) => (
<Layout title="Hjem">
<Hero />
{products && <DisplayProducts products={products} />}
<div className="px-1">
<Hero />
{products && <DisplayProducts products={products} />}
</div>
</Layout>
);

Expand Down
8 changes: 3 additions & 5 deletions src/pages/kasse.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Components
import Layout from '@/components/Layout/Layout.component';
import CheckoutForm from '@/components/Checkout/CheckoutForm.component';

// Types
import type { NextPage } from 'next';

const Kasse: NextPage = () => (
<Layout title="Kasse">
<CheckoutForm />
<div className="px-1">
<CheckoutForm />
</div>
</Layout>
);

Expand Down
5 changes: 3 additions & 2 deletions src/pages/produkter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Components
import DisplayProducts from '@/components/Product/DisplayProducts.component';
import Layout from '@/components/Layout/Layout.component';

Expand All @@ -22,7 +21,9 @@ const Produkter: NextPage = ({
products,
}: InferGetStaticPropsType<typeof getStaticProps>) => (
<Layout title="Produkter">
{products && <DisplayProducts products={products} />}
<div className="px-1">
{products && <DisplayProducts products={products} />}
</div>
</Layout>
);

Expand Down

0 comments on commit 9282d30

Please sign in to comment.