Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly committed May 27, 2024
1 parent 2578c0f commit a42f699
Show file tree
Hide file tree
Showing 46 changed files with 37,860 additions and 18,453 deletions.
8 changes: 8 additions & 0 deletions client/craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path')
module.exports = {
webpack: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
}
36,303 changes: 18,176 additions & 18,127 deletions client/package-lock.json

Large diffs are not rendered by default.

106 changes: 54 additions & 52 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,56 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@headlessui/react": "^1.7.18",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.69",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"framer-motion": "^10.16.16",
"js-cookie": "^3.0.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.1",
"react-scripts": "5.0.1",
"swiper": "^11.0.5",
"tailwind-merge": "^2.2.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"autoprefixer": "^10.4.16",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.0"
}
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@headlessui/react": "^1.7.18",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.69",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"framer-motion": "^10.16.16",
"js-cookie": "^3.0.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.1",
"react-scripts": "5.0.1",
"swiper": "^11.0.5",
"tailwind-merge": "^2.2.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4",
"zustand": "^4.5.2"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"autoprefixer": "^10.4.16",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.0",
"typescript-transform-paths": "^3.4.7"
}
}
23 changes: 15 additions & 8 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import About from "./components/Home/About/About";
import Campaign from "./components/Home/Campaign/Campaign";
import News from './components/Home/News/News';
import Recommend from "./components/Home/Recommend/Recommend";
import { useEffect } from "react";
import { useCart } from './hooks/useCart';

import About from "./components/Home/About";
import Campaign from "./components/Home/Campaign";
import News from './components/Home/News';
import Recommend from "./components/Home/Recommend";
import ShopList from "./components/Home/ShopList/ShopList";
import Layout from "./components/Layout/Layout";
import Layout from "./layouts/AppLayout";

export default function App() {
const { getCart } = useCart();

useEffect(() => {
getCart()
}, [])

function App() {
return (
<Layout>
<Recommend />
Expand All @@ -16,5 +25,3 @@ function App() {
</Layout>
);
}

export default App;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useEffect } from 'react';
import { useCart } from '../../../hooks/useCart';
import { useCart } from '../../hooks/useCart';
import { Link } from 'react-router-dom';

const QuantityInput = ({ productId, quantity, max = 99, changeQuantity }) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dialog } from '@headlessui/react';
import InputWithLabel from '../ui/InputWithLabel';
import InputWithLabel from '../atoms/Input';

const PostEditForm = ({ isAddOrEdit, setIsAddOrEdit, form, setForm, handleFormUpdate }) => {
const handleFormChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dialog } from '@headlessui/react';
import InputWithLabel from '../ui/InputWithLabel';
import InputWithLabel from '../atoms/Input';

const ProductEditForm = ({ isAddOrEdit, setIsAddOrEdit, form, setForm, handleFormUpdate }) => {

Expand Down
66 changes: 0 additions & 66 deletions client/src/components/Header/AccountLinks/AccountLinks.tsx

This file was deleted.

107 changes: 0 additions & 107 deletions client/src/components/Header/Header.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link, useNavigate } from 'react-router-dom';
import { Link } from 'react-router-dom';
import { Autoplay, Navigation } from 'swiper/modules';
import { Swiper, SwiperSlide } from 'swiper/react';
import { useCart } from '../../../../hooks/useCart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Header from './Header/Header';
import Header from './Header';

import { Link } from 'react-router-dom';
import 'swiper/css';
import 'swiper/css/navigation';
import RecommendProducts from './Products/Products';
import RecommendProducts from './Products';

const Recommend = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Layout from '../Layout/Layout'
import AppLayout from '@/layouts/AppLayout'

const Loading = () => (
<Layout>
<AppLayout>
<div className='fixed inset-0 z-50 flex items-center justify-center bg-secondary'>
<svg
className='w-8 h-8 mr-3 text-primary animate-spin'
Expand All @@ -17,7 +17,7 @@ const Loading = () => (
</svg>
<span className='text-3xl font-bold text-primary'>Loading...</span>
</div>
</Layout>
</AppLayout>
)

export default Loading
9 changes: 9 additions & 0 deletions client/src/components/atoms/IconBtn/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const IconBtn = (
{ onClick = () => { }, icon, isInMenu = false, text }) => (
<button className='flex items-center min-w-fit gap-1 md:gap-0.5' onClick={onClick}>
{icon}
{text && <span className={`${isInMenu ? 'text-secondary' : ''} text-sm md:text-xs hover:underline`}>{text}</span>}
</button>
)

export default IconBtn;
Loading

0 comments on commit a42f699

Please sign in to comment.