- Timestamp:
- 10/25/22 11:03:34 (2 years ago)
- Branches:
- master
- Children:
- a2e5735
- Parents:
- 55ed171
- Location:
- frontend
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/App.js
r55ed171 r113029b 50 50 <Route path="/profile" element={<ProfileScreen />} /> 51 51 <Route path="/order/:id" element={<OrderScreen />} /> 52 <Route path="/products" element={<CategoryScreen />} /> 52 <Route 53 path="/products/:category/:subCategory" 54 element={<CategoryScreen />} 55 /> 53 56 <Route path="/admin/dashboard" element={<AdminDashboardScreen />} /> 54 57 <Route path="/admin/addProduct" element={<AdminAddProductScreen />} /> -
frontend/src/components/Header.js
r55ed171 r113029b 23 23 import { useContext } from "react"; 24 24 import NavDropdown from "react-bootstrap/NavDropdown"; 25 import { height } from "@mui/system"; 25 26 26 27 const toggleMenu = (event) => { … … 133 134 </div> 134 135 <ul> 135 <li>Аголни гарнитури</li> 136 <li>Софи</li> 137 <li>Фотелји</li> 138 <li>Табуретки</li> 139 <li>Клуб Маси</li> 140 <li>ТВ комоди</li> 141 <li>Комоди</li> 136 <li> 137 <Link 138 to="/products/dnevna/agolni-garnituri" 139 style={{ 140 textDecoration: "none", 141 color: "black", 142 width: "100%", 143 height: "100%", 144 display: "flex", 145 justifyContent: "center", 146 alignItems: "center", 147 }} 148 > 149 Аголни гарнитури 150 </Link> 151 </li> 152 <li> 153 <Link 154 to="/products/dnevna/sofi" 155 style={{ 156 textDecoration: "none", 157 color: "black", 158 width: "100%", 159 height: "100%", 160 display: "flex", 161 justifyContent: "center", 162 alignItems: "center", 163 }} 164 > 165 Софи 166 </Link> 167 </li> 168 <li> 169 <Link 170 to="/products/dnevna/fotelji" 171 style={{ 172 textDecoration: "none", 173 color: "black", 174 width: "100%", 175 height: "100%", 176 display: "flex", 177 justifyContent: "center", 178 alignItems: "center", 179 }} 180 > 181 Фотелји 182 </Link> 183 </li> 184 <li> 185 <Link 186 to="/products/dnevna/taburetki" 187 style={{ 188 textDecoration: "none", 189 color: "black", 190 width: "100%", 191 height: "100%", 192 display: "flex", 193 justifyContent: "center", 194 alignItems: "center", 195 }} 196 > 197 Табуретки 198 </Link> 199 </li> 200 <li> 201 <Link 202 to="/products/dnevna/klub-masi" 203 style={{ 204 textDecoration: "none", 205 color: "black", 206 width: "100%", 207 height: "100%", 208 display: "flex", 209 justifyContent: "center", 210 alignItems: "center", 211 }} 212 > 213 Клуб Маси 214 </Link> 215 </li> 216 <li> 217 <Link 218 to="/products/dnevna/tv-komodi" 219 style={{ 220 textDecoration: "none", 221 color: "black", 222 width: "100%", 223 height: "100%", 224 display: "flex", 225 justifyContent: "center", 226 alignItems: "center", 227 }} 228 > 229 ТВ Комоди 230 </Link> 231 </li> 232 <li> 233 <Link 234 to="/products/dnevna/komodi" 235 style={{ 236 textDecoration: "none", 237 color: "black", 238 width: "100%", 239 height: "100%", 240 display: "flex", 241 justifyContent: "center", 242 alignItems: "center", 243 }} 244 > 245 Комоди 246 </Link> 247 </li> 142 248 </ul> 143 249 </div> … … 157 263 </div> 158 264 <ul> 159 <li>Шкафови за чевли</li> 160 <li>Закачалки и огледала</li> 161 <li>Колекции за ходник</li> 265 <li> 266 <Link 267 to="/products/hodnik/skafovi-za-cevli" 268 style={{ 269 textDecoration: "none", 270 color: "black", 271 width: "100%", 272 height: "100%", 273 display: "flex", 274 justifyContent: "center", 275 alignItems: "center", 276 }} 277 > 278 Шкафови за чевли 279 </Link> 280 </li> 281 <li> 282 <Link 283 to="/products/hodnik/zakacalki-i-ogledala" 284 style={{ 285 textDecoration: "none", 286 color: "black", 287 width: "100%", 288 height: "100%", 289 display: "flex", 290 justifyContent: "center", 291 alignItems: "center", 292 }} 293 > 294 Закачалки и огледала 295 </Link> 296 </li> 297 <li> 298 <Link 299 to="/products/hodnik/kolekcii-za-hodnik" 300 style={{ 301 textDecoration: "none", 302 color: "black", 303 width: "100%", 304 height: "100%", 305 display: "flex", 306 justifyContent: "center", 307 alignItems: "center", 308 }} 309 > 310 Колекции за ходник 311 </Link> 312 </li> 162 313 </ul> 163 314 </div> … … 177 328 </div> 178 329 <ul> 179 <li>Кујнски аголни гарнитури</li> 180 <li>Стандардни кујни</li> 330 <li> 331 <Link 332 to="/products/kujna/kujnski-agolni-garnituri" 333 style={{ 334 textDecoration: "none", 335 color: "black", 336 width: "100%", 337 height: "100%", 338 display: "flex", 339 justifyContent: "center", 340 alignItems: "center", 341 }} 342 > 343 Кујнски аголни гарнитури 344 </Link> 345 </li> 346 <li> 347 <Link 348 to="/products/kujna/standarni-kujni" 349 style={{ 350 textDecoration: "none", 351 color: "black", 352 width: "100%", 353 height: "100%", 354 display: "flex", 355 justifyContent: "center", 356 alignItems: "center", 357 }} 358 > 359 Стандардни кујни 360 </Link> 361 </li> 181 362 </ul> 182 363 </div> … … 196 377 </div> 197 378 <ul> 198 <li>Спални комплети</li> 199 <li>Лежаи</li> 200 <li>Кревети</li> 201 <li>Плакари</li> 202 <li>Ноќни шкафчиња</li> 203 <li>Тоалетни маси</li> 379 <li> 380 <Link 381 to="/products/spalna/spalni-kompleti" 382 style={{ 383 textDecoration: "none", 384 color: "black", 385 width: "100%", 386 height: "100%", 387 display: "flex", 388 justifyContent: "center", 389 alignItems: "center", 390 }} 391 > 392 Спални комплети 393 </Link> 394 </li> 395 396 <li> 397 <Link 398 to="/products/spalna/lezai" 399 style={{ 400 textDecoration: "none", 401 color: "black", 402 width: "100%", 403 height: "100%", 404 display: "flex", 405 justifyContent: "center", 406 alignItems: "center", 407 }} 408 > 409 Лежаи 410 </Link> 411 </li> 412 413 <li> 414 <Link 415 to="/products/spalna/kreveti" 416 style={{ 417 textDecoration: "none", 418 color: "black", 419 width: "100%", 420 height: "100%", 421 display: "flex", 422 justifyContent: "center", 423 alignItems: "center", 424 }} 425 > 426 Кревети 427 </Link> 428 </li> 429 430 <li> 431 <Link 432 to="/products/spalna/plakari" 433 style={{ 434 textDecoration: "none", 435 color: "black", 436 width: "100%", 437 height: "100%", 438 display: "flex", 439 justifyContent: "center", 440 alignItems: "center", 441 }} 442 > 443 Плакари 444 </Link> 445 </li> 446 <li> 447 <Link 448 to="/products/spalna/nokni-skafcinja" 449 style={{ 450 textDecoration: "none", 451 color: "black", 452 width: "100%", 453 height: "100%", 454 display: "flex", 455 justifyContent: "center", 456 alignItems: "center", 457 }} 458 > 459 Ноќни шкафчиња 460 </Link> 461 </li> 462 <li> 463 <Link 464 to="/products/spalna/toaletni-masi" 465 style={{ 466 textDecoration: "none", 467 color: "black", 468 width: "100%", 469 height: "100%", 470 display: "flex", 471 justifyContent: "center", 472 alignItems: "center", 473 }} 474 > 475 Тоалетни маси 476 </Link> 477 </li> 204 478 </ul> 205 479 </div> … … 219 493 </div> 220 494 <ul> 221 <li>Градинарски комплети</li> 222 <li>Градинарски лулки</li> 223 <li>Градинарски чадори</li> 224 <li>Градинарски маси</li> 225 <li>Градинарски столови</li> 226 <li>Градинарско осветлување</li> 495 <li> 496 <Link 497 to="/products/gradina/gradinarski-kompleti" 498 style={{ 499 textDecoration: "none", 500 color: "black", 501 width: "100%", 502 height: "100%", 503 display: "flex", 504 justifyContent: "center", 505 alignItems: "center", 506 }} 507 > 508 Градинарски комплети 509 </Link> 510 </li> 511 <li> 512 <Link 513 to="/products/gradina/gradinarski-lulki" 514 style={{ 515 textDecoration: "none", 516 color: "black", 517 width: "100%", 518 height: "100%", 519 display: "flex", 520 justifyContent: "center", 521 alignItems: "center", 522 }} 523 > 524 Градинарски лулки 525 </Link> 526 </li> 527 <li> 528 <Link 529 to="/products/gradina/gradinarski-cadori" 530 style={{ 531 textDecoration: "none", 532 color: "black", 533 width: "100%", 534 height: "100%", 535 display: "flex", 536 justifyContent: "center", 537 alignItems: "center", 538 }} 539 > 540 Градинарски чадори 541 </Link> 542 </li> 543 <li> 544 <Link 545 to="/products/gradina/gradinarski-masi" 546 style={{ 547 textDecoration: "none", 548 color: "black", 549 width: "100%", 550 height: "100%", 551 display: "flex", 552 justifyContent: "center", 553 alignItems: "center", 554 }} 555 > 556 Градинарски маси 557 </Link> 558 </li> 559 <li> 560 <Link 561 to="/products/gradina/gradinarski-stolovi" 562 style={{ 563 textDecoration: "none", 564 color: "black", 565 width: "100%", 566 height: "100%", 567 display: "flex", 568 justifyContent: "center", 569 alignItems: "center", 570 }} 571 > 572 Градинарски столови 573 </Link> 574 </li> 575 <li> 576 <Link 577 to="/products/gradina/gradinarsko-osvetluvanje" 578 style={{ 579 textDecoration: "none", 580 color: "black", 581 width: "100%", 582 height: "100%", 583 display: "flex", 584 justifyContent: "center", 585 alignItems: "center", 586 }} 587 > 588 Градинарско осветлување 589 </Link> 590 </li> 227 591 </ul> 228 592 </div> … … 242 606 </div> 243 607 <ul> 244 <li>Бироа</li> 245 <li>Канцелариски столови</li> 246 <li>Гејмерски столови</li> 247 <li>Канцелариски шкафови</li> 608 <li> 609 <Link 610 to="/products/kancelarija/biroa" 611 style={{ 612 textDecoration: "none", 613 color: "black", 614 width: "100%", 615 height: "100%", 616 display: "flex", 617 justifyContent: "center", 618 alignItems: "center", 619 }} 620 > 621 Бироа 622 </Link> 623 </li> 624 <li> 625 <Link 626 to="/products/kancelarija/kancelariski-stolovi" 627 style={{ 628 textDecoration: "none", 629 color: "black", 630 width: "100%", 631 height: "100%", 632 display: "flex", 633 justifyContent: "center", 634 alignItems: "center", 635 }} 636 > 637 Канцелариски столови 638 </Link> 639 </li> 640 <li> 641 <Link 642 to="/products/kancelarija/gejmerski-stolovi" 643 style={{ 644 textDecoration: "none", 645 color: "black", 646 width: "100%", 647 height: "100%", 648 display: "flex", 649 justifyContent: "center", 650 alignItems: "center", 651 }} 652 > 653 Гејмерски столови 654 </Link> 655 </li> 656 <li> 657 <Link 658 to="/products/kancelarija/kancelariski-skafovi" 659 style={{ 660 textDecoration: "none", 661 color: "black", 662 width: "100%", 663 height: "100%", 664 display: "flex", 665 justifyContent: "center", 666 alignItems: "center", 667 }} 668 > 669 Канцелариски шкафови 670 </Link> 671 </li> 248 672 </ul> 249 673 </div> … … 263 687 </div> 264 688 <ul> 265 <li>Трпезариски маси</li> 266 <li>Трпезариски столови</li> 267 <li>Кујнски гарнитури</li> 268 <li>Бар столови и маси</li> 689 <li> 690 <Link 691 to="/products/trpezarija/trpezariski-masi" 692 style={{ 693 textDecoration: "none", 694 color: "black", 695 width: "100%", 696 height: "100%", 697 display: "flex", 698 justifyContent: "center", 699 alignItems: "center", 700 }} 701 > 702 Трпезариски маси 703 </Link> 704 </li> 705 <li> 706 <Link 707 to="/products/trpezarija/trpezariski-stolovi" 708 style={{ 709 textDecoration: "none", 710 color: "black", 711 width: "100%", 712 height: "100%", 713 display: "flex", 714 justifyContent: "center", 715 alignItems: "center", 716 }} 717 > 718 Трпезариски столови 719 </Link> 720 </li> 721 <li> 722 <Link 723 to="/products/trpezarija/kujnski-garnituri" 724 style={{ 725 textDecoration: "none", 726 color: "black", 727 width: "100%", 728 height: "100%", 729 display: "flex", 730 justifyContent: "center", 731 alignItems: "center", 732 }} 733 > 734 Кујнски гарнитури 735 </Link> 736 </li> 737 <li> 738 <Link 739 to="/products/trpezarija/bar-stolovi-i-masi" 740 style={{ 741 textDecoration: "none", 742 color: "black", 743 width: "100%", 744 height: "100%", 745 display: "flex", 746 justifyContent: "center", 747 alignItems: "center", 748 }} 749 > 750 Бар столови и маси 751 </Link> 752 </li> 269 753 </ul> 270 754 </div> … … 284 768 </div> 285 769 <ul> 286 <li>Колекции за детска соба</li> 287 <li>Детски бироа</li> 288 <li>Лежаи</li> 770 <li> 771 <Link 772 to="/products/detska/kolekcii-za-detska-soba" 773 style={{ 774 textDecoration: "none", 775 color: "black", 776 width: "100%", 777 height: "100%", 778 display: "flex", 779 justifyContent: "center", 780 alignItems: "center", 781 }} 782 > 783 Колекции за детска соба 784 </Link> 785 </li> 786 <li> 787 <Link 788 to="/products/detska/detski-biroa" 789 style={{ 790 textDecoration: "none", 791 color: "black", 792 width: "100%", 793 height: "100%", 794 display: "flex", 795 justifyContent: "center", 796 alignItems: "center", 797 }} 798 > 799 Детски бироа 800 </Link> 801 </li> 802 <li> 803 <Link 804 to="/products/detska/detski-lezai" 805 style={{ 806 textDecoration: "none", 807 color: "black", 808 width: "100%", 809 height: "100%", 810 display: "flex", 811 justifyContent: "center", 812 alignItems: "center", 813 }} 814 > 815 Лежаи 816 </Link> 817 </li> 289 818 </ul> 290 819 </div> … … 312 841 <ul> 313 842 <li> 314 < a href="#">843 <Link to="/products/dnevna/all"> 315 844 <span> 316 845 <WeekendIcon /> Дневна 317 846 </span> 318 </ a>847 </Link> 319 848 <ul> 320 849 <li> 321 <a href="#">Аголни гарнитури</a> 322 </li> 323 <li> 324 <a href="#">Софи</a> 325 </li> 326 <li> 327 <a href="#">Фотелји</a> 328 </li> 329 <li> 330 <a href="#">Табуретки</a> 331 </li> 332 <li> 333 <a href="#">Клуб Маси</a> 334 </li> 335 <li> 336 <a href="#">ТВ Комоди</a> 337 </li> 338 <li> 339 <a href="#">Комоди</a> 850 <Link to="/products/dnevna/agolni-garnituri"> 851 Аголни гарнитури 852 </Link> 853 </li> 854 <li> 855 <Link to="/products/dnevna/sofi">Софи</Link> 856 </li> 857 <li> 858 <Link to="/products/dnevna/fotelji">Фотелји</Link> 859 </li> 860 <li> 861 <Link to="/products/dnevna/taburetki">Табуретки</Link> 862 </li> 863 <li> 864 <Link to="/products/dnevna/klub-masi">Клуб Маси</Link> 865 </li> 866 <li> 867 <Link to="/products/dnevna/tv-komodi">ТВ Комоди</Link> 868 </li> 869 <li> 870 <Link to="/products/dnevna/komodi">Комоди</Link> 340 871 </li> 341 872 </ul> 342 873 </li> 343 874 <li> 344 < a href="#">875 <Link to="/products/hodnik/all"> 345 876 <span> 346 877 <MeetingRoomIcon /> 347 878 Ходник 348 879 </span> 349 </ a>880 </Link> 350 881 <ul> 351 882 <li> 352 <a href="#">Шкафови за чевли</a> 353 </li> 354 <li> 355 <a href="#">Закачалки и огледала</a> 356 </li> 357 <li> 358 <a href="#">Колекции за ходник</a> 883 <Link to="/products/hodnik/skafovi-za-cevli"> 884 Шкафови за чевли 885 </Link> 886 </li> 887 <li> 888 <Link to="/products/hodnik/zakacalki-i-ogledala"> 889 Закачалки и огледала 890 </Link> 891 </li> 892 <li> 893 <Link to="/products/hodnik/kolekcii-za-hodnik"> 894 Колекции за ходник 895 </Link> 359 896 </li> 360 897 </ul> 361 898 </li> 362 899 <li> 363 < a href="#">900 <Link to="/products/kujna/all"> 364 901 <span> 365 902 <KitchenIcon /> 366 903 Кујна 367 904 </span> 368 </ a>905 </Link> 369 906 <ul> 370 907 <li> 371 <a href="#">Кујнски аголни гарнитури</a> 372 </li> 373 <li> 374 <a href="#">Стандардни кујни</a> 908 <Link to="/products/kujna/kujnski-agolni-garnituri"> 909 Кујнски аголни гарнитури 910 </Link> 911 </li> 912 <li> 913 <Link to="/products/kujna/standarni-kujni"> 914 Стандардни кујни 915 </Link> 375 916 </li> 376 917 </ul> … … 381 922 <ul> 382 923 <li> 383 < a href="#">924 <Link to="/products/spalna/all"> 384 925 <span> 385 926 <BedIcon /> 386 927 Спална 387 928 </span> 388 </ a>929 </Link> 389 930 <ul> 390 931 <li> 391 <a href="#">Спални комплети</a> 392 </li> 393 394 <li> 395 <a href="#">Лежаи</a> 396 </li> 397 398 <li> 399 <a href="#">Кревети</a> 400 </li> 401 402 <li> 403 <a href="#">Плакари</a> 404 </li> 405 <li> 406 <a href="#">Ноќни шкафчиња</a> 407 </li> 408 <li> 409 <a href="#">Тоалетни маси</a> 932 <Link to="/products/spalna/spalni-kompleti"> 933 Спални комплети 934 </Link> 935 </li> 936 937 <li> 938 <Link to="/products/spalna/lezai">Лежаи</Link> 939 </li> 940 941 <li> 942 <Link to="/products/spalna/kreveti">Кревети</Link> 943 </li> 944 945 <li> 946 <Link to="/products/spalna/plakari">Плакари</Link> 947 </li> 948 <li> 949 <Link to="/products/spalna/nokni-skafcinja"> 950 Ноќни шкафчиња 951 </Link> 952 </li> 953 <li> 954 <Link to="/products/spalna/toaletni-masi"> 955 Тоалетни маси 956 </Link> 410 957 </li> 411 958 </ul> 412 959 </li> 413 960 <li> 414 < a href="#">961 <Link to="/products/gradina/all"> 415 962 <span> 416 963 <DeckIcon /> 417 964 Мебел за градина 418 965 </span> 419 </ a>966 </Link> 420 967 <ul> 421 968 <li> 422 <a href="#">Градинарски комплети</a> 423 </li> 424 <li> 425 <a href="#">Градинарски лулки</a> 426 </li> 427 <li> 428 <a href="#">Градинарски чадори</a> 429 </li> 430 <li> 431 <a href="#">Градинарски маси</a> 432 </li> 433 <li> 434 <a href="#">Градинарски столови</a> 435 </li> 436 <li> 437 <a href="#">Градинарско осветлување</a> 969 <Link to="/products/gradina/gradinarski-kompleti"> 970 Градинарски комплети 971 </Link> 972 </li> 973 <li> 974 <Link to="/products/gradina/gradinarski-lulki"> 975 Градинарски лулки 976 </Link> 977 </li> 978 <li> 979 <Link to="/products/gradina/gradinarski-cadori"> 980 Градинарски чадори 981 </Link> 982 </li> 983 <li> 984 <Link to="/products/gradina/gradinarski-masi"> 985 Градинарски маси 986 </Link> 987 </li> 988 <li> 989 <Link to="/products/gradina/gradinarski-stolovi"> 990 Градинарски столови 991 </Link> 992 </li> 993 <li> 994 <Link to="/products/gradina/gradinarsko-osvetluvanje"> 995 Градинарско осветлување 996 </Link> 438 997 </li> 439 998 </ul> … … 444 1003 <ul> 445 1004 <li> 446 < a href="#">1005 <Link to="/products/kancelarija/all"> 447 1006 <span> 448 1007 <ChairAltIcon /> 449 1008 Канцеларија 450 1009 </span> 451 </ a>1010 </Link> 452 1011 <ul> 453 1012 <li> 454 <a href="#">Бироа</a> 455 </li> 456 <li> 457 <a href="#">Канцелариски столови</a> 458 </li> 459 <li> 460 <a href="#">Гејмерски столови</a> 461 </li> 462 <li> 463 <a href="#">Канцелариски шкафови</a> 1013 <Link to="/products/kancelarija/biroa">Бироа</Link> 1014 </li> 1015 <li> 1016 <Link to="/products/kancelarija/kancelariski-stolovi"> 1017 Канцелариски столови 1018 </Link> 1019 </li> 1020 <li> 1021 <Link to="/products/kancelarija/gejmerski-stolovi"> 1022 Гејмерски столови 1023 </Link> 1024 </li> 1025 <li> 1026 <Link to="/products/kancelarija/kancelariski-skafovi"> 1027 Канцелариски шкафови 1028 </Link> 464 1029 </li> 465 1030 </ul> 466 1031 </li> 467 1032 <li> 468 < a href="#">1033 <Link to="/products/trpezarija/all"> 469 1034 <span> 470 1035 <TableRestaurantIcon /> 471 1036 Трпезарија 472 1037 </span> 473 </ a>1038 </Link> 474 1039 <ul> 475 1040 <li> 476 <a href="#">Трпезариски маси</a> 477 </li> 478 <li> 479 <a href="#">Трпезариски столови</a> 480 </li> 481 <li> 482 <a href="#">Кујнски гарнитури</a> 483 </li> 484 <li> 485 <a href="#">Бар столови и маси</a> 1041 <Link to="/products/trpezarija/trpezariski-masi"> 1042 Трпезариски маси 1043 </Link> 1044 </li> 1045 <li> 1046 <Link to="/products/trpezarija/trpezariski-stolovi"> 1047 Трпезариски столови 1048 </Link> 1049 </li> 1050 <li> 1051 <Link to="/products/trpezarija/kujnski-garnituri"> 1052 Кујнски гарнитури 1053 </Link> 1054 </li> 1055 <li> 1056 <Link to="/products/trpezarija/bar-stolovi-i-masi"> 1057 Бар столови и маси 1058 </Link> 486 1059 </li> 487 1060 </ul> 488 1061 </li> 489 1062 <li> 490 < a href="#">1063 <Link to="/products/detska/all"> 491 1064 <span> 492 1065 <BedroomChildIcon /> 493 1066 Детска соба 494 1067 </span> 495 </ a>1068 </Link> 496 1069 <ul> 497 1070 <li> 498 <a href="#">Колекции за детска соба</a> 499 </li> 500 <li> 501 <a href="#">Детски бироа</a> 502 </li> 503 <li> 504 <a href="#">Лежаи</a> 1071 <Link to="/products/detska/kolekcii-za-detska-soba"> 1072 Колекции за детска соба 1073 </Link> 1074 </li> 1075 <li> 1076 <Link to="/products/detska/detski-biroa"> 1077 Детски бироа 1078 </Link> 1079 </li> 1080 <li> 1081 <Link to="/products/detska/detski-lezai">Лежаи</Link> 505 1082 </li> 506 1083 </ul> -
frontend/src/components/Product.js
r55ed171 r113029b 4 4 import { Link } from "react-router-dom"; 5 5 import { Store } from "../Store"; 6 import CheckIcon from "@mui/icons-material/Check"; 7 import ClearIcon from "@mui/icons-material/Clear"; 6 8 7 9 function Product({ product }) { … … 14 16 }; 15 17 return ( 16 <div className="product__container"> 18 <div 19 className="product__container" 20 style={{ marginLeft: "5px", marginRight: "5px", marginTop: "10px" }} 21 > 17 22 <Link to={`/product/${product.slug}`} style={{ height: "165.91px" }}> 18 23 <div className="product__img" style={{ height: "100%" }}> … … 24 29 </div> 25 30 </Link> 26 <div className="product__textContainer"> 27 <Link to={`/product/${product.slug}`}> 31 <div 32 className="product__textContainer" 33 style={{ 34 display: "flex", 35 justifyContent: "space-evenly", 36 alignItems: "center", 37 marginLeft: "25px", 38 }} 39 > 40 <Link 41 to={`/product/${product.slug}`} 42 style={{ textDecoration: "none", color: "black" }} 43 > 28 44 <div className="product__name"> 29 45 <h3>{product.name}</h3> … … 31 47 </Link> 32 48 <div className="product__price"> 33 <h5>{product.price}ден</h5> 49 <h3 style={{ textDecoration: "none", color: "black" }}> 50 {product.price}ден 51 </h3> 34 52 </div> 35 53 </div> 36 <div className="product__addToCart"> 54 <div 55 style={{ 56 width: "100%", 57 display: "flex", 58 justifyContent: "center", 59 alignItems: "center", 60 }} 61 > 62 {product.countInStock > 0 ? ( 63 <span style={{ color: "green" }}> 64 <CheckIcon></CheckIcon>Залиха 65 </span> 66 ) : ( 67 <span style={{ color: "red" }}> 68 <ClearIcon></ClearIcon>Залиха 69 </span> 70 )} 71 </div> 72 <div className="product__addToCart" style={{ marginTop: "15px" }}> 37 73 <button onClick={addToCartHandler}> 38 74 <ShoppingBasketIcon /> -
frontend/src/screens/CardPaymentScreen.js
r55ed171 r113029b 155 155 </Form.Select> 156 156 <Form.Select style={{ width: "47%", margin: "auto" }}> 157 <option value="01">22</option>158 157 <option value="02">23</option> 159 158 <option value="03">24</option> -
frontend/src/screens/CategoryScreen.js
r55ed171 r113029b 1 import React, { useEffect, useReducer , useState} from "react";1 import React, { useEffect, useReducer } from "react"; 2 2 import "../styles/Home.css"; 3 3 // import data from "./data"; … … 5 5 import axios from "axios"; 6 6 import { Helmet } from "react-helmet-async"; 7 import { getError } from "../components/utils"; 8 import { useLocation, useNavigate, useParams } from "react-router-dom"; 9 import Form from "react-bootstrap/Form"; 10 import Button from "react-bootstrap/Button"; 11 import LinkContainer from "react-router-bootstrap/LinkContainer"; 7 12 8 13 const reducer = (state, action) => { … … 11 16 return { ...state, loading: true }; 12 17 case "FETCH_SUCCESS": 13 return { ...state, products: action.payload, loading: false }; 18 return { 19 ...state, 20 products: action.payload.products, 21 page: action.payload.page, 22 pages: action.payload.pages, 23 countProducts: action.payload.countProducts, 24 loading: false, 25 }; 14 26 case "FETCH_FAIL": 15 27 return { ...state, loading: false, error: action.payload }; … … 20 32 21 33 function Home() { 22 const [{ loading, error, products }, dispatch] = useReducer(reducer, { 23 products: [], 24 loading: true, 25 error: "", 26 }); 27 //const [products, setProducts] = useState([]); 34 const params = useParams(); 35 const { category, subCategory } = params; 36 const navigate = useNavigate(); 37 const { search } = useLocation(); 38 const sp = new URLSearchParams(search); 39 //const category = sp.get("category") || "all"; 40 const query = sp.get("query") || "all"; 41 //const subCategory = sp.get("subCategory") || "all"; 42 //const name = sp.get("name") || "all"; 43 const order = sp.get("order") || "newest"; 44 const page = sp.get("page") || 1; 45 46 const [{ loading, error, products, pages, countProducts }, dispatch] = 47 useReducer(reducer, { loading: true, error: "" }); 48 28 49 useEffect(() => { 29 50 const fetchData = async () => { 30 dispatch({ type: "FETCH_REQUEST" });31 51 try { 32 const result = await axios.get("/api/products"); 33 dispatch({ type: "FETCH_SUCCESS", payload: result.data }); 52 dispatch({ type: "FETCH_REQUEST" }); 53 /* 54 const { data } = await axios.get( 55 `/api/products/search?page=${page}&query=${query}&category=${category}&subCategory=${subCategory}&order=${order}` 56 );*/ 57 const { data } = await axios.get( 58 `/api/products?page=${page}&query=${query}&category=${category}&subCategory=${subCategory}&order=${order}` 59 ); 60 dispatch({ type: "FETCH_SUCCESS", payload: data }); 34 61 } catch (err) { 35 dispatch({ type: "FETCH_FAIL", payload: err.message});62 dispatch({ type: "FETCH_FAIL", payload: getError(err) }); 36 63 } 37 38 //setProducts(result.data);39 64 }; 40 65 fetchData(); 41 }, []); 66 }, [category, page, query, order, subCategory, error]); 67 68 const getFilterUrl = (filter) => { 69 const filterPage = filter.page || page; 70 const filterCategorry = filter.category || category; 71 const filterQuery = filter.query || query; 72 const filterSubCategory = filter.subCategory || subCategory; 73 const sortOrder = filter.order || order; 74 return `?category=${filterCategorry}&query=${filterQuery}&subCategory=${filterSubCategory}&page=${filterPage}&order=${sortOrder}`; 75 }; 42 76 43 77 return ( 44 <div >78 <div style={{ width: "100%" }}> 45 79 <Helmet> 46 80 <title>MebelCity</title> … … 53 87 <div>{error}</div> 54 88 ) : ( 55 products.map((product) => ( 56 <Product key={product.slug} product={product} /> 57 )) 89 <div style={{ width: "100%" }}> 90 {category === "kancelarija" ? ( 91 <h1 style={{ textAlign: "center", marginTop: "10px" }}> 92 Канцеларија 93 </h1> 94 ) : category === "dnevna" ? ( 95 <h1 style={{ textAlign: "center", marginTop: "10px" }}>Дневна</h1> 96 ) : category === "spalna" ? ( 97 <h1 style={{ textAlign: "center", marginTop: "10px" }}>Спална</h1> 98 ) : category === "hodnik" ? ( 99 <h1 style={{ textAlign: "center", marginTop: "10px" }}>Ходник</h1> 100 ) : category === "kujna" ? ( 101 <h1 style={{ textAlign: "center", marginTop: "10px" }}>Кујна</h1> 102 ) : category === "gradina" ? ( 103 <h1 style={{ textAlign: "center", marginTop: "10px" }}> 104 Градина 105 </h1> 106 ) : category === "trpezarija" ? ( 107 <h1 style={{ textAlign: "center", marginTop: "10px" }}> 108 Трпезарија 109 </h1> 110 ) : ( 111 <h1 style={{ textAlign: "center", marginTop: "10px" }}> 112 Детска соба 113 </h1> 114 )} 115 116 <div 117 style={{ 118 width: "100%", 119 display: "flex", 120 justifyContent: "space-evenly", 121 alignItems: "center", 122 marginTop: "20px", 123 }} 124 > 125 <Form 126 style={{ 127 width: "100%", 128 display: "flex", 129 justifyContent: "end", 130 marginRight: "40px", 131 alignItems: "center", 132 }} 133 > 134 {/*} 135 <Form.Group> 136 <Form.Select 137 value={subCategory} 138 onChange={(e) => { 139 navigate( 140 getFilterUrl({ subCategory: e.target.value, page: 1 }) 141 ); 142 }} 143 > 144 <option value="all">Подкатегорија</option> 145 146 {category === "dnevna" && ( 147 <option value="agolni-garnituri">Аголни Гарнитури</option> 148 )} 149 {category === "dnevna" && ( 150 <option value="sofi">Софи</option> 151 )} 152 {category === "dnevna" && ( 153 <option value="fotelji">Фотелји</option> 154 )} 155 {category === "dnevna" && ( 156 <option value="taburetki">Табуретки</option> 157 )} 158 {category === "dnevna" && ( 159 <option value="klub-masi">Клуб маси</option> 160 )} 161 {category === "dnevna" && ( 162 <option value="tv-komodi">ТВ комоди</option> 163 )} 164 {category === "dnevna" && ( 165 <option value="komodi">Комоди</option> 166 )} 167 {category === "spalna" && ( 168 <option value="spalni-kompleti">Спални Комплети</option> 169 )} 170 {category === "spalna" && ( 171 <option value="lezai">Лежаи</option> 172 )} 173 {category === "spalna" && ( 174 <option value="kreveti">Кревети</option> 175 )} 176 {category === "spalna" && ( 177 <option value="plakari">Плакари</option> 178 )} 179 {category === "spalna" && ( 180 <option value="nokni-skafcinja">Ноќни шкафчиња</option> 181 )} 182 {category === "spalna" && ( 183 <option value="toaletni-masi">Тоалетни маси</option> 184 )} 185 {category === "kancelarija" && ( 186 <option value="biroa">Бироа</option> 187 )} 188 {category === "kancelarija" && ( 189 <option value="kancelariski-stolovi"> 190 Канцелариски столови 191 </option> 192 )} 193 {category === "kancelarija" && ( 194 <option value="gejmerski-stolovi"> 195 Гејмерски столови 196 </option> 197 )} 198 {category === "kancelarija" && ( 199 <option value="kancelariski-skafovi"> 200 Канцелариски шкафови 201 </option> 202 )} 203 {category === "hodnik" && ( 204 <option value="skafovi-za-cevli">Шкафови за чевли</option> 205 )} 206 {category === "hodnik" && ( 207 <option value="zakacalki-i-ogledala"> 208 Закачалки и огледала 209 </option> 210 )} 211 {category === "hodnik" && ( 212 <option value="kolekcii-za-hodnik"> 213 Колекции за ходник 214 </option> 215 )} 216 {category === "gradina" && ( 217 <option value="gradinarski-kompleti"> 218 Градинарски комплети 219 </option> 220 )} 221 {category === "gradina" && ( 222 <option value="gradinarski-lulki"> 223 Градинарски лулки 224 </option> 225 )} 226 {category === "gradina" && ( 227 <option value="gradinarski-cadori"> 228 Градинарски чадори 229 </option> 230 )} 231 {category === "gradina" && ( 232 <option value="gradinarski-masi">Градинарски маси</option> 233 )} 234 {category === "gradina" && ( 235 <option value="gradinarski-stolovi"> 236 Градинарски столови 237 </option> 238 )} 239 {category === "gradina" && ( 240 <option value="gradinarsko-osvetluvanje"> 241 Градинарско осветлување 242 </option> 243 )} 244 {category === "trpezarija" && ( 245 <option value="trpezariski-masi">Трпезариски маси</option> 246 )} 247 {category === "trpezarija" && ( 248 <option value="trpezariski-stolovi"> 249 Трпезариски столови 250 </option> 251 )} 252 {category === "trpezarija" && ( 253 <option value="kujnski-garnituri"> 254 Кујнски гарнитури 255 </option> 256 )} 257 {category === "trpezarija" && ( 258 <option value="bar-stolovi-i-masi"> 259 Бар столови и маси 260 </option> 261 )} 262 {category === "kujna" && ( 263 <option value="kujnski-agolni-garnituri"> 264 Кујнски аголни гарнитури 265 </option> 266 )} 267 {category === "kujna" && ( 268 <option value="standardni-kujni">Стандардни кујни</option> 269 )} 270 {category === "detska" && ( 271 <option value="kolekcii-za-detska-soba"> 272 Колекции за детска соба 273 </option> 274 )} 275 {category === "detska" && ( 276 <option value="detski-biroa">Детски бироа</option> 277 )} 278 {category === "detska" && ( 279 <option value="detski-lezai">Детски лежаи</option> 280 )} 281 </Form.Select> 282 </Form.Group>*/} 283 <Form.Group> 284 <Form.Select 285 id="sortOrder" 286 onChange={(e) => { 287 navigate(getFilterUrl({ order: e.target.value })); 288 }} 289 > 290 <option value={"newest"}>Сортирај по цена</option> 291 <option value={"lowFirst"}>Од ниска кон висока</option> 292 <option value={"highFirst"}>Од висока кон ниска</option> 293 </Form.Select> 294 </Form.Group> 295 </Form> 296 </div> 297 <div 298 style={{ 299 display: "flex", 300 flexWrap: "wrap", 301 justifyContent: "space-evenly", 302 alignItems: "center", 303 marginTop: "10px", 304 }} 305 > 306 {products.map((product) => ( 307 <Product key={product.slug} product={product} /> 308 ))} 309 </div> 310 <div 311 style={{ 312 marginTop: "20px", 313 display: "flex", 314 justifyContent: "center", 315 alignItems: "center", 316 }} 317 > 318 {[...Array(pages).keys()].map((x) => ( 319 <LinkContainer 320 key={x + 1} 321 className="mx-1" 322 to={getFilterUrl({ page: x + 1 })} 323 > 324 <Button 325 className={Number(page) === x + 1 ? "text-bold" : ""} 326 variant={Number(page) === x + 1 ? "danger" : "light"} 327 > 328 {x + 1} 329 </Button> 330 </LinkContainer> 331 ))} 332 </div> 333 </div> 58 334 )} 59 335 </div> -
frontend/src/screens/Home.js
r55ed171 r113029b 14 14 import axios from "axios"; 15 15 import { Helmet } from "react-helmet-async"; 16 import { useNavigate } from "react-router-dom"; 16 17 17 18 const reducer = (state, action) => { … … 34 35 error: "", 35 36 }); 37 const navigate = useNavigate(); 36 38 //const [products, setProducts] = useState([]); 37 39 useEffect(() => { … … 148 150 </div> 149 151 <div className="grid-container"> 150 <div className="grid-item item1">Дневна</div> 152 <div 153 className="grid-item item1" 154 onClick={() => navigate("/products/dnevna/all")} 155 > 156 Дневна 157 </div> 151 158 <div className="grid-item item2">Ходник</div> 152 159 <div className="grid-item item3">Трпезарија</div> -
frontend/src/screens/HomeWithJumbo.js
r55ed171 r113029b 14 14 import { Helmet } from "react-helmet-async"; 15 15 import Jumbo from "../components/JumboSlider"; 16 import { useNavigate } from "react-router-dom"; 16 17 17 18 function Home() { 19 const navigate = useNavigate(); 18 20 const clearActive = () => { 19 21 let icon1 = document.getElementById("icon1"); … … 108 110 </div> 109 111 <div className="grid-container"> 110 <div className="grid-item item1">Дневна</div> 111 <div className="grid-item item2">Ходник</div> 112 <div className="grid-item item3">Трпезарија</div> 113 <div className="grid-item item4">Спална</div> 114 <div className="grid-item item5">Кујна</div> 115 <div className="grid-item item6">Канцеларија</div> 116 <div className="grid-item item7">Детска соба</div> 117 <div className="grid-item item8">Мебел за градина</div> 112 <div 113 className="grid-item item1" 114 onClick={() => navigate("/products/dnevna/all")} 115 > 116 Дневна 117 </div> 118 <div 119 className="grid-item item2" 120 onClick={() => navigate("/products/hodnik/all")} 121 > 122 Ходник 123 </div> 124 <div 125 className="grid-item item3" 126 onClick={() => navigate("/products/trpezarija/all")} 127 > 128 Трпезарија 129 </div> 130 <div 131 className="grid-item item4" 132 onClick={() => navigate("/products/spalna/all")} 133 > 134 Спална 135 </div> 136 <div 137 className="grid-item item5" 138 onClick={() => navigate("/products/kujna/all")} 139 > 140 Кујна 141 </div> 142 <div 143 className="grid-item item6" 144 onClick={() => navigate("/products/kancelarija/all")} 145 > 146 Канцеларија 147 </div> 148 <div 149 className="grid-item item7" 150 onClick={() => navigate("/products/detska/all")} 151 > 152 Детска соба 153 </div> 154 <div 155 className="grid-item item8" 156 onClick={() => navigate("/products/gradina/all")} 157 > 158 Мебел за градина 159 </div> 118 160 </div> 119 161 </div> -
frontend/src/styles/ProductScreen.css
r55ed171 r113029b 109 109 display: flex !important; 110 110 justify-content: center !important; 111 margin-top: 10px; 111 112 } 112 113
Note:
See TracChangeset
for help on using the changeset viewer.