Skip to content

Commit

Permalink
pod first
Browse files Browse the repository at this point in the history
  • Loading branch information
larbi-ishak committed Jul 20, 2023
1 parent 14b7654 commit 1246e96
Show file tree
Hide file tree
Showing 12 changed files with 10,140 additions and 2,877 deletions.
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run build
command: npm run start


12,400 changes: 9,892 additions & 2,508 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,32 @@
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@mantine/carousel": "^6.0.17",
"@mantine/core": "^6.0.17",
"@mantine/dates": "^6.0.17",
"@mantine/dropzone": "^6.0.17",
"@mantine/form": "^6.0.17",
"@mantine/hooks": "^6.0.17",
"@mantine/modals": "^6.0.17",
"@mantine/next": "^6.0.17",
"@mantine/notifications": "^6.0.17",
"@mantine/nprogress": "^6.0.17",
"@mantine/prism": "^6.0.17",
"@mantine/spotlight": "^6.0.17",
"@mantine/tiptap": "^6.0.17",
"@next/font": "13.1.6",
"@tabler/icons-react": "^2.26.0",
"@tiptap/extension-link": "^2.0.4",
"@tiptap/react": "^2.0.4",
"@tiptap/starter-kit": "^2.0.4",
"bootstrap": "^5.2.3",
"dayjs": "^1.11.9",
"embla-carousel-react": "^7.1.0",
"eslint": "8.33.0",
"eslint-config-next": "13.1.6",
"json-server": "^0.17.3",
"next": "13.1.6",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
34 changes: 25 additions & 9 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@

import { AppProps } from 'next/app';
import Head from 'next/head';
import { MantineProvider } from '@mantine/core';
import RootLayout from "@/src/layouts/routLayout";
import Navbar from "@/src/components/navbar";
import Footer from "@/src/components/footer";
import "@/styles/globals.css";
import Head from "next/head";

export default function App({ Component, pageProps }) {
return (
<>
<Head>
export default function App(props) {
const { Component, pageProps } = props;

return (
<>
<Head>
<title>Page title</title>
<meta charSet="UTF-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Head>
</Head>

<MantineProvider
withGlobalStyles
withNormalizeCSS
theme={{
/** Put your mantine theme override here */
colorScheme: 'light',
}}
>
<RootLayout>
<Navbar />
<Component {...pageProps} />
<Footer />
</RootLayout>
</>
);
}
</MantineProvider>
</>
);
}
7 changes: 4 additions & 3 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import { createGetInitialProps } from '@mantine/next';
const getInitialProps = createGetInitialProps();
import { Html, Head, Main, NextScript } from 'next/document'
import Document, { Head, Html, Main, NextScript } from 'next/document';

const getInitialProps = createGetInitialProps();

export default class _Document extends Document {
static getInitialProps = getInitialProps;
Expand All @@ -17,4 +18,4 @@ export default class _Document extends Document {
</Html>
);
}
}
}
Binary file added public/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions src/components/foot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { createStyles, Avatar, Text, Group } from '@mantine/core';
import { IconPhoneCall, IconAt } from '@tabler/icons-react';

const useStyles = createStyles((theme) => ({
icon: {
color: theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[5],
},

name: {
fontFamily: `Greycliff CF, ${theme.fontFamily}`,
},
}));


export function UserInfoIcons({ avatar, name, title, phone, email }) {
const { classes } = useStyles();
return (
<div>
<Group noWrap>
<Avatar src={avatar} size={80} radius="md" />
<div>
<Text fz="xs" tt="uppercase" fw={700} c="dimmed">
{title}
</Text>

<Text fz="lg" fw={500} className={classes.name}>
{name}
</Text>

<Group noWrap spacing={10} mt={3}>
<IconAt stroke={1.5} size="1rem" className={classes.icon} />
<Text fz="xs" c="dimmed">
{email}
</Text>
</Group>

<Group noWrap spacing={10} mt={5}>
<IconPhoneCall stroke={1.5} size="1rem" className={classes.icon} />
<Text fz="xs" c="dimmed">
{phone}
</Text>
</Group>

</div>
</Group>
</div>
);
}
5 changes: 4 additions & 1 deletion src/components/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import styles from "@/styles/Home.module.css";
import { UserInfoIcons } from "./foot";

