Skip to content
Open
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_URL=http://127.0.0.1:5000/api
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
"@fontsource/open-sans": "^4.5.0",
"@fontsource/raleway": "^4.5.0",
"@fontsource/roboto": "^4.5.8",
"@reduxjs/toolkit": "^2.6.1",
"ajv": "^8.17.1",
"apexcharts": "^3.27.3",
"apexcharts": "^4.0.0",
"axios": "^1.8.4",
"chart.js": "^4.4.8",
"classnames": "2.3.1",
"cross-env": "^7.0.3",
"framer-motion": "^4.1.17",
Expand All @@ -28,17 +31,21 @@
"react-big-calendar": "0.33.2",
"react-bootstrap-sweetalert": "5.2.0",
"react-datetime": "3.1.1",
"react-datetime-picker": "^6.0.1",
"react-dom": "16.14.0",
"react-github-btn": "^1.2.1",
"react-icons": "^4.2.0",
"react-jvectormap": "0.0.16",
"react-redux": "^7.2.9",
"react-router-dom": "5.2.1",
"react-scripts": "5.0.0",
"react-swipeable-views": "0.14.0",
"react-table": "7.7.0",
"react-tagsinput": "3.19.0",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
"stylis": "^4.0.13",
"stylis-plugin-rtl": "^2.1.1"
"stylis-plugin-rtl": "2.1.1"
},
"resolutions": {
"react-error-overlay": "6.0.11"
Expand Down
36 changes: 17 additions & 19 deletions src/components/Icons/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,6 @@ export const CreativeTimLogo = createIcon({
</g>
</g>
),

// <chakra.svg
// height="50px"
// width="50px"
// viewBox="0 0 100 100"
// fill="none"
// xmlns="http://www.w3.org/2000/svg"
// color={fill}
// {...props}
// >
// </chakra.svg>
});

