Skip to content

Commit

Permalink
Reusable components
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice-Dush committed Jul 1, 2024
1 parent 7c4fb91 commit 0500f2c
Show file tree
Hide file tree
Showing 14 changed files with 371 additions and 260 deletions.
32 changes: 14 additions & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"ignorePatterns": ["webpack.prod.config.ts", "webpack.dev.config.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"react-hooks",
"import",
"jsx-a11y"
],
"plugins": ["@typescript-eslint", "react-hooks", "import", "jsx-a11y"],
"extends": [
"airbnb",
"airbnb-typescript",
Expand All @@ -33,10 +29,7 @@
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/*.test.tsx",
"**/*.test.ts"
]
"devDependencies": ["**/*.test.tsx", "**/*.test.ts"]
}
],
"react/function-component-definition": [
Expand All @@ -46,13 +39,16 @@
}
],
"eol-last": ["warn", "always"],
"@typescript-eslint/comma-dangle": ["warn", {
"arrays": "only-multiline",
"objects": "only-multiline",
"imports": "only-multiline",
"exports": "only-multiline",
"functions": "only-multiline"
}],
"@typescript-eslint/comma-dangle": [
"warn",
{
"arrays": "only-multiline",
"objects": "only-multiline",
"imports": "only-multiline",
"exports": "only-multiline",
"functions": "only-multiline"
}
],
"linebreak-style": ["warn", "unix"],
"no-param-reassign": "off",
"arrow-body-style": ["warn", "as-needed"],
Expand All @@ -71,4 +67,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/coverage

# production
/build
/dist

# misc
.DS_Store
Expand Down
Binary file added public/linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/twitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import Categories from "./components/categories/Categories";
import Home from "./pages/Home";
import Sidebar from "./components/siderbar/Sidebar";

const App: React.FC = () => (
<>
<Sidebar />
<Header />
<Categories />
<LandingPage />
<Footer />
<Home />
</>
);
function App() {
return (
<>
<Header />
<Sidebar />
<Categories />
<LandingPage />
<Home />
<Footer />
</>
);
}

export default App;
6 changes: 3 additions & 3 deletions src/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ interface ButtonProps {
iconPosition?: "start" | "end";
}

const Button: React.FC<ButtonProps> = ({
function Button({
children,
variant = "outline",
disabled = false,
onClick,
icon,
iconPosition = "start",
}) => {
}: ButtonProps) {
return (
<button
className={`button button--${variant} ${disabled ? "button--disabled" : ""}`}
Expand All @@ -35,6 +35,6 @@ const Button: React.FC<ButtonProps> = ({
)}
</button>
);
};
}

export default Button;
21 changes: 0 additions & 21 deletions src/components/categories/Categories.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
/* eslint-disable */

import React from "react";
import SearchInput from "../inputs/SearchBox";
import "../../styles/_categories.scss";

