Skip to content
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

Add padding on mobile #1395

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 px-1">
return (
<div className="inline mt-4 md:hidden">
<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 px-1">
<div className="container mx-auto px-6">
<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 px-1">
<nav id="footer" className="fixed bottom-0 z-50 w-full mt-[10rem] md:hidden">
<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 px-1">
<div className="container mx-auto px-6">
<Navbar />
</div>
</>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Layout/Layout.component.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Imports
import { ReactNode, useContext, useEffect } from 'react';
import { useQuery } from '@apollo/client';

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

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

Expand Down
8 changes: 5 additions & 3 deletions src/pages/kasse.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// 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">
<div className="px-1">
<CheckoutForm />
</div>
<CheckoutForm />
</Layout>
);

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

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

Expand Down
Loading