export const CreditIcon = createIcon({
Expand Down Expand Up @@ -339,7 +328,7 @@ export const MastercardIcon = createIcon({
<svg
width="24"
height="20"
viewBox="0 0 21 15"
viewBox="0 0 30 9"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
Expand All @@ -360,7 +349,7 @@ export const PayPalIcon = createIcon({
/>
<path
fill="currentColor"
d="M18.213 7.393c-.998 4.61-4.184 7.048-9.24 7.048H7.142L5.773 23.1h2.973a.87.87 0 00.862-.731l.035-.184.684-4.297.044-.237a.87.87 0 01.86-.731h.544c3.514 0 6.264-1.416 7.068-5.51.322-1.644.166-3.021-.63-4.017z"
d="M18.213 7.393c-.998 4.61-4.184 7.048-9.24 7.048H7.142L5.773 23.1h2.973a.87.87 0 00.862-.731l.035-.184.684-4.297.044-.237a.87.87 0 01.86-.731h.544c3.514 0 6.264-1.592 5.83-3.504z"
/>
</g>
),
Expand All @@ -372,7 +361,7 @@ export const PersonIcon = createIcon({
path: (
<path
fill="currentColor"
d="M14.618 3.338c-.855-.924-2.05-1.432-3.368-1.432-1.325 0-2.524.505-3.375 1.423-.86.928-1.28 2.188-1.181 3.55.195 2.686 2.239 4.87 4.556 4.87s4.358-2.184 4.556-4.87c.1-1.349-.322-2.607-1.188-3.541zM18.984 21.592H3.515a1.363 1.363 0 01-1.063-.489 1.552 1.552 0 01-.316-1.279c.371-2.058 1.529-3.786 3.348-5 1.616-1.076 3.664-1.67 5.766-1.67s4.15.594 5.765 1.67c1.82 1.214 2.977 2.942 3.348 5 .085.471-.03.937-.315 1.279a1.362 1.362 0 01-1.064.49z"
d="M14.618 3.338c-.855-.924-2.05-1.432-3.368-1.432-1.325 0-2.524.505-3.375 1.423-.86.928-1.28 2.188-1.181 3.55.195 2.686 2.239 4.87 4.556 4.87s4.358-2.184 4.556-4.87c.1-1.349-.322-2.607-1.188-3.541zM18.984 21.592H3.515a1.363 1.363 0 01-1.063-.489 1.552 1.552 0 01-.316-1.279c.371-2.058 1.529-3.786 3.348-5 1.616-1.076 3.664-1.67 5.766-1.67s4.15.594 5.765 1.67c1.82 1.214 2.977 2.942 3.348 5 .085.471-.03.972-.315 1.234-.774.27-.47.248-.93-.03-.72z"
/>
),
});
Expand Down Expand Up @@ -402,7 +391,7 @@ export const RocketIcon = createIcon({
/>
<path
fill="currentColor"
d="M7.4 18.054c-.24.241-.627.335-1.092.416-1.044.178-1.967-.725-1.779-1.78.072-.401.283-.962.415-1.094a.192.192 0 00-.16-.328 2.636 2.636 0 00-1.544.753c-1.033 1.034-1.13 4.87-1.13 4.87s3.838-.097 4.872-1.13c.417-.417.682-.961.752-1.546.017-.184-.207-.293-.334-.16z"
d="M7.4 18.054c-.24.241-.627.335-1.092.416-1.044.178-1.967-.725-1.779-1.78.072-.41-1.26-1.63-3.06-2.76-4.248-4.248-.24.24-.627.335-1.092.416-1.044.178-1.967-.725-1.779-1.78.072-.41 1.26 1.63 3.06 2.76 4.248 1.26.24.24.627.335 1.092.416 1.044.178-1.967-.725-1.779-1.78.072-.41z"
/>
</g>
),
Expand All @@ -411,13 +400,12 @@ export const RocketIcon = createIcon({
export const SettingsIcon = createIcon({
displayName: "SettingsIcon",
viewBox: "0 0 24 24",
// path can also be an array of elements, if you have multiple paths, lines, shapes, etc.
path: (
<g>
<path d="M0,0h24v24H0V0z" fill="none" />
<path
fill="currentColor"
d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"
d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c-0.18-0.14-0.23-0.41-0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.239-.24-.593-.378-.976-.378-.38 0-.734.138-.972.379L.93,11.23a.717.717 0 00-.058.983.703.703 0 001.018.046l9.119-8.713a.352.352 0 01.486 0l9.12,8.713a.703.703 0 00.992-.019c.27-.28.248-.74-.033-1.01z"
/>
</g>
),
Expand All @@ -429,7 +417,7 @@ export const SlackLogo = createIcon({
path: (
<g clipPath="url(#clip0)" fillRule="evenodd" clipRule="evenodd">
<path
d="M7.832.5c-1.105 0-2 .919-1.999 2.05 0 1.13.895 2.048 2 2.05h2V2.55c.001-1.13-.894-2.048-2-2.05zm0 5.467H2.5c-1.106 0-2.001.918-2 2.05-.002 1.13.894 2.048 2 2.05h5.332c1.106-.001 2.002-.919 2-2.05.002-1.132-.894-2.05-2-2.05z"
d="M7.832.5c-1.105 0-2 .919-1.999 2.05 0 1.13.895 2.048 2.05h2V2.55c.001-1.13-.894-2.048-2-2.05zm0 5.467H2.5c-1.106 0-2.001.918-2 2.05-.002 1.13.894 2.048 2 2.05h5.332c1.106-.001 2.002-.919 2-2.05.002-1.132-.894-2.05-2-2.05z"
fill="#36C5F0"
/>
<path
Expand Down Expand Up @@ -462,7 +450,6 @@ export const SpotifyLogo = createIcon({
});

export const SupportIcon = createIcon({
// Doesn't display the full icon without w and h being specified
displayName: "BuildIcon",
viewBox: "0 0 24 24",
path: (
Expand Down Expand Up @@ -521,3 +508,14 @@ export const VisaIcon = createIcon({
</svg>
),
});

export const ActivityIcon = createIcon({
displayName: "ActivityIcon",
viewBox: "0 0 24 24",
path: (
<path
fill="currentColor"
d="M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6l1.8-.7"
/>
),
});
121 changes: 121 additions & 0 deletions src/components/Products/ProductCreateModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import {
Modal,
ModalOverlay,
ModalContent,
ModalHeader,
ModalFooter,
ModalBody,
ModalCloseButton,
Button,
FormControl,
FormLabel,
Input,
Textarea,
VStack,
useColorModeValue,
} from "@chakra-ui/react";
import React, { useState } from "react";

function ProductCreateModal({ isOpen, onClose, onCreateProduct }) {
const textColor = useColorModeValue("gray.700", "white");
const [formData, setFormData] = useState({
title: "",
sku: "",
price: "",
description: "",
image: "",
});

const handleChange = (e) => {
const { name, value } = e.target;
setFormData((prev) => ({
...prev,
[name]: value,
}));
};

const handleSubmit = (e) => {
e.preventDefault();
onCreateProduct(formData);
setFormData({
title: "",
sku: "",
price: "",
description: "",
image: "",
});
onClose();
};

return (
<Modal isOpen={isOpen} onClose={onClose} size="xl">
<ModalOverlay />
<ModalContent>
<ModalHeader color={textColor}>Create New Product</ModalHeader>
<ModalCloseButton />
<form onSubmit={handleSubmit}>
<ModalBody>
<VStack spacing={4}>
<FormControl isRequired>
<FormLabel color={textColor}>Title</FormLabel>
<Input
name="title"
value={formData.title}
onChange={handleChange}
placeholder="Product title"
/>
</FormControl>
<FormControl isRequired>
<FormLabel color={textColor}>SKU</FormLabel>
<Input
name="sku"
value={formData.sku}
onChange={handleChange}
placeholder="Product SKU"
/>
</FormControl>
<FormControl isRequired>
<FormLabel color={textColor}>Price</FormLabel>
<Input
name="price"
type="number"
value={formData.price}
onChange={handleChange}
placeholder="Product price"
/>
</FormControl>
<FormControl isRequired>
<FormLabel color={textColor}>Description</FormLabel>
<Textarea
name="description"
value={formData.description}
onChange={handleChange}
placeholder="Product description"
/>
</FormControl>
<FormControl isRequired>
<FormLabel color={textColor}>Image URL</FormLabel>
<Input
name="image"
value={formData.image}
onChange={handleChange}
placeholder="Product image URL"
/>
</FormControl>
</VStack>
</ModalBody>
<ModalFooter>
<Button variant="ghost" mr={3} onClick={onClose}>
Cancel
</Button>
<Button colorScheme="teal" type="submit">
Create Product
</Button>
</ModalFooter>
</form>
</ModalContent>
</Modal>
);
}

export default ProductCreateModal;
Loading