const Footer = () => {
return <footer className={styles.nav}>Footer</footer>;
return <footer className={styles.footer} style={{display: "flex", justifyContent: "center", border: "1px solid black"}}>
<UserInfoIcons avatar={"/logo.jpg"} name={"internationamb"} title={"beauty and health"} phone={"0777209008"} email={"[email protected]"}/>
</footer>;
{
/* TODO add contact developer */
}
Expand Down
128 changes: 128 additions & 0 deletions src/components/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { useState } from 'react';
import Link from 'next/link';
import Image from 'next/image';
import {
createStyles,
Header,
Container,
Group,
Burger,
Paper,
Transition,
rem,
} from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';

const HEADER_HEIGHT = rem(60);

const useStyles = createStyles((theme) => ({
root: {
position: 'relative',
zIndex: 1,
},

dropdown: {
position: 'absolute',
top: HEADER_HEIGHT,
left: 0,
right: 0,
zIndex: 0,
borderTopRightRadius: 0,
borderTopLeftRadius: 0,
borderTopWidth: 0,
overflow: 'hidden',

[theme.fn.largerThan('sm')]: {
display: 'none',
},
},

header: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
height: '100%',
},

links: {
[theme.fn.smallerThan('xs')]: {
display: 'none',
},
},

burger: {
[theme.fn.largerThan('xs')]: {
display: 'none',
},
},

link: {
display: 'block',
lineHeight: 1,
padding: `${rem(8)} ${rem(12)}`,
borderRadius: theme.radius.sm,
textDecoration: 'none',
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],
fontSize: theme.fontSizes.sm,
fontWeight: 500,

'&:hover': {
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.teal[1]
},

[theme.fn.smallerThan('sm')]: {
borderRadius: 0,
padding: theme.spacing.md,
},
},

linkActive: {
'&, &:hover': {
backgroundColor: theme.fn.variant({ variant: 'light', color: theme.colors.teal[1] }).background,
color: theme.fn.variant({ variant: 'light', color: theme.colors.teal[1] }).color,
},
},
}));


export function HeaderResponsive({ links }) {
const [opened, { toggle, close }] = useDisclosure(false);
const [active, setActive] = useState(links[0].link);
const { classes, cx } = useStyles();

const items = links.map((link) => (
<Link
key={link.label}
href={link.link}
className={cx(classes.link, { [classes.linkActive]: active === link.link })}
onClick={(event) => {
setActive(link.link);
close();
}}
>
{link.label}
</Link>
));

return (
<Header height={HEADER_HEIGHT} className={classes.root} >
<Container className={classes.header}>
<Link href={"/"}><Image src={"/logo.jpg"} width={50} height={50} /></Link>

<Group spacing={5} className={classes.links}>
{items}
</Group>

<Burger opened={opened} onClick={toggle} className={classes.burger} size="sm" />

<Transition transition="pop-top-right" duration={200} mounted={opened}>
{(styles) => (
<Paper className={classes.dropdown} withBorder style={styles}>
{items}
</Paper>
)}
</Transition>
</Container>
</Header>
);
}
22 changes: 2 additions & 20 deletions src/components/navbar.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
import Link from "next/link";
import styles from "@/styles/Home.module.css";
import { HeaderResponsive } from "./header";

const Navbar = () => {
return (
<nav className={styles.nav}>
<ul className={styles.navUl}>
<li>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">about us</Link>
</li>
<li>
<Link href="/products">products</Link>
</li>
<li>
<Link href="/blogs">blogs</Link>
</li>
<li>
<Link href="/contact">contact</Link>
</li>
<li>
<Link href="/cart">cart</Link>
</li>
</ul>
<HeaderResponsive links={[{label: "Home", link: "/"}, {label: "Products", link: "/products"},{label: "About Us", link: "/about"}, {label: "Contact Us", link: "/contact"},{label: "Blogs", link: "/blogs"},{label: "Cart", link: "/cart"}]} />
</nav>
);
};
Expand Down
Loading

0 comments on commit 1246e96

Please sign in to comment.