function Categories() {
return (
<div className="categories__container">
<div className="categories__filters">
<select className="categories__filter">
<option
value=""
className="categories__filter__text"
defaultValue="defaultValue"
>
Shopping Categories
</option>
<option value="" className="categories__filter__text">
Men's clothes
</option>
</select>
<div className="categories__form">
<SearchInput />
</div>
<div className="categories__btn__join">
Join us <span className="categories__arrow">&rarr;</span>
</div>
</div>
<div className="categories">
<div className="categories__box categories__box__1">
<img
Expand Down
219 changes: 143 additions & 76 deletions src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,94 +6,161 @@ import "../../styles/_footer.scss";
function Footer() {
return (
<footer className="footer">
<div className="footer__box footer__sell">
<p className="footer__title">Sell With Ninjas</p>
<ul className="footer__link__container">
<li>
<a href="#" className="footer__link">
1. Join us
</a>
</li>
</ul>
<div className="footer__container">
<div className="footer__content">
<nav className="footer__nav">
<p className="footer__title">Get support</p>
<ul className="footer__list">
<li className="footer__item">
<a href="#" className="footer__link">
Help center
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
Live chat
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
Report abuse
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
Frequently Asked Questions
</a>
</li>
</ul>
</nav>
<nav className="footer__nav">
<p className="footer__title">Trade assurance</p>
<ul className="footer__list">
<li className="footer__item">
<a href="#" className="footer__link">
Safety and easy payment
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
On-time shipping
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
After-sales protection
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
Money-back policy
</a>
</li>
</ul>
</nav>
<nav className="footer__nav">
<p className="footer__title">Shopping guides</p>
<ul className="footer__list">
<li className="footer__item">
<a href="#" className="footer__link">
How to register
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
How to place an order
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
How to pay
</a>
</li>
<li className="footer__item">
<a href="#" className="footer__link">
Frequently Asked Questions
</a>
</li>
</ul>
</nav>
<nav className="footer__nav">
<p className="footer__title">Get to know us</p>
<ul className="footer__list">
<li className="footer__special__item">
<span className="footer__text">Address:</span>
<address className="footer__address">
Kigali, Rwanda,
<br />
Norsken Building,
<br />
Room 14 Second floor
</address>
<span className="footer__text">Phone:</span>
<a href="tel:+250783456766" className="footer__link">
+250783456766
</a>
<span className="footer__text">Email:</span>
<a
href="mailto:[email protected]"
className="footer__link"
>
[email protected]
</a>
</li>
</ul>
</nav>
</div>
<div className="footer__socials">
<img
src="instagram.webp"
alt="Instagram logo"
className="footer__social"
/>
<img
src="facebook.png"
alt="Facebook logo"
className="footer__social"
/>
<img
src="twitter.png"
alt="Twitter logo"
className="footer__social"
/>
<img
src="linkedin.png"
alt="Linkedin logo"
className="footer__social"
/>
</div>
</div>
<div className="footer__box footer__guides">
<p className="footer__title">Shopping guides</p>
<ul className="footer__link__container">
<li>
<a href="#" className="footer__link">
1. How to register
<div className="footer__additional">
<ul className="footer__additional__list">
<li className="footer__additional__item">
<a href="#" className="footer__additional__link">
Terms of use
</a>
</li>
<li>
<a href="#" className="footer__link">
2. How to place an order
<li className="footer__additional__item">
<a href="#" className="footer__additional__link">
Legal notice
</a>
</li>
<li>
<a href="#" className="footer__link">
3. How to pay
</a>
</li>
</ul>
</div>
<div className="footer__box footer__help">
<p className="footer__title">Help center</p>
<ul className="footer__link__container">
<li>
<a href="#" className="footer__link">
1. Frequently asked questions
<li className="footer__additional__item">
<a href="#" className="footer__additional__link">
Product Listing Policy
</a>
</li>
<li>
<a href="#" className="footer__link">
2. Live chat
<li className="footer__additional__item">
<a href="#" className="footer__additional__link">
Privacy Policy
</a>
</li>
</ul>
</div>
<div className="footer__box footer__contact">
<p className="footer__title">Contact us</p>
<p className="footer__text">
Address: Kigali, Rwanda, Norsken building Room 14 Second Floor
<p className="footer__copyright">
&copy; E-commerce Ninjas {new Date().getFullYear()}. All rights
reserved
</p>
<p className="footer__text">Phone: +250782345678</p>
<p className="footer__text">Email: [email protected]</p>
</div>
<div className="footer__box footer__connect">
<p className="footer__title">Stay connected</p>
<ul className="footer__link__container footer__link__container-row">
<li>
<a
href="https://instagram.com"
target="_blank"
className="footer__link"
>
<img
src="instagram.webp"
alt="Instagram logo"
className="footer__img"
/>
</a>
</li>
<li>
<a
href="https://facebook.com"
target="_blank"
className="footer__link"
>
<img
src="facebook.png"
alt="Facebook logo"
className="footer__img"
/>
</a>
</li>
</ul>
</div>
<p className="footer__copyright">
&copy; E-commerce Ninjas {new Date().getFullYear()}. All rights
reserved.
</p>
</footer>
);
}
Expand Down
Loading

0 comments on commit 0500f2c

Please sign in to comment.