From f13ba14ce05f6228f038d5f05ec78a4de1afa1f1 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Sun, 24 May 2020 18:53:03 +0530 Subject: [PATCH 1/7] folder structure updated many lint errors post ad form added minor css changes header removed from home page for now left out changes: - make a separate container inside app for all what was done -correct grid --- Timeline.md | 18 --- package-lock.json | 45 ++++++- public/images/bicycle.jfif | Bin 0 -> 9818 bytes public/images/book.jfif | Bin 0 -> 8764 bytes public/images/cycle.jfif | Bin 0 -> 6671 bytes public/images/laptop.jfif | Bin 0 -> 7385 bytes public/images/matteress.jfif | Bin 0 -> 4467 bytes public/images/mobile.jfif | Bin 0 -> 8610 bytes src/App.tsx | 16 ++- .../{ => CategoryCard}/CategoryCard.css | 0 .../{ => CategoryCard}/CategoryCard.tsx | 9 +- src/components/HeaderCard/HeaderCard.css | 25 ++++ .../{ => HeaderCard}/HeaderCard.tsx | 23 ++-- src/components/ItemCard.tsx | 19 --- src/components/ItemCard/ItemCard.tsx | 21 +++ src/components/ItemDetail/ItemDetail.tsx | 98 ++++++++++++++ src/components/ItemList/ItemList.tsx | 102 +++++++++++++++ src/components/PostAd/PostAd.css | 4 + src/components/PostAd/PostAd.tsx | 120 ++++++++++++++++++ .../{ => RegisterForm}/RegisterForm.css | 0 .../{ => RegisterForm}/RegisterForm.tsx | 2 - src/components/SearchBar.css | 3 - src/components/SearchBar/SearchBar.css | 4 + src/components/{ => SearchBar}/SearchBar.tsx | 3 +- src/pages/{ => Health}/Health.tsx | 0 src/pages/{ => categories}/categories.tsx | 10 +- src/pages/{ => chats}/chats.tsx | 10 +- src/pages/home.tsx | 58 --------- src/pages/{ => home}/home.css | 0 src/pages/home/home.tsx | 78 ++++++++++++ src/pages/myaccount.tsx | 41 ------ src/pages/{ => myaccount}/myaccount.css | 0 src/pages/myaccount/myaccount.tsx | 42 ++++++ 33 files changed, 563 insertions(+), 188 deletions(-) delete mode 100755 Timeline.md create mode 100644 public/images/bicycle.jfif create mode 100644 public/images/book.jfif create mode 100644 public/images/cycle.jfif create mode 100644 public/images/laptop.jfif create mode 100644 public/images/matteress.jfif create mode 100644 public/images/mobile.jfif rename src/components/{ => CategoryCard}/CategoryCard.css (100%) rename src/components/{ => CategoryCard}/CategoryCard.tsx (95%) create mode 100644 src/components/HeaderCard/HeaderCard.css rename src/components/{ => HeaderCard}/HeaderCard.tsx (54%) delete mode 100644 src/components/ItemCard.tsx create mode 100644 src/components/ItemCard/ItemCard.tsx create mode 100644 src/components/ItemDetail/ItemDetail.tsx create mode 100644 src/components/ItemList/ItemList.tsx create mode 100644 src/components/PostAd/PostAd.css create mode 100644 src/components/PostAd/PostAd.tsx rename src/components/{ => RegisterForm}/RegisterForm.css (100%) rename src/components/{ => RegisterForm}/RegisterForm.tsx (98%) delete mode 100644 src/components/SearchBar.css create mode 100644 src/components/SearchBar/SearchBar.css rename src/components/{ => SearchBar}/SearchBar.tsx (83%) rename src/pages/{ => Health}/Health.tsx (100%) rename src/pages/{ => categories}/categories.tsx (59%) rename src/pages/{ => chats}/chats.tsx (58%) delete mode 100644 src/pages/home.tsx rename src/pages/{ => home}/home.css (100%) create mode 100644 src/pages/home/home.tsx delete mode 100644 src/pages/myaccount.tsx rename src/pages/{ => myaccount}/myaccount.css (100%) create mode 100644 src/pages/myaccount/myaccount.tsx diff --git a/Timeline.md b/Timeline.md deleted file mode 100755 index d68e1de..0000000 --- a/Timeline.md +++ /dev/null @@ -1,18 +0,0 @@ -Proposed Project TimeLine -Starts : May 11, 2020 -Week 1: -Frontend - UI layout for Home Page, - UI layout for Login Page, - UI layout for Sign up Page -Week 2: -Frontend - UI layout for Category browsing, - UI layout for Item Detail Page, -Week 3: -Frontend - UI layout for Contact Page, - UI layout for Profile Page, - UI layout for Chats Page, - UI layout complete - diff --git a/package-lock.json b/package-lock.json index 7de2f67..5263932 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2925,6 +2925,15 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -5845,6 +5854,12 @@ "schema-utils": "^2.5.0" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "filesize": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.0.1.tgz", @@ -6648,9 +6663,9 @@ "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=" }, "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "requires": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -7425,7 +7440,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } } } }, @@ -8540,6 +8559,12 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "optional": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -13364,7 +13389,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", @@ -13670,7 +13699,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "get-caller-file": { "version": "1.0.3", diff --git a/public/images/bicycle.jfif b/public/images/bicycle.jfif new file mode 100644 index 0000000000000000000000000000000000000000..a676c9ff09dbf1772734994dd04413b7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0uKVlayU3|ES)1Oz0i{a%zoy0wo>Vz0MH(OM z^*;S>elM*UrNlpxTN%AaZulaS>zjk8;M2)Bw9$&C-^~Y|ifJYk5(Q{0+Fto3MSCpX z?wn3luZyZ~7;1#%D^;A^4CZ$~Y2Y(!y2|-nV9;a~b;{imsM!wj+Wx_8qxFlLY6L{+ zq>)50Dw;LZFI4ShjU`Awj5lCk6&>4kpT|8iw!N96jI_GmqqJel*7+%TaT51Q^b2+0 zpw1lqZvrKE(2aOOtMb#V;&`oGUb1y7|8X(tkV<7vvHEP+hK-Vnm$%Zo+v#lw-~0Ba z&y-Y+RgVe<4aOlo@es#9t6&J!A2kzvxVgTv6#d;q*5(^Vv{NaV0+elAwT_8{ne@fQ zWvFS+HXfX2*xmu?7bnsy3#^qnkV`60SCTcQKWLUvn1{0VwT4Nw^1L3N>=fR30o6UN z#)VgU5(c7bGL&=$!af!LY0{eQlQepPNAFyX)X}G!+zB1-;Yn@(UyAzwmOgK~mQ&#S z%5cI4`!uADc@UnbOz3J{ zR8_Fq77p3=;`Db4%S+Q}b*wavf3Tw#aJ!>Au5O~BZ!4Hvm(}8ef~#+-o`PykKLApK zV;wX>;LG}*u)2t8LORYELxuLk#H#N{|}e-fMUKP@RwtlEf1O_*c#USK0q>MR2$Je*h*Osb&BG literal 0 HcmV?d00001 diff --git a/public/images/cycle.jfif b/public/images/cycle.jfif new file mode 100644 index 0000000000000000000000000000000000000000..cb0d4c02386fe49e93fff073c48acfcff2507b76 GIT binary patch literal 6671 zcmbt&cTiK^*KR^+N(ZS45Spk!=%Ke)s(>gWO7BH_kuF^z2!x{aA|N&-^pa4dH|f0u zkWfM|QiAlWzx&Pi&3)(2{pYTI=Gn9NTJ!8RXYJW%pXYk|dJ#bTKwV2600aU6z&{Oe zjRm|0+#n@mpr>b~XJBArqGx1gV_{)o{`;^p{_WZR0_PnlC);f>3k#Ph7vEhWn6NMl zr?|AZpwt~9VFBRHn>VScsF`VL8HL!{*@c7zgoK2ICI7&GnShW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o1TTU@X>(@pRWO*5j00F)E-yQU|8QXu?YH^du9ij>XvlTOq}01IhieViKrc{T-Z=0 zzvOql@9H(V+*S|SB|T3*^n=ulYrm9miH3JF+~=_bq8!Ts0xd>Q|3_~p%j5v?t}~?> znTey?!_I&7Vd+=EL*lDv=gg>d#_SM2GK8Z^!Bq49GhK!NnutE&qx{M5$eHT2_fw34 zdDW58DmFtgS^csk)`1>s&G%bL^@V~3J7YkJw&(o20+xUF-W?h*v!}HB8$JdqY8vHq z)-V~!RFMkm>vXxCu|Lf(_4X4!_~7O>z`p0h6?uCIg)Krf((X+6=whPFdfA=NhgN^R z7;*PyeKGXo=;oJ*bnW88n`W?Lgov|a+!&=D#(*|BLYX{|KSEp7~z|uW=~= literal 0 HcmV?d00001 diff --git a/public/images/laptop.jfif b/public/images/laptop.jfif new file mode 100644 index 0000000000000000000000000000000000000000..60196464252d6fc96bb82f9630f3bcd5f18c0510 GIT binary patch literal 7385 zcmYLtXH=6-*Yy<$y$1*oh=e9J)KHY(tMnqF+;j;&bVQV*fHZ+%qzKYNF9rev0yj+% z5v3>{q)D%$AgJ*9eDC|Lch8!$_F4O^+2{P2`7u{BSIYpik)EL*00IF3=4W}XX7+J3#L`yoBEnQGRgAx*Nphv4AAtVT{DR#>$|4dsdJm1C%PjpO`ffWYmaQ zvW*x4hr>B;YSr8Vs~^gj90sKKoI@(>Q`z^(R;FqV^X-KqzC@|9_o6(re$hQ~%kF(- z?Ip~){yyn#FYx_vT6R6vtF9X@z(8W#)T`wbPG3wX~YkiV^P`>-TMlhfwKX8ZXcT=2_ff^Icl zrZDfr5bdZy(3(E1I&0@mj;CAd@iX;BH3xBHx!~_z<)&I6mMoNhbyiu063Q1Zh0-tF zlA}rW3up-R%nxsS1#Z&9bkUs`b|hsniq?Nc?z3MBv$ndabO5EG-M zE6s%|fV0Qj#BVcO#D!OY3JH~Jd#1|OXRVjUc4J@5R`#cA8CEw8nX}4Mi#u+*!GeVv zuYg^vbsnhqoEnGWjK4i2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X}K2^X8^}!J?l~dnh06N7&wwJA;BHm)Yu|N@fkBxyBF8#IPI_)Mj`dU_)v7Sy&9G%#5=nBh$s+RZC6#?<$LY!%W;kVxpEeyPO57o#iJ zF;+5rq2Lu*+rIkuODBo${+9WPx`&!|%xobk6erjHp7$5_exO)KjQ6XN%x7=TR5>{e zntkeS{Yn@R7eS%?hwHx?JLaL?G8B(&&(pof2a=S|+p1-JoLWu4H}c-%-g|9gd;LiV zTcXxDQOYi;WoG@ZT-lwL>9i*e-&T#bU`*P>3{CBT|* zd(kyA3}9w!0q$eRv7Z^D-Hk~d91m<9hcvccq}(n@aa&$nrHM}d{x)P|5xl4qyG??q0@+t&4k>9yKer-Or3f;6gn9Z>KZX&tHV zFL=jus{#qXyou6rTEz>wQRfmmwkD} zrxP=wNpJ}-n&sc1d18FicVAX4N{!w2)ZaMn--sEcbY>v+p-{z8b!i0>L>KI0CGe8i zj$)#?Uae74`fze8kXWgohS8Cc9*fq?*yS9NcxhHTdI1nK zjb?T7O`%wvPBAO9D+~nl$nA-|$f?1-`V66C4RZWr1D_mP1T%vsf9Qnr7ROVAv>w~6 zJ_ZA(!r$5K=X;_M@!C38oag#+A_MN&BN0TFd)&WvB}N^J=Ph7X;DXp0Wg($I(o-A{ z*x5$@WV05)Xo6|`b{Ve#=_d`!ebfk--NjxG=LkeRSOOi%wu=-&A!T8 literal 0 HcmV?d00001 diff --git a/public/images/matteress.jfif b/public/images/matteress.jfif new file mode 100644 index 0000000000000000000000000000000000000000..5a43d2ac9a95112d86689de604e0140cb00e4908 GIT binary patch literal 4467 zcma)9bx;)Ex8Efdq*=O=kYxesSW1x;lm!+LmXMBJkWOh>Qc^mkLzZq7k&^CoK|n%S zN>Gqc9)9P|ci!*K`{SKE^SN{8OrRTNVxR{xu<~;-F!3;hK%DovcfAy|E0H|&O8i0)WKrR3t6%d~ac-;$NzDW=d z|8J`Q(hW;MNJM-igi->4_;~mPxA6!Fi17a^+$dAwa}wNFrq;E5LC7Tie9^y7)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{NhHZ(bDEdnPq2fFbP*LKyCXdsF7jM;uaYO(}2-&fH=wl3xGco zk&~4PMhUa*8{o7|<%FQYS`6e+8mLgpXcVMK@FlTXq%!$R@^~z6;#)6>!YNdazu%}i z-{wf}j3v dqXbhv? ( @@ -53,6 +56,7 @@ const App: React.FC = () => ( + } diff --git a/src/components/CategoryCard.css b/src/components/CategoryCard/CategoryCard.css similarity index 100% rename from src/components/CategoryCard.css rename to src/components/CategoryCard/CategoryCard.css diff --git a/src/components/CategoryCard.tsx b/src/components/CategoryCard/CategoryCard.tsx similarity index 95% rename from src/components/CategoryCard.tsx rename to src/components/CategoryCard/CategoryCard.tsx index 766b2ee..87e4853 100644 --- a/src/components/CategoryCard.tsx +++ b/src/components/CategoryCard/CategoryCard.tsx @@ -1,12 +1,5 @@ import React from 'react'; -import { - IonGrid, - IonRow, - IonCol, - IonIcon, - IonContent, - IonLabel, -} from '@ionic/react'; +import { IonGrid, IonRow, IonCol, IonIcon, IonLabel } from '@ionic/react'; import { laptopOutline, bicycleOutline, diff --git a/src/components/HeaderCard/HeaderCard.css b/src/components/HeaderCard/HeaderCard.css new file mode 100644 index 0000000..b02d93c --- /dev/null +++ b/src/components/HeaderCard/HeaderCard.css @@ -0,0 +1,25 @@ +.heading { + font-size: 8vw; + text-align:center; +} + +.sub-heading { + + + font-size: 8vw; + text-align:center; +} +.sub-title { + text-align: center; +} + +.reg-btn { + + width: 200px; + text-align: center; + margin-left: auto; + margin-right: auto; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/components/HeaderCard.tsx b/src/components/HeaderCard/HeaderCard.tsx similarity index 54% rename from src/components/HeaderCard.tsx rename to src/components/HeaderCard/HeaderCard.tsx index 7357f66..31302a8 100644 --- a/src/components/HeaderCard.tsx +++ b/src/components/HeaderCard/HeaderCard.tsx @@ -1,34 +1,37 @@ import React from 'react'; import { IonCardHeader, - IonCardSubtitle, IonCardTitle, IonCardContent, IonCard, IonButton, } from '@ionic/react'; +import './HeaderCard.css'; +import SearchBar from '../SearchBar/SearchBar'; const HeaderCard: React.FC = () => { return ( - IIT DELHI - Marketplace + Welcome To + + IITD Marketplace + - + Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, we got you covered ! + - + Sign in to start + + + Login + ); diff --git a/src/components/ItemCard.tsx b/src/components/ItemCard.tsx deleted file mode 100644 index 88999a9..0000000 --- a/src/components/ItemCard.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { IonItem, IonLabel, IonThumbnail } from '@ionic/react'; - -const ItemCard: React.FC = () => { - return ( - - - Hero thunderbird -

Rs.2500

-

Zanskar

-
- - - -
- ); -}; - -export default ItemCard; diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx new file mode 100644 index 0000000..ea1b11b --- /dev/null +++ b/src/components/ItemCard/ItemCard.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { IonCard, IonCardHeader, IonCardSubtitle } from '@ionic/react'; + +class ItemCard extends React.Component { + render() { + const { item } = this.props; + return ( +
+ + + + {item.name} Rs.{' '} + {item.price} + + +
+ ); + } +} + +export default ItemCard; diff --git a/src/components/ItemDetail/ItemDetail.tsx b/src/components/ItemDetail/ItemDetail.tsx new file mode 100644 index 0000000..343d313 --- /dev/null +++ b/src/components/ItemDetail/ItemDetail.tsx @@ -0,0 +1,98 @@ +import React from 'react'; +import { + IonContent, + IonHeader, + IonPage, + IonChip, + IonToolbar, + IonCard, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, + IonCardContent, + IonIcon, + IonLabel, + IonButton, + IonText, +} from '@ionic/react'; +import { locationOutline } from 'ionicons/icons'; + +const ItemDetail: React.FC = () => { + return ( + + + + + + + Asus Tuf GT505 + + Rs. 40000 + + + + + + + + + Electronics + + + Laptops + + + + + + + Seller Details + + + N. Satwik + +

+ {' '} + {' '} + Zanskar House +

+
+ + Chat With Seller + +
+
+ + + + Product Details + + +
    +
  • 4 months old
  • +
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • +
  • RGB keyboard
  • +
  • ...
  • +
  • ...
  • +
+
+
+ + + + Reviews + + + +
+
+ ); +}; + +export default ItemDetail; diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx new file mode 100644 index 0000000..fb78066 --- /dev/null +++ b/src/components/ItemList/ItemList.tsx @@ -0,0 +1,102 @@ +import React from 'react'; +import { IonCol, IonRow } from '@ionic/react'; +import ItemCard from '../ItemCard/ItemCard'; + +class ItemList extends React.Component { + state = { + items: [ + { + id: 1, + name: 'Asus Laptop', + price: 40000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 2, + name: 'Macbook Air', + price: 60000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 3, + name: 'Hero Thunderbird', + price: 4000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 4, + name: 'Decathlon BTWX 100', + price: 5000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 5, + name: 'Samsung S10e', + price: 25000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 6, + name: 'Vivo V15', + price: 14000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 7, + name: 'Kurl On memory foam ', + price: 2000, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 8, + name: 'SleepX', + price: 1500, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 9, + name: 'Order of the phoenix', + price: 300, + category: 'book', + image: '/images/book.jfif', + }, + { + id: 10, + name: 'Differential Equation - Kreyzig', + price: 200, + category: 'book', + image: '/images/book.jfif', + }, + ], + }; + + render() { + const itemList = this.state.items.map((item) => { + if (this.props.category === 'all') { + return ( + + + + ); + } + if (this.props.category === item.category) { + return ( + + + + ); + } + }); + + return {itemList}; + } +} +export default ItemList; diff --git a/src/components/PostAd/PostAd.css b/src/components/PostAd/PostAd.css new file mode 100644 index 0000000..e2b81f0 --- /dev/null +++ b/src/components/PostAd/PostAd.css @@ -0,0 +1,4 @@ +.regbuttons { + align-content: center; + width:20%; +} \ No newline at end of file diff --git a/src/components/PostAd/PostAd.tsx b/src/components/PostAd/PostAd.tsx new file mode 100644 index 0000000..18fcf5c --- /dev/null +++ b/src/components/PostAd/PostAd.tsx @@ -0,0 +1,120 @@ +import React, { useState } from 'react'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import './PostAd.css'; + +import { + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, +} from '@ionic/react'; + +const PostAd: React.FC = () => { + const [name, setName] = useState(); + const [date, setDate] = useState(); + const [condition, setCondition] = useState(); + const [price, setPrice] = useState(); + const [category, setCategory] = useState(); + const [description, setDescription] = useState(); + + return ( +
+ + Post Your Ad + +
+ + + + Name of The Product + + setName(e.detail.value!)} + required + /> + + + + Tentative Date of Purchase + + setDate(e.detail.value!)} + required + /> + + + + Condition + + setCondition(e.detail.value!)} + required + /> + + + + + Category + + setCategory(e.detail.value)} + > + Laptops + Mobile + Books + Cycle + Miscallaneous + + + + + Asking Price + + setPrice(e.detail.value!)} + required + /> + + + + Description + + setDescription(e.detail.value!)} + required + /> + + + + + +
+
+ + Post + +
+
+ ); +}; + +export default PostAd; diff --git a/src/components/RegisterForm.css b/src/components/RegisterForm/RegisterForm.css similarity index 100% rename from src/components/RegisterForm.css rename to src/components/RegisterForm/RegisterForm.css diff --git a/src/components/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx similarity index 98% rename from src/components/RegisterForm.tsx rename to src/components/RegisterForm/RegisterForm.tsx index 5f7e6b7..3acef6f 100644 --- a/src/components/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -1,6 +1,5 @@ import React, { useState } from 'react'; import { - IonHeader, IonTitle, IonToolbar, IonSelect, @@ -10,7 +9,6 @@ import { IonLabel, IonList, IonButton, - IonBackButton, } from '@ionic/react'; import './RegisterForm.css'; diff --git a/src/components/SearchBar.css b/src/components/SearchBar.css deleted file mode 100644 index a93a59e..0000000 --- a/src/components/SearchBar.css +++ /dev/null @@ -1,3 +0,0 @@ -ion-toolbar{ - padding-top: 2em; -} diff --git a/src/components/SearchBar/SearchBar.css b/src/components/SearchBar/SearchBar.css new file mode 100644 index 0000000..21e968a --- /dev/null +++ b/src/components/SearchBar/SearchBar.css @@ -0,0 +1,4 @@ +.search { + margin: 0; + padding: 0; +} \ No newline at end of file diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx similarity index 83% rename from src/components/SearchBar.tsx rename to src/components/SearchBar/SearchBar.tsx index ba9e7e2..5fb7944 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { IonHeader, IonToolbar, IonSearchbar } from '@ionic/react'; +import { IonToolbar, IonSearchbar } from '@ionic/react'; import './SearchBar.css'; const SearchBar: React.FC = () => { @@ -7,6 +7,7 @@ const SearchBar: React.FC = () => { return ( setSearchText(e.detail.value!)} placeholder="Search for laptops, cycles..." diff --git a/src/pages/Health.tsx b/src/pages/Health/Health.tsx similarity index 100% rename from src/pages/Health.tsx rename to src/pages/Health/Health.tsx diff --git a/src/pages/categories.tsx b/src/pages/categories/categories.tsx similarity index 59% rename from src/pages/categories.tsx rename to src/pages/categories/categories.tsx index fe7c4e2..2edc736 100644 --- a/src/pages/categories.tsx +++ b/src/pages/categories/categories.tsx @@ -1,12 +1,6 @@ import React from 'react'; -import { - IonContent, - IonHeader, - IonPage, - IonTitle, - IonToolbar, -} from '@ionic/react'; -import CategoryCard from '../components/CategoryCard'; +import { IonContent, IonPage } from '@ionic/react'; +import CategoryCard from '../../components/CategoryCard/CategoryCard'; const categories: React.FC = () => { return ( diff --git a/src/pages/chats.tsx b/src/pages/chats/chats.tsx similarity index 58% rename from src/pages/chats.tsx rename to src/pages/chats/chats.tsx index 0e8352b..9f74612 100644 --- a/src/pages/chats.tsx +++ b/src/pages/chats/chats.tsx @@ -1,12 +1,6 @@ import React from 'react'; -import { - IonContent, - IonHeader, - IonPage, - IonTitle, - IonToolbar, -} from '@ionic/react'; -import HeaderCard from '../components/HeaderCard'; +import { IonContent, IonPage } from '@ionic/react'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; const chats: React.FC = () => { return ( diff --git a/src/pages/home.tsx b/src/pages/home.tsx deleted file mode 100644 index d132796..0000000 --- a/src/pages/home.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react'; -import { - IonContent, - IonLabel, - IonSearchbar, - IonHeader, - IonPage, - IonFab, - IonFabButton, - IonIcon, - IonToolbar, - IonFabList, - IonGrid, - IonRow, - IonFooter, -} from '@ionic/react'; -import { - add, - createOutline, - laptopOutline, - phonePortraitOutline, - bicycleOutline, - libraryOutline, - tabletLandscapeOutline, - appsOutline, -} from 'ionicons/icons'; -import './home.css'; -import SearchBar from '../components/SearchBar'; -import HeaderCard from '../components/HeaderCard'; -import ItemCard from '../components/ItemCard'; -import CategoryCard from '../components/CategoryCard'; - -const home: React.FC = () => { - return ( - - - - - - - - - - - - - - - - Post an Ad - - - - - ); -}; - -export default home; diff --git a/src/pages/home.css b/src/pages/home/home.css similarity index 100% rename from src/pages/home.css rename to src/pages/home/home.css diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx new file mode 100644 index 0000000..bef5148 --- /dev/null +++ b/src/pages/home/home.tsx @@ -0,0 +1,78 @@ +import React from 'react'; +import { + IonContent, + IonLabel, + IonSegment, + IonSegmentButton, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonFabList, +} from '@ionic/react'; +import { add, createOutline } from 'ionicons/icons'; +import './home.css'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import ItemList from '../../components/ItemList/ItemList'; +// import CategoryCard from '../../components/CategoryCard/CategoryCard'; + +class Home extends React.Component { + // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: 'all', + }; + + render() { + return ( + + + + + + + this.setState({ category: e.detail.value }) + } + color="primary" + > + + All + + + Laptops + + + Mobiles + + + Bicycles + + + Books + + + + + + + + + + + Post an Ad + + + + + ); + } +} + +export default Home; diff --git a/src/pages/myaccount.tsx b/src/pages/myaccount.tsx deleted file mode 100644 index 930de32..0000000 --- a/src/pages/myaccount.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import { - IonContent, - IonButton, - IonIcon, - IonHeader, - IonPage, - IonItem, - IonLabel, - IonThumbnail, - IonToolbar, -} from '@ionic/react'; -import './myaccount.css'; -import HeaderCard from '../components/HeaderCard'; - -const myaccount: React.FC = () => { - return ( - - - -

-
- - Guest User - - - - -
-
-
-
-
- - - -
- ); -}; - -export default myaccount; diff --git a/src/pages/myaccount.css b/src/pages/myaccount/myaccount.css similarity index 100% rename from src/pages/myaccount.css rename to src/pages/myaccount/myaccount.css diff --git a/src/pages/myaccount/myaccount.tsx b/src/pages/myaccount/myaccount.tsx new file mode 100644 index 0000000..e081787 --- /dev/null +++ b/src/pages/myaccount/myaccount.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { + IonContent, + IonHeader, + IonPage, + IonItem, + IonLabel, + IonThumbnail, + IonToolbar, +} from '@ionic/react'; +import './myaccount.css'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; + +const myaccount: React.FC = () => { + return ( + + + +

+
+ + Guest User + + + + +
+
+
+
+
+ + + +
+ ); +}; + +export default myaccount; From a2e99c7121f0bf7f4b75f1e4ef64ef3f55b3d1f4 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Sun, 24 May 2020 19:01:26 +0530 Subject: [PATCH 2/7] timeline --- Timeline.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 Timeline.md diff --git a/Timeline.md b/Timeline.md new file mode 100755 index 0000000..5bdfdbb --- /dev/null +++ b/Timeline.md @@ -0,0 +1,27 @@ +# Proposed Project TimeLine + +### Starts : May 11, 2020 +**** +#### Week 1: +##### Frontend +- [x] UI layout for Home Page, +- [x] UI layout for Login Page, +- [x] UI layout for Sign up Page + +**** + +#### Week 2: +##### Frontend +- [x] UI layout for Category browsing, +- [x] UI layout for Item Detail Page, + + +**** + +#### Week 3: +##### Frontend +- [ ] UI layout for Contact Page, +- [ ] UI layout for Profile Page, +- [ ] UI layout for Chats Page, +- [ ] UI layout complete + From 5aa0dca8b7524437c2bbea5eef684d7b15ee704f Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Tue, 26 May 2020 18:03:15 +0530 Subject: [PATCH 3/7] changes by om --- package-lock.json | 48 +++++++++++++++++ package.json | 3 ++ src/App.tsx | 2 + src/components/ItemCard/ItemCard.tsx | 2 +- src/components/ItemList/ItemList.tsx | 81 ++-------------------------- src/index.tsx | 9 +++- src/pages/home/home.tsx | 14 +++-- src/reducers/authReducer.tsx | 7 +++ src/reducers/itemReducer.tsx | 80 +++++++++++++++++++++++++++ src/reducers/rootReducer.tsx | 11 ++++ tsconfig.json | 3 +- 11 files changed, 178 insertions(+), 82 deletions(-) create mode 100644 src/reducers/authReducer.tsx create mode 100644 src/reducers/itemReducer.tsx create mode 100644 src/reducers/rootReducer.tsx diff --git a/package-lock.json b/package-lock.json index 5263932..9b1449f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1631,6 +1631,16 @@ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.5.tgz", "integrity": "sha512-wLD/Aq2VggCJXSjxEwrMafIP51Z+13H78nXIX0ABEuIGhmB5sNGbR113MOKo+yfw+RDo1ZU3DM6yfnnRF/+ouw==" }, + "@types/hoist-non-react-statics": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "dev": true, + "requires": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -1708,6 +1718,18 @@ "@types/react": "*" } }, + "@types/react-redux": { + "version": "7.1.9", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.9.tgz", + "integrity": "sha512-mpC0jqxhP4mhmOl3P4ipRsgTgbNofMRXJb08Ms6gekViLj61v1hOZEKWDCyWsdONr6EjEA6ZHXC446wdywDe0w==", + "dev": true, + "requires": { + "@types/hoist-non-react-statics": "^3.3.0", + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0", + "redux": "^4.0.0" + } + }, "@types/react-router": { "version": "5.1.7", "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.7.tgz", @@ -10988,6 +11010,18 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "react-redux": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", + "integrity": "sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA==", + "requires": { + "@babel/runtime": "^7.5.5", + "hoist-non-react-statics": "^3.3.0", + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-is": "^16.9.0" + } + }, "react-router": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", @@ -11198,6 +11232,15 @@ "strip-indent": "^3.0.0" } }, + "redux": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", + "requires": { + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -12655,6 +12698,11 @@ "util.promisify": "~1.0.0" } }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", diff --git a/package.json b/package.json index acf6dd3..6f72d61 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,11 @@ "ionicons": "^5.0.0", "react": "^16.13.0", "react-dom": "^16.13.0", + "react-redux": "^7.2.0", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-scripts": "3.4.1", + "redux": "^4.0.5", "typescript": "3.8.3" }, "scripts": { @@ -52,6 +54,7 @@ }, "devDependencies": { "@capacitor/cli": "2.1.0", + "@types/react-redux": "^7.1.9", "eslint-config-airbnb-typescript-prettier": "^2.1.1", "prettier": "^2.0.5" }, diff --git a/src/App.tsx b/src/App.tsx index 07696fe..a9ed7f0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,6 +23,7 @@ import MyAccount from './pages/myaccount/myaccount'; /* new imports */ import RegisterForm from './components/RegisterForm/RegisterForm'; import Health from './pages/Health/Health'; +import ItemDetail from './components/ItemDetail/ItemDetail' import PostAd from './components/PostAd/PostAd'; /* Core CSS required for Ionic components to work properly */ @@ -57,6 +58,7 @@ const App: React.FC = () => ( + } diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx index ea1b11b..6fd075d 100644 --- a/src/components/ItemCard/ItemCard.tsx +++ b/src/components/ItemCard/ItemCard.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { IonCard, IonCardHeader, IonCardSubtitle } from '@ionic/react'; -class ItemCard extends React.Component { +class ItemCard extends React.Component { render() { const { item } = this.props; return ( diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index fb78066..e15020b 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,85 +1,14 @@ import React from 'react'; import { IonCol, IonRow } from '@ionic/react'; import ItemCard from '../ItemCard/ItemCard'; +import categories from '../../pages/categories/categories'; -class ItemList extends React.Component { - state = { - items: [ - { - id: 1, - name: 'Asus Laptop', - price: 40000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 2, - name: 'Macbook Air', - price: 60000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 3, - name: 'Hero Thunderbird', - price: 4000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 4, - name: 'Decathlon BTWX 100', - price: 5000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 5, - name: 'Samsung S10e', - price: 25000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 6, - name: 'Vivo V15', - price: 14000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 7, - name: 'Kurl On memory foam ', - price: 2000, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 8, - name: 'SleepX', - price: 1500, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 9, - name: 'Order of the phoenix', - price: 300, - category: 'book', - image: '/images/book.jfif', - }, - { - id: 10, - name: 'Differential Equation - Kreyzig', - price: 200, - category: 'book', - image: '/images/book.jfif', - }, - ], - }; + +class ItemList extends React.Component{ render() { - const itemList = this.state.items.map((item) => { + + const itemList = this.props.items.map((item) => { if (this.props.category === 'all') { return ( diff --git a/src/index.tsx b/src/index.tsx index b597a44..6364994 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,4 +2,11 @@ import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; -ReactDOM.render(, document.getElementById('root')); +import { createStore } from 'redux' +import rootReducer from './reducers/rootReducer' + +import { Provider } from 'react-redux' + +const store = createStore(rootReducer); + +ReactDOM.render(, document.getElementById('root')); diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index bef5148..b71fc85 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -17,7 +17,9 @@ import HeaderCard from '../../components/HeaderCard/HeaderCard'; import ItemList from '../../components/ItemList/ItemList'; // import CategoryCard from '../../components/CategoryCard/CategoryCard'; -class Home extends React.Component { +import { connect } from 'react-redux' + +class Home extends React.Component { // eslint-disable-next-line react/destructuring-assignment // eslint-disable-next-line react/state-in-constructor state = { @@ -55,7 +57,7 @@ class Home extends React.Component {
- + @@ -75,4 +77,10 @@ class Home extends React.Component { } } -export default Home; +const mapStatetoProps = (state: { item: { items: any; }; }) => { + return { + items : state.item.items + } +} + +export default connect(mapStatetoProps)(Home); diff --git a/src/reducers/authReducer.tsx b/src/reducers/authReducer.tsx new file mode 100644 index 0000000..0ae0bc9 --- /dev/null +++ b/src/reducers/authReducer.tsx @@ -0,0 +1,7 @@ +const initState = {} + +const authReducer = (state = initState,action={}) => { + return state +} + +export default authReducer \ No newline at end of file diff --git a/src/reducers/itemReducer.tsx b/src/reducers/itemReducer.tsx new file mode 100644 index 0000000..8e09c7e --- /dev/null +++ b/src/reducers/itemReducer.tsx @@ -0,0 +1,80 @@ +const initState = { + items: [ + { + id: 1, + name: 'Asus Laptop', + price: 40000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 2, + name: 'Macbook Air', + price: 60000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 3, + name: 'Hero Thunderbird', + price: 4000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 4, + name: 'Decathlon BTWX 100', + price: 5000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 5, + name: 'Samsung S10e', + price: 25000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 6, + name: 'Vivo V15', + price: 14000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 7, + name: 'Kurl On memory foam ', + price: 2000, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 8, + name: 'SleepX', + price: 1500, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 9, + name: 'Order of the phoenix', + price: 300, + category: 'book', + image: '/images/book.jfif', + }, + { + id: 10, + name: 'Differential Equation - Kreyzig', + price: 200, + category: 'book', + image: '/images/book.jfif', + }, + ], +} + +const itemReducer = (state = initState,action) => { + return state +} + +export default itemReducer \ No newline at end of file diff --git a/src/reducers/rootReducer.tsx b/src/reducers/rootReducer.tsx new file mode 100644 index 0000000..57fd7ec --- /dev/null +++ b/src/reducers/rootReducer.tsx @@ -0,0 +1,11 @@ +import authReducer from './authReducer' +import itemReducer from './itemReducer' + +import { combineReducers } from 'redux' + +const rootReducer = combineReducers ({ + auth : authReducer, + item : itemReducer +}) + +export default rootReducer; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index f2850b7..4dc65a1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react" + "jsx": "react", + "noImplicitAny": false }, "include": [ "src" From 2870cd7ce7ce5bdf6346f13afe0379ce77cd3c98 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Tue, 26 May 2020 23:20:55 +0530 Subject: [PATCH 4/7] myaccount / minor changes in header fixed all lint errors --- package-lock.json | 5 + package.json | 1 + src/App.tsx | 6 +- src/components/HeaderCard/HeaderCard.css | 7 +- src/components/HeaderCard/HeaderCard.tsx | 16 +-- src/components/ItemList/ItemList.tsx | 5 +- src/pages/home/home.css | 4 + src/pages/home/home.tsx | 35 +++++-- src/pages/myaccount/myaccount.css | 18 +++- src/pages/myaccount/myaccount.tsx | 125 +++++++++++++++++++---- 10 files changed, 170 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b1449f..01f0af9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1065,6 +1065,11 @@ "tslib": "^1.9.0" } }, + "@capacitor/ios": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.1.0.tgz", + "integrity": "sha512-KE5hGQiv86Ply/WvT5OvrRBcbM+XdqbGkfp03hK8TG8tYNvJw4mXT3+bH5QsOVOI23o4LVzRWtwPmDyxCw+Pyw==" + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", diff --git a/package.json b/package.json index 6f72d61..06d3ae0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "@capacitor/core": "2.1.0", + "@capacitor/ios": "^2.1.0", "@ionic/react": "^5.0.7", "@ionic/react-router": "^5.0.7", "@testing-library/jest-dom": "^4.2.4", diff --git a/src/App.tsx b/src/App.tsx index a9ed7f0..d8e829c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,8 +23,7 @@ import MyAccount from './pages/myaccount/myaccount'; /* new imports */ import RegisterForm from './components/RegisterForm/RegisterForm'; import Health from './pages/Health/Health'; -import ItemDetail from './components/ItemDetail/ItemDetail' - +import ItemDetail from './components/ItemDetail/ItemDetail'; import PostAd from './components/PostAd/PostAd'; /* Core CSS required for Ionic components to work properly */ import '@ionic/react/css/core.css'; @@ -45,7 +44,6 @@ import '@ionic/react/css/display.css'; /* Theme variables */ import './theme/variables.css'; - const App: React.FC = () => ( @@ -55,7 +53,7 @@ const App: React.FC = () => ( - + diff --git a/src/components/HeaderCard/HeaderCard.css b/src/components/HeaderCard/HeaderCard.css index b02d93c..2424873 100644 --- a/src/components/HeaderCard/HeaderCard.css +++ b/src/components/HeaderCard/HeaderCard.css @@ -17,9 +17,10 @@ width: 200px; text-align: center; - margin-left: auto; - margin-right: auto; - display: flex; + display: inline-block; align-items: center; justify-content: center; } +.wrapper { + text-align: center; +} diff --git a/src/components/HeaderCard/HeaderCard.tsx b/src/components/HeaderCard/HeaderCard.tsx index 31302a8..ce2adb3 100644 --- a/src/components/HeaderCard/HeaderCard.tsx +++ b/src/components/HeaderCard/HeaderCard.tsx @@ -7,7 +7,6 @@ import { IonButton, } from '@ionic/react'; import './HeaderCard.css'; -import SearchBar from '../SearchBar/SearchBar'; const HeaderCard: React.FC = () => { return ( @@ -23,15 +22,16 @@ const HeaderCard: React.FC = () => { Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, we got you covered ! - - - Sign in to start - +
+ + Sign in to start + - - Login - + + Login + +
); diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index e15020b..b2966bc 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -3,11 +3,8 @@ import { IonCol, IonRow } from '@ionic/react'; import ItemCard from '../ItemCard/ItemCard'; import categories from '../../pages/categories/categories'; - - -class ItemList extends React.Component{ +class ItemList extends React.Component { render() { - const itemList = this.props.items.map((item) => { if (this.props.category === 'all') { return ( diff --git a/src/pages/home/home.css b/src/pages/home/home.css index 34bc0a9..33a94d1 100644 --- a/src/pages/home/home.css +++ b/src/pages/home/home.css @@ -17,4 +17,8 @@ ion-col{ ion-header{ padding-top:2em; + } + + .title { + font-size:1px; } \ No newline at end of file diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index b71fc85..04d71b2 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -10,16 +10,20 @@ import { IonIcon, IonToolbar, IonFabList, + IonHeader, + IonTitle, + IonCol, + IonRow, } from '@ionic/react'; import { add, createOutline } from 'ionicons/icons'; import './home.css'; +import { connect } from 'react-redux'; import HeaderCard from '../../components/HeaderCard/HeaderCard'; import ItemList from '../../components/ItemList/ItemList'; +import SearchBar from '../../components/SearchBar/SearchBar'; // import CategoryCard from '../../components/CategoryCard/CategoryCard'; -import { connect } from 'react-redux' - -class Home extends React.Component { +class Home extends React.Component { // eslint-disable-next-line react/destructuring-assignment // eslint-disable-next-line react/state-in-constructor state = { @@ -30,6 +34,18 @@ class Home extends React.Component { return ( + + + + + Home + + + + + + + @@ -57,7 +73,10 @@ class Home extends React.Component { - + @@ -77,10 +96,10 @@ class Home extends React.Component { } } -const mapStatetoProps = (state: { item: { items: any; }; }) => { +const mapStatetoProps = (state: { item: { items: any } }) => { return { - items : state.item.items - } -} + items: state.item.items, + }; +}; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/myaccount/myaccount.css b/src/pages/myaccount/myaccount.css index 0afcaf6..1d4c784 100644 --- a/src/pages/myaccount/myaccount.css +++ b/src/pages/myaccount/myaccount.css @@ -1,6 +1,16 @@ +.effect { + border: 1px solid #ccc; + padding: 7px 14px; + transition: 0.4s; + background: transparent; + color:black; +} +.avatar { + height:100px; + width:100px; + position: relative; + display: block; + margin-left: auto; + margin-right: auto; -.buttons{ - text-align: center; - padding:2em; - padding-top:6em; } \ No newline at end of file diff --git a/src/pages/myaccount/myaccount.tsx b/src/pages/myaccount/myaccount.tsx index e081787..b4e86d0 100644 --- a/src/pages/myaccount/myaccount.tsx +++ b/src/pages/myaccount/myaccount.tsx @@ -2,41 +2,124 @@ import React from 'react'; import { IonContent, IonHeader, - IonPage, + IonButton, IonItem, IonLabel, - IonThumbnail, IonToolbar, + IonTitle, + IonGrid, + IonRow, + IonCol, + IonInput, + IonSegment, + IonSegmentButton, + IonPage, } from '@ionic/react'; import './myaccount.css'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -const myaccount: React.FC = () => { +const Myaccount: React.FC = () => { return ( - + -

-
- - Guest User - - - - -
-
-
+ Profile
- +
+ + + +
+ + + + Profile + + + Buy/Sell History + + + + + + +
+ Name +
+ +
+ +
+
+ +
+ Entry No. +
+
+ +
+
+ + +
+ Phone No. +
+
+ +
+
+ +
+ Hostel +
+ +
+ +
+
+ + +
+ Email +
+
+ +
+
+ + Update + +
+ + + Get on Appstore + + + Get on Appstore + + + + + Contact For Help + + +
); }; -export default myaccount; +export default Myaccount; From 3c26c25a3bcf5d9c12adddcd2dbc4e0a967b1322 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Sun, 31 May 2020 17:28:17 +0530 Subject: [PATCH 5/7] profile --- package-lock.json | 264 ++++++++++++++++++- package.json | 7 +- src/App.test.tsx | 14 +- src/App.tsx | 170 ++++++------ src/axios-ins.tsx | 7 + src/components/CategoryCard/CategoryCard.css | 15 +- src/components/CategoryCard/CategoryCard.tsx | 153 +++++------ src/components/HeaderCard/HeaderCard.css | 1 + src/components/HeaderCard/HeaderCard.tsx | 70 ++--- src/components/ItemCard/ItemCard.tsx | 33 ++- src/components/ItemDetail/ItemDetail.tsx | 172 ++++++------ src/components/ItemList/ItemList.tsx | 48 ++-- src/components/PostAd/PostAd.css | 4 + src/components/PostAd/PostAd.tsx | 233 ++++++++-------- src/components/RegisterForm/RegisterForm.tsx | 160 +++++------ src/components/SearchBar/SearchBar.css | 7 +- src/components/SearchBar/SearchBar.tsx | 29 +- src/index.tsx | 23 +- src/pages/Health/Health.tsx | 11 +- src/pages/categories/categories.tsx | 39 ++- src/pages/chats/chats.tsx | 38 ++- src/pages/home/home.css | 4 - src/pages/home/home.tsx | 192 +++++++------- src/pages/home/home2.css | 40 +++ src/pages/home/home2.tsx | 150 +++++++++++ src/pages/myaccount/myaccount.css | 6 +- src/pages/myaccount/myaccount.tsx | 230 ++++++++-------- src/pages/register/register.tsx | 16 ++ src/reducers/authReducer.tsx | 7 - src/reducers/itemReducer.tsx | 80 ------ src/reducers/rootReducer.tsx | 11 - src/serviceWorker.ts | 216 ++++++++------- src/setupTests.ts | 2 +- src/store/actions/actionTypes.tsx | 51 ++++ src/store/actions/auth.tsx | 44 ++++ src/store/actions/chat.tsx | 13 + src/store/actions/index.tsx | 2 + src/store/actions/item.tsx | 146 ++++++++++ src/store/actions/misc.tsx | 79 ++++++ src/store/actions/review.tsx | 151 +++++++++++ src/store/reducers/auth.tsx | 7 + src/store/reducers/index.tsx | 11 + src/store/reducers/item.tsx | 80 ++++++ 43 files changed, 2029 insertions(+), 1007 deletions(-) create mode 100644 src/axios-ins.tsx create mode 100644 src/pages/home/home2.css create mode 100644 src/pages/home/home2.tsx create mode 100644 src/pages/register/register.tsx delete mode 100644 src/reducers/authReducer.tsx delete mode 100644 src/reducers/itemReducer.tsx delete mode 100644 src/reducers/rootReducer.tsx create mode 100644 src/store/actions/actionTypes.tsx create mode 100644 src/store/actions/auth.tsx create mode 100644 src/store/actions/chat.tsx create mode 100644 src/store/actions/index.tsx create mode 100644 src/store/actions/item.tsx create mode 100644 src/store/actions/misc.tsx create mode 100644 src/store/actions/review.tsx create mode 100644 src/store/reducers/auth.tsx create mode 100644 src/store/reducers/index.tsx create mode 100644 src/store/reducers/item.tsx diff --git a/package-lock.json b/package-lock.json index 01f0af9..c859a29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1065,11 +1065,6 @@ "tslib": "^1.9.0" } }, - "@capacitor/ios": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.1.0.tgz", - "integrity": "sha512-KE5hGQiv86Ply/WvT5OvrRBcbM+XdqbGkfp03hK8TG8tYNvJw4mXT3+bH5QsOVOI23o4LVzRWtwPmDyxCw+Pyw==" - }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -1754,6 +1749,12 @@ "@types/react-router": "*" } }, + "@types/socket.io-client": { + "version": "1.4.33", + "resolved": "https://registry.npmjs.org/@types/socket.io-client/-/socket.io-client-1.4.33.tgz", + "integrity": "sha512-m4LnxkljsI9fMsjwpW5QhRpMixo2BeeLpFmg0AE+sS4H1pzAd/cs/ftTiL60FLZgfFa8PFRPx5KsHu8O0bADKQ==", + "dev": true + }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", @@ -2185,6 +2186,11 @@ } } }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -2346,6 +2352,11 @@ "es-abstract": "^1.17.0-next.1" } }, + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -2461,6 +2472,37 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" }, + "axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "requires": { + "follow-redirects": "1.5.10" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "axobject-query": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.2.tgz", @@ -2864,6 +2906,11 @@ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -2924,6 +2971,11 @@ } } }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + }, "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", @@ -2942,6 +2994,14 @@ "tweetnacl": "^0.14.3" } }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "requires": { + "callsite": "1.0.0" + } + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -2961,6 +3021,11 @@ "file-uri-to-path": "1.0.0" } }, + "blob": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", + "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -3298,6 +3363,11 @@ "caller-callsite": "^2.0.0" } }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + }, "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", @@ -3635,11 +3705,21 @@ "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + }, "compose-function": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", @@ -4675,6 +4755,46 @@ "once": "^1.4.0" } }, + "engine.io-client": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.2.tgz", + "integrity": "sha512-AWjc1Xg06a6UPFOBAzJf48W1UR/qKYmv/ubgSCumo9GXgvL/xGIvo05dXoBL+2NTLMipDI7in8xK61C17L25xg==", + "requires": { + "component-emitter": "~1.3.0", + "component-inherit": "0.0.3", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~6.1.0", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + }, + "dependencies": { + "ws": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "engine.io-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "~0.0.7", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.5", + "has-binary2": "~1.0.2" + } + }, "enhanced-resolve": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", @@ -6411,6 +6531,26 @@ } } }, + "has-binary2": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", + "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -6818,6 +6958,11 @@ "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, "infer-owner": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", @@ -8840,6 +8985,11 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -9232,6 +9382,22 @@ "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "requires": { + "better-assert": "~1.0.0" + } + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -10663,6 +10829,11 @@ "whatwg-fetch": "^3.0.0" } }, + "react-axios": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/react-axios/-/react-axios-2.0.3.tgz", + "integrity": "sha512-63kY2iupdRgbvPq9G8xmM0NWUnt2Q5YmpotMoLQsxKOzKXKZg2Lo6CzF/bcZvtmv3WnfjBU6Bg8nZQO28eIAZw==" + }, "react-dev-utils": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", @@ -11246,6 +11417,11 @@ "symbol-observable": "^1.2.0" } }, + "redux-thunk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", + "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==" + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -12147,6 +12323,69 @@ "kind-of": "^3.2.0" } }, + "socket.io-client": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "engine.io-client": "~3.4.0", + "has-binary2": "~1.0.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "~3.3.0", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + } + } + }, + "socket.io-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "isarray": "2.0.1" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "sockjs": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", @@ -12975,6 +13214,11 @@ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=" }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -14335,6 +14579,11 @@ "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", "dev": true }, + "xmlhttprequest-ssl": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", + "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" + }, "xregexp": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", @@ -14446,6 +14695,11 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" } } } diff --git a/package.json b/package.json index 06d3ae0..2a9aee4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "private": true, "dependencies": { "@capacitor/core": "2.1.0", - "@capacitor/ios": "^2.1.0", "@ionic/react": "^5.0.7", "@ionic/react-router": "^5.0.7", "@testing-library/jest-dom": "^4.2.4", @@ -16,14 +15,19 @@ "@types/react-dom": "^16.9.4", "@types/react-router": "^5.1.4", "@types/react-router-dom": "^5.1.3", + "axios": "^0.19.2", "ionicons": "^5.0.0", + "querystring": "^0.2.0", "react": "^16.13.0", + "react-axios": "^2.0.3", "react-dom": "^16.13.0", "react-redux": "^7.2.0", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-scripts": "3.4.1", "redux": "^4.0.5", + "redux-thunk": "^2.3.0", + "socket.io-client": "^2.3.0", "typescript": "3.8.3" }, "scripts": { @@ -56,6 +60,7 @@ "devDependencies": { "@capacitor/cli": "2.1.0", "@types/react-redux": "^7.1.9", + "@types/socket.io-client": "^1.4.33", "eslint-config-airbnb-typescript-prettier": "^2.1.1", "prettier": "^2.0.5" }, diff --git a/src/App.test.tsx b/src/App.test.tsx index 25e68dc..ae51219 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,10 +1,10 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; +import React from "react"; +import { render } from "@testing-library/react"; +import App from "./App"; // eslint-disable-next-line no-undef -test('renders without crashing', () => { - const { baseElement } = render(); - // eslint-disable-next-line no-undef - expect(baseElement).toBeDefined(); +test("renders without crashing", () => { + const { baseElement } = render(); + // eslint-disable-next-line no-undef + expect(baseElement).toBeDefined(); }); diff --git a/src/App.tsx b/src/App.tsx index d8e829c..1b58861 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,89 +1,109 @@ -import React from 'react'; -import { Redirect, Route } from 'react-router-dom'; +import React from "react"; +import { Redirect, Route } from "react-router-dom"; +import axios from "axios"; +import qs from "querystring"; +import { connect } from "react-redux"; import { - IonApp, - IonIcon, - IonLabel, - IonRouterOutlet, - IonTabBar, - IonTabButton, - IonTabs, -} from '@ionic/react'; -import { IonReactRouter } from '@ionic/react-router'; + IonApp, + IonIcon, + IonLabel, + IonRouterOutlet, + IonTabBar, + IonTabButton, + IonTabs, +} from "@ionic/react"; +import { IonReactRouter } from "@ionic/react-router"; import { - chatboxOutline, - gridOutline, - homeOutline, - personOutline, -} from 'ionicons/icons'; -import Home from './pages/home/home'; -import Categories from './pages/categories/categories'; -import Chats from './pages/chats/chats'; -import MyAccount from './pages/myaccount/myaccount'; + chatboxOutline, + gridOutline, + homeOutline, + personOutline, +} from "ionicons/icons"; +import Home from "./pages/home/home"; +import Categories from "./pages/categories/categories"; +import Chats from "./pages/chats/chats"; +import MyAccount from "./pages/myaccount/myaccount"; /* new imports */ -import RegisterForm from './components/RegisterForm/RegisterForm'; -import Health from './pages/Health/Health'; -import ItemDetail from './components/ItemDetail/ItemDetail'; -import PostAd from './components/PostAd/PostAd'; +import Register from "./pages/register/register"; +import Health from "./pages/Health/Health"; +import ItemDetail from "./components/ItemDetail/ItemDetail"; +import PostAd from "./components/PostAd/PostAd"; /* Core CSS required for Ionic components to work properly */ -import '@ionic/react/css/core.css'; +import "@ionic/react/css/core.css"; /* Basic CSS for apps built with Ionic */ -import '@ionic/react/css/normalize.css'; -import '@ionic/react/css/structure.css'; -import '@ionic/react/css/typography.css'; +import "@ionic/react/css/normalize.css"; +import "@ionic/react/css/structure.css"; +import "@ionic/react/css/typography.css"; /* Optional CSS utils that can be commented out */ -import '@ionic/react/css/padding.css'; -import '@ionic/react/css/float-elements.css'; -import '@ionic/react/css/text-alignment.css'; -import '@ionic/react/css/text-transformation.css'; -import '@ionic/react/css/flex-utils.css'; -import '@ionic/react/css/display.css'; +import "@ionic/react/css/padding.css"; +import "@ionic/react/css/float-elements.css"; +import "@ionic/react/css/text-alignment.css"; +import "@ionic/react/css/text-transformation.css"; +import "@ionic/react/css/flex-utils.css"; +import "@ionic/react/css/display.css"; /* Theme variables */ -import './theme/variables.css'; +import "./theme/variables.css"; +import { authSuccess } from "./store/actions/index"; -const App: React.FC = () => ( - +class App extends React.Component { + componentDidMount() { + const eventUser = new EventSource("http://localhost:5000/streamUser"); + eventUser.onmessage = (e) => this.props.changeUser(e.data); + const data = { + username: "ssh", + password: "12345", + }; + axios + .post("http://localhost:5000/login", qs.stringify(data)) + .then((res) => console.log(res)) + .catch((err) => console.log(err.response)); + } + render() { + return ( + - - - - - - - - - - - } - exact - /> - - - - - Home - - - - Categories - - - - Chats - - - - My Account - - - + + + + + + + + + + + + + + + + Home + + + + Categories + + + + Chats + + + + My Account + + + - -); + + ); + } +} -export default App; +const mapDispatchToProps = (dispatch) => ({ + changeUser: (data) => dispatch(authSuccess(data)), +}); + +export default connect(null, mapDispatchToProps)(App); diff --git a/src/axios-ins.tsx b/src/axios-ins.tsx new file mode 100644 index 0000000..c11f0c5 --- /dev/null +++ b/src/axios-ins.tsx @@ -0,0 +1,7 @@ +import axios from "axios"; + +const instance = axios.create({ + baseURL: "http://localhost:5000", +}); + +export default instance; diff --git a/src/components/CategoryCard/CategoryCard.css b/src/components/CategoryCard/CategoryCard.css index 1447294..c946b1c 100644 --- a/src/components/CategoryCard/CategoryCard.css +++ b/src/components/CategoryCard/CategoryCard.css @@ -1,11 +1,8 @@ -.col{ - font-size:12px; - text-align: center; - border-radius:15px; - padding:4px; - padding-top:20px; - padding-bottom: 20px; - margin:12px; - border:solid 1px lightgrey; + + +ion-chip{ + padding:30px 0px 30px 25px; + width: 160px; + margin-bottom: 10px; } diff --git a/src/components/CategoryCard/CategoryCard.tsx b/src/components/CategoryCard/CategoryCard.tsx index 87e4853..21a3f2e 100644 --- a/src/components/CategoryCard/CategoryCard.tsx +++ b/src/components/CategoryCard/CategoryCard.tsx @@ -1,80 +1,85 @@ -import React from 'react'; -import { IonGrid, IonRow, IonCol, IonIcon, IonLabel } from '@ionic/react'; +import React from "react"; import { - laptopOutline, - bicycleOutline, - phonePortraitOutline, - tabletLandscapeOutline, - libraryOutline, - constructOutline, -} from 'ionicons/icons'; -import './CategoryCard.css'; + IonGrid, + IonRow, + IonCol, + IonIcon, + IonLabel, + IonText, + IonChip, +} from "@ionic/react"; +import { + bicycle, + laptopOutline, + phonePortraitOutline, + tabletLandscapeOutline, + bookOutline, + constructOutline, +} from "ionicons/icons"; +import "./CategoryCard.css"; const CategoryCard: React.FC = () => ( - - - - -
- Laptops -
- - -
- Bicycles -
- - -
- Mobiles -
- - -
- Mattresses -
- - -
- Books -
- - -
- Miscellaneous -
-
-
+ + + + + + +
Laptops
+
+
+
+ + + + + +
Bicycles
+
+
+
+
+ + + + + + +
Phones
+
+
+
+ + + + + +
Matteresses
+
+
+
+
+ + + + + + +
Books
+
+
+
+ + + + + +
Misc.
+
+
+
+
+
); export default CategoryCard; diff --git a/src/components/HeaderCard/HeaderCard.css b/src/components/HeaderCard/HeaderCard.css index 2424873..400d777 100644 --- a/src/components/HeaderCard/HeaderCard.css +++ b/src/components/HeaderCard/HeaderCard.css @@ -20,6 +20,7 @@ display: inline-block; align-items: center; justify-content: center; + padding-left: 10px; } .wrapper { text-align: center; diff --git a/src/components/HeaderCard/HeaderCard.tsx b/src/components/HeaderCard/HeaderCard.tsx index ce2adb3..57466af 100644 --- a/src/components/HeaderCard/HeaderCard.tsx +++ b/src/components/HeaderCard/HeaderCard.tsx @@ -1,40 +1,42 @@ -import React from 'react'; +import React from "react"; import { - IonCardHeader, - IonCardTitle, - IonCardContent, - IonCard, - IonButton, -} from '@ionic/react'; -import './HeaderCard.css'; + IonCardHeader, + IonCardTitle, + IonCardContent, + IonCard, + IonButton, +} from "@ionic/react"; +import "./HeaderCard.css"; +import SearchBar from "../SearchBar/SearchBar"; +import { RouteComponentProps } from "react-router-dom"; -const HeaderCard: React.FC = () => { - return ( - - - Welcome To - - IITD Marketplace - - +const HeaderCard: React.FC = (props) => { + const clicked = (route: string) => { + props.history.push(route); + }; + return ( + + + Welcome To + IITD Marketplace + + + Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, we got + you covered ! + + +
+ + Sign in to start + - - Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, - we got you covered ! - - -
- - Sign in to start - - - - Login - -
-
- - ); + + Login + +
+
+
+ ); }; export default HeaderCard; diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx index 6fd075d..34a68c8 100644 --- a/src/components/ItemCard/ItemCard.tsx +++ b/src/components/ItemCard/ItemCard.tsx @@ -1,21 +1,20 @@ -import React from 'react'; -import { IonCard, IonCardHeader, IonCardSubtitle } from '@ionic/react'; +import React from "react"; +import { IonCard, IonCardHeader, IonCardSubtitle } from "@ionic/react"; -class ItemCard extends React.Component { - render() { - const { item } = this.props; - return ( -
- - - - {item.name} Rs.{' '} - {item.price} - - -
- ); - } +class ItemCard extends React.Component { + render() { + const { item } = this.props; + return ( +
+ + cardImg + + {item.name} Rs. {item.price} + + +
+ ); + } } export default ItemCard; diff --git a/src/components/ItemDetail/ItemDetail.tsx b/src/components/ItemDetail/ItemDetail.tsx index 343d313..b0ee839 100644 --- a/src/components/ItemDetail/ItemDetail.tsx +++ b/src/components/ItemDetail/ItemDetail.tsx @@ -1,98 +1,86 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonHeader, - IonPage, - IonChip, - IonToolbar, - IonCard, - IonCardHeader, - IonCardSubtitle, - IonCardTitle, - IonCardContent, - IonIcon, - IonLabel, - IonButton, - IonText, -} from '@ionic/react'; -import { locationOutline } from 'ionicons/icons'; + IonContent, + IonHeader, + IonPage, + IonChip, + IonToolbar, + IonCard, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, + IonCardContent, + IonIcon, + IonLabel, + IonButton, + IonText, +} from "@ionic/react"; +import { locationOutline } from "ionicons/icons"; const ItemDetail: React.FC = () => { - return ( - - - - - - - Asus Tuf GT505 - - Rs. 40000 - - - - - - - - - Electronics - - - Laptops - - - - - - - Seller Details - - - N. Satwik - -

- {' '} - {' '} - Zanskar House -

-
- - Chat With Seller - -
-
- - - - Product Details - - -
    -
  • 4 months old
  • -
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • -
  • RGB keyboard
  • -
  • ...
  • -
  • ...
  • -
-
-
- - - - Reviews - - - -
-
- ); + return ( + + + + + + Asus Tuf GT505 + + Rs. 40000 + + + + + + + + Electronics + + + Laptops + + + + + + Seller Details + + + N. Satwik + +

+ {" "} + Zanskar House +

+
+ + Chat With Seller + +
+
+ + + Product Details + + +
    +
  • 4 months old
  • +
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • +
  • RGB keyboard
  • +
  • ...
  • +
  • ...
  • +
+
+
+ + + Reviews + + + +
+
+ ); }; export default ItemDetail; diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index b2966bc..7f1b7a5 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,28 +1,30 @@ -import React from 'react'; -import { IonCol, IonRow } from '@ionic/react'; -import ItemCard from '../ItemCard/ItemCard'; -import categories from '../../pages/categories/categories'; +import React from "react"; +import { IonCol, IonRow } from "@ionic/react"; +import ItemCard from "../ItemCard/ItemCard"; +// import categories from '../../pages/categories/categories'; class ItemList extends React.Component { - render() { - const itemList = this.props.items.map((item) => { - if (this.props.category === 'all') { - return ( - - - - ); - } - if (this.props.category === item.category) { - return ( - - - - ); - } - }); + render() { + const itemList = this.props.items.map((item) => { + if (this.props.category === "all") { + return ( + + + + ); + } + if (this.props.category === item.category) { + return ( + + + + ); + } else { + return null; + } + }); - return {itemList}; - } + return {itemList}; + } } export default ItemList; diff --git a/src/components/PostAd/PostAd.css b/src/components/PostAd/PostAd.css index e2b81f0..849da90 100644 --- a/src/components/PostAd/PostAd.css +++ b/src/components/PostAd/PostAd.css @@ -1,4 +1,8 @@ .regbuttons { align-content: center; width:20%; +} +.btn { + text-align: center; + } \ No newline at end of file diff --git a/src/components/PostAd/PostAd.tsx b/src/components/PostAd/PostAd.tsx index 18fcf5c..0a00b53 100644 --- a/src/components/PostAd/PostAd.tsx +++ b/src/components/PostAd/PostAd.tsx @@ -1,120 +1,133 @@ -import React, { useState } from 'react'; +import React, { useState } from "react"; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import './PostAd.css'; - +import "./PostAd.css"; +import { RouteComponentProps } from "react-router"; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, -} from '@ionic/react'; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, + IonPage, + IonContent, + IonHeader, + IonButtons, + IonBackButton, +} from "@ionic/react"; -const PostAd: React.FC = () => { - const [name, setName] = useState(); - const [date, setDate] = useState(); - const [condition, setCondition] = useState(); - const [price, setPrice] = useState(); - const [category, setCategory] = useState(); - const [description, setDescription] = useState(); +const PostAd: React.FC = () => { + const [name, setName] = useState(); + const [date, setDate] = useState(); + const [condition, setCondition] = useState(); + const [price, setPrice] = useState(); + const [category, setCategory] = useState(); + const [description, setDescription] = useState(); - return ( -
+ return ( + + + + - Post Your Ad + + + + Post Your Ad -
- - - - Name of The Product - - setName(e.detail.value!)} - required - /> - - - - Tentative Date of Purchase - - setDate(e.detail.value!)} - required - /> - - - - Condition - - setCondition(e.detail.value!)} - required - /> - - - - - Category - - setCategory(e.detail.value)} - > - Laptops - Mobile - Books - Cycle - Miscallaneous - - - - - Asking Price - - setPrice(e.detail.value!)} - required - /> - - - - Description - - setDescription(e.detail.value!)} - required - /> - - - - - -
-
- - Post - -
+
+
+
+ + + + Name of The Product + + setName(e.detail.value!)} + required + /> + + + + Tentative Date of Purchase + + setDate(e.detail.value!)} + required + /> + + + + Condition + + setCondition(e.detail.value!)} + required + /> + + + + Category + + setCategory(e.detail.value)} + > + Laptops + Mobile + Books + Cycle + Miscallaneous + + + + + Asking Price + + setPrice(e.detail.value!)} + required + /> + + + + Description + + setDescription(e.detail.value!)} + required + /> + + + + + +
+
+ + Post +
- ); +
+
+ ); }; export default PostAd; diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx index 3acef6f..2eaf6c2 100644 --- a/src/components/RegisterForm/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -1,87 +1,87 @@ -import React, { useState } from 'react'; +import React, { useState } from "react"; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, -} from '@ionic/react'; -import './RegisterForm.css'; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, +} from "@ionic/react"; +import "./RegisterForm.css"; const RegisterForm: React.FC = () => { - const [uname, setUname] = useState(); - const [pass, setPass] = useState(); - const [entryno, setEntryno] = useState(); - const [hostel, setHostel] = useState(); + const [uname, setUname] = useState(); + const [pass, setPass] = useState(); + const [entryno, setEntryno] = useState(); + const [hostel, setHostel] = useState(); - return ( -
- - Join us today ! - -
- - - - Username - - setUname(e.detail.value!)} - required - /> - - - - Password - - setPass(e.detail.value!)} - required - /> - - - - Entry Number - - setEntryno(e.detail.value!)} - required - /> - - - - Hostel - - setHostel(e.detail.value)} - > - Aravalli - Girnar - Jwalamukhi - Himadri - Zanskar - - - -
-
- - Register - -
-
- ); + return ( +
+ + Join us today ! + +
+ + + + Username + + setUname(e.detail.value!)} + required + /> + + + + Password + + setPass(e.detail.value!)} + required + /> + + + + Entry Number + + setEntryno(e.detail.value!)} + required + /> + + + + Hostel + + setHostel(e.detail.value)} + > + Aravalli + Girnar + Jwalamukhi + Himadri + Zanskar + + + +
+
+ + Register + +
+
+ ); }; export default RegisterForm; diff --git a/src/components/SearchBar/SearchBar.css b/src/components/SearchBar/SearchBar.css index 21e968a..d19a6e1 100644 --- a/src/components/SearchBar/SearchBar.css +++ b/src/components/SearchBar/SearchBar.css @@ -1,4 +1,3 @@ -.search { - margin: 0; - padding: 0; -} \ No newline at end of file +.searchbar{ + +} diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 5fb7944..671aa17 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,19 +1,20 @@ -import React, { useState } from 'react'; -import { IonToolbar, IonSearchbar } from '@ionic/react'; -import './SearchBar.css'; +import React, { useState } from "react"; +import { IonToolbar, IonSearchbar } from "@ionic/react"; +import "./SearchBar.css"; const SearchBar: React.FC = () => { - const [searchText, setSearchText] = useState(''); - return ( - - setSearchText(e.detail.value!)} - placeholder="Search for laptops, cycles..." - /> - - ); + const [searchText, setSearchText] = useState(""); + return ( + + setSearchText(e.detail.value!)} + placeholder="Search" + /> + + ); }; export default SearchBar; diff --git a/src/index.tsx b/src/index.tsx index 6364994..f075bbf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,17 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App"; -import { createStore } from 'redux' -import rootReducer from './reducers/rootReducer' +import { createStore, applyMiddleware } from "redux"; +import rootReducer from "./store/reducers"; +import thunk from "redux-thunk"; +import { Provider } from "react-redux"; -import { Provider } from 'react-redux' +const store = createStore(rootReducer, applyMiddleware(thunk)); -const store = createStore(rootReducer); - -ReactDOM.render(, document.getElementById('root')); +ReactDOM.render( + + + , + document.getElementById("root") +); diff --git a/src/pages/Health/Health.tsx b/src/pages/Health/Health.tsx index d0ec7ea..3526d85 100644 --- a/src/pages/Health/Health.tsx +++ b/src/pages/Health/Health.tsx @@ -1,8 +1,13 @@ -import React from 'react'; -import { withRouter } from 'react-router-dom'; +import React from "react"; +import { withRouter } from "react-router-dom"; +import { IonPage } from "@ionic/react"; const Health: React.FC = () => { - return

Ok, Healthy!

; + return ( + +

Ok, Healthy!

+
+ ); }; export default withRouter(Health); diff --git a/src/pages/categories/categories.tsx b/src/pages/categories/categories.tsx index 2edc736..b4d0390 100644 --- a/src/pages/categories/categories.tsx +++ b/src/pages/categories/categories.tsx @@ -1,15 +1,32 @@ -import React from 'react'; -import { IonContent, IonPage } from '@ionic/react'; -import CategoryCard from '../../components/CategoryCard/CategoryCard'; +import React from "react"; +import { + IonContent, + IonPage, + IonHeader, + IonToolbar, + IonButtons, + IonBackButton, + IonTitle, +} from "@ionic/react"; +import CategoryCard from "../../components/CategoryCard/CategoryCard"; +import { RouteComponentProps } from "react-router"; -const categories: React.FC = () => { - return ( - - - - - - ); +const categories: React.FC = (props) => { + return ( + + + + + + + Categories + + + + + + + ); }; export default categories; diff --git a/src/pages/chats/chats.tsx b/src/pages/chats/chats.tsx index 9f74612..e9705cb 100644 --- a/src/pages/chats/chats.tsx +++ b/src/pages/chats/chats.tsx @@ -1,15 +1,31 @@ -import React from 'react'; -import { IonContent, IonPage } from '@ionic/react'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import React from "react"; +import { + IonContent, + IonPage, + IonHeader, + IonToolbar, + IonButtons, + IonBackButton, + IonTitle, +} from "@ionic/react"; +import HeaderCard from "../../components/HeaderCard/HeaderCard"; +import { RouteComponentProps } from "react-router"; -const chats: React.FC = () => { - return ( - - - - - - ); +const chats: React.FC = (props) => { + return ( + + + + + + + + Chats + + + + + ); }; export default chats; diff --git a/src/pages/home/home.css b/src/pages/home/home.css index 33a94d1..34bc0a9 100644 --- a/src/pages/home/home.css +++ b/src/pages/home/home.css @@ -17,8 +17,4 @@ ion-col{ ion-header{ padding-top:2em; - } - - .title { - font-size:1px; } \ No newline at end of file diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index 04d71b2..a9c502f 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -1,105 +1,101 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonLabel, - IonSegment, - IonSegmentButton, - IonPage, - IonFab, - IonFabButton, - IonIcon, - IonToolbar, - IonFabList, - IonHeader, - IonTitle, - IonCol, - IonRow, -} from '@ionic/react'; -import { add, createOutline } from 'ionicons/icons'; -import './home.css'; -import { connect } from 'react-redux'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -import ItemList from '../../components/ItemList/ItemList'; -import SearchBar from '../../components/SearchBar/SearchBar'; -// import CategoryCard from '../../components/CategoryCard/CategoryCard'; + IonContent, + IonLabel, + IonSegment, + IonSegmentButton, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonFabList, + IonHeader, + IonRow, + IonCol, + IonButtons, + IonBackButton, + IonTitle, +} from "@ionic/react"; +import { add, createOutline } from "ionicons/icons"; +import "./home.css"; +import HeaderCard from "../../components/HeaderCard/HeaderCard"; +import ItemList from "../../components/ItemList/ItemList"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import SearchBar from "../../components/SearchBar/SearchBar"; -class Home extends React.Component { - // eslint-disable-next-line react/destructuring-assignment - // eslint-disable-next-line react/state-in-constructor - state = { - category: 'all', - }; - - render() { - return ( - - - - - - - Home - - - - - - - - - - - - this.setState({ category: e.detail.value }) - } - color="primary" - > - - All - - - Laptops - - - Mobiles - - - Bicycles - - - Books - - - - - - - - - - - Post an Ad - - - - - ); - } +class Home extends React.Component { + // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: "all", + }; + render() { + return ( + + + + + + + + + + + + + + + + + this.setState({ category: e.detail.value })} + color="primary" + > + + All + + + Laptops + + + Mobiles + + + Bicycles + + + Books + + + + + + + + + + this.props.history.push("/postad")} + > + + {/* Post an Ad */} + + + + + + ); + } } -const mapStatetoProps = (state: { item: { items: any } }) => { - return { - items: state.item.items, - }; +const mapStatetoProps = (state: any) => { + return { + items: state.item.items, + }; }; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/home/home2.css b/src/pages/home/home2.css new file mode 100644 index 0000000..110cbe8 --- /dev/null +++ b/src/pages/home/home2.css @@ -0,0 +1,40 @@ +.wishlist-btn{ + font-size: 26px; +} + +.notification-btn{ + font-size: 26px; + +} + +.card{ + padding:40px 0px 10px 10px; + opacity: 0.9; +} + +.card-icon{ + margin-bottom:25px; + font-size:45px; +} + +.card-text{ + font-weight: 450; + font-size:18px; + padding-left:5px; +} + +ion-card { + margin-top:10px !important; + margin-bottom:10px !important; + margin-left:10px !important ; + margin-right: 10px !important; +} + +ion-col{ + padding:0; +} + +ion-row{ + margin-left:10px; + margin-right:10px; +} diff --git a/src/pages/home/home2.tsx b/src/pages/home/home2.tsx new file mode 100644 index 0000000..ebef08e --- /dev/null +++ b/src/pages/home/home2.tsx @@ -0,0 +1,150 @@ +import React from "react"; +import { + IonContent, + IonLabel, + IonSegment, + IonSegmentButton, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonFabList, + IonHeader, + IonText, + IonRow, + IonCol, + IonCard, +} from "@ionic/react"; +import { + add, + notificationsOutline, + personCircle, + heart, + heartOutline, + heartHalf, + checkmarkCircle, + lockClosed, + analytics, + ribbon, + ribbonOutline, +} from "ionicons/icons"; +import "./home2.css"; +import HeaderCard from "../../components/HeaderCard/HeaderCard"; +import ItemList from "../../components/ItemList/ItemList"; + +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; + +import SearchBar from "../../components/SearchBar/SearchBar"; +import CategoryCard from "../../components/CategoryCard/CategoryCard"; + +class Home extends React.Component { + // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: "all", + }; + render() { + return ( + + + + + + + + + + + + + + + + +
+ Safe +
+
+ + + +
+ Secure +
+
+
+ + + + +
+ Dynamic +
+
+ + + +
+ Friendly +
+
+
+
+ + + +

Choose a category

+
+ +
+ + + + this.props.history.push("/postad")} + /> + + +
+
+ ); + } +} + +const mapStatetoProps = (state: any) => { + return { + items: state.item.items, + }; +}; + +export default connect(mapStatetoProps)(Home); diff --git a/src/pages/myaccount/myaccount.css b/src/pages/myaccount/myaccount.css index 1d4c784..b583f12 100644 --- a/src/pages/myaccount/myaccount.css +++ b/src/pages/myaccount/myaccount.css @@ -1,7 +1,7 @@ .effect { border: 1px solid #ccc; padding: 7px 14px; - transition: 0.4s; + background: transparent; color:black; } @@ -13,4 +13,8 @@ margin-left: auto; margin-right: auto; +} + +.colgap { + padding-bottom: 30px ; } \ No newline at end of file diff --git a/src/pages/myaccount/myaccount.tsx b/src/pages/myaccount/myaccount.tsx index b4e86d0..6d938e4 100644 --- a/src/pages/myaccount/myaccount.tsx +++ b/src/pages/myaccount/myaccount.tsx @@ -1,125 +1,123 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonHeader, - IonButton, - IonItem, - IonLabel, - IonToolbar, - IonTitle, - IonGrid, - IonRow, - IonCol, - IonInput, - IonSegment, - IonSegmentButton, - IonPage, -} from '@ionic/react'; -import './myaccount.css'; + IonContent, + IonHeader, + IonButton, + IonItem, + IonLabel, + IonToolbar, + IonTitle, + IonGrid, + IonRow, + IonCol, + IonInput, + IonSegment, + IonSegmentButton, + IonPage, + IonBackButton, + IonButtons, +} from "@ionic/react"; +import "./myaccount.css"; const Myaccount: React.FC = () => { - return ( - - - - Profile - - - -
- - - -
- - - - Profile - - - Buy/Sell History - - - - - - -
- Name -
+ return ( + + + + + + + Profile + + + +
+ + + +
+ + + + Profile + + + Buy/Sell History + + + + + + +
+ Name +
-
- -
-
- -
- Entry No. -
-
- -
-
+
+ +
+
+ +
+ Entry No. +
+
+ +
+
- -
- Phone No. -
-
- -
-
- -
- Hostel -
+ +
+ Phone No. +
+
+ +
+
+ +
+ Email +
-
- -
-
- - -
- Email -
-
- -
-
- - Update - -
- - - Get on Appstore - - - Get on Appstore - - - - - Contact For Help - - -
-
-
- ); +
+ +
+ + + +
+ Hostel +
+
+ +
+
+ + + Update Info + + + + + Get on PlayStore + + + Get on AppStore + + + + + Contact For Help + + + + + + ); }; export default Myaccount; diff --git a/src/pages/register/register.tsx b/src/pages/register/register.tsx new file mode 100644 index 0000000..15c1387 --- /dev/null +++ b/src/pages/register/register.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import RegisterForm from "../../components/RegisterForm/RegisterForm"; +import { IonPage } from "@ionic/react"; +import { RouteComponentProps } from "react-router"; + +class Register extends React.Component { + state = { + isSignUp: true, + }; + render() { + let register = ; + return {register}; + } +} + +export default Register; diff --git a/src/reducers/authReducer.tsx b/src/reducers/authReducer.tsx deleted file mode 100644 index 0ae0bc9..0000000 --- a/src/reducers/authReducer.tsx +++ /dev/null @@ -1,7 +0,0 @@ -const initState = {} - -const authReducer = (state = initState,action={}) => { - return state -} - -export default authReducer \ No newline at end of file diff --git a/src/reducers/itemReducer.tsx b/src/reducers/itemReducer.tsx deleted file mode 100644 index 8e09c7e..0000000 --- a/src/reducers/itemReducer.tsx +++ /dev/null @@ -1,80 +0,0 @@ -const initState = { - items: [ - { - id: 1, - name: 'Asus Laptop', - price: 40000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 2, - name: 'Macbook Air', - price: 60000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 3, - name: 'Hero Thunderbird', - price: 4000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 4, - name: 'Decathlon BTWX 100', - price: 5000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 5, - name: 'Samsung S10e', - price: 25000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 6, - name: 'Vivo V15', - price: 14000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 7, - name: 'Kurl On memory foam ', - price: 2000, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 8, - name: 'SleepX', - price: 1500, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 9, - name: 'Order of the phoenix', - price: 300, - category: 'book', - image: '/images/book.jfif', - }, - { - id: 10, - name: 'Differential Equation - Kreyzig', - price: 200, - category: 'book', - image: '/images/book.jfif', - }, - ], -} - -const itemReducer = (state = initState,action) => { - return state -} - -export default itemReducer \ No newline at end of file diff --git a/src/reducers/rootReducer.tsx b/src/reducers/rootReducer.tsx deleted file mode 100644 index 57fd7ec..0000000 --- a/src/reducers/rootReducer.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import authReducer from './authReducer' -import itemReducer from './itemReducer' - -import { combineReducers } from 'redux' - -const rootReducer = combineReducers ({ - auth : authReducer, - item : itemReducer -}) - -export default rootReducer; \ No newline at end of file diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index 35e67cb..73c4506 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -11,136 +11,132 @@ // opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) + window.location.hostname === "localhost" || + // [::1] is the IPv6 localhost address. + window.location.hostname === "[::1]" || + // 127.0.0.0/8 are considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) ); type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; + onSuccess?: (registration: ServiceWorkerRegistration) => void; + onUpdate?: (registration: ServiceWorkerRegistration) => void; }; export function register(config?: Config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL( - process.env.PUBLIC_URL!, - window.location.href - ); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } + if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL!, window.location.href); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return; + } - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + window.addEventListener("load", () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + "This web app is being served cache-first by a service " + + "worker. To learn more, visit https://bit.ly/CRA-PWA" + ); }); - } + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } + }); + } } function registerValidSW(swUrl: string, config?: Config) { - navigator.serviceWorker - .register(swUrl) - .then((registration) => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); + navigator.serviceWorker + .register(swUrl) + .then((registration) => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === "installed") { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + "New content is available and will be used when all " + + "tabs for this page are closed. See https://bit.ly/CRA-PWA." + ); - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log("Content is cached for offline use."); - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch((error) => { - console.error('Error during service worker registration:', error); - }); + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch((error) => { + console.error("Error during service worker registration:", error); + }); } function checkValidServiceWorker(swUrl: string, config?: Config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { 'Service-Worker': 'script' }, - }) - .then((response) => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && - contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then((registration) => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl, { + headers: { "Service-Worker": "script" }, + }) + .then((response) => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get("content-type"); + if ( + response.status === 404 || + (contentType != null && contentType.indexOf("javascript") === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then((registration) => { + registration.unregister().then(() => { + window.location.reload(); + }); }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + "No internet connection found. App is running in offline mode." + ); + }); } export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then((registration) => { - registration.unregister(); - }); - } + if ("serviceWorker" in navigator) { + navigator.serviceWorker.ready.then((registration) => { + registration.unregister(); + }); + } } diff --git a/src/setupTests.ts b/src/setupTests.ts index 74b1a27..5fdf001 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -2,4 +2,4 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect'; +import "@testing-library/jest-dom/extend-expect"; diff --git a/src/store/actions/actionTypes.tsx b/src/store/actions/actionTypes.tsx new file mode 100644 index 0000000..7210a39 --- /dev/null +++ b/src/store/actions/actionTypes.tsx @@ -0,0 +1,51 @@ +export const MISC_FOLLOW = "MISC_FOLLOW"; +export const MISC_UNFOLLOW = "MISC_UNFOLLOW"; +export const MISC_NOTIFS = "MISC_NOTIFS"; +export const MISC_REPORT = "MISC_REPORT"; +export const MISC_START = "MISC_START"; +export const MISC_FAIL = "MISC_FAIL"; + +export const AUTH_SUCCESS = "AUTH_SUCCESS"; +export const AUTH_FAIL = "AUTH_FAIL"; +export const AUTH_START = "AUTH_START"; +export const AUTH_LOGOUT = "AUTH_LOGOUT"; + +export const ITEM_START = "ITEM_START"; +export const ITEM_SUCCESS = "ITEM_SUCCESS"; +export const ITEM_FAIL = "ITEM_FAIL"; + +export const ITEM_POST_START = "ITEM_POST_START"; +export const ITEM_POST_SUCCESS = "ITEM_POST_SUCCESS"; + +export const ITEM_EDIT_START = "ITEM_EDIT_START"; +export const ITEM_EDIT_SUCCESS = "ITEM_EDIT_SUCCESS"; + +export const ITEM_DEL_START = "ITEM_DEL_START"; +export const ITEM_DEL_SUCCESS = "ITEM_DEL_SUCCESS"; + +export const ITEM_SELLINI_START = "ITEM_SELLINI_START"; +export const ITEM_SELLINI_SUCCESS = "ITEM_SELLINI_SUCCESS"; + +export const ITEM_SELLFIN_START = "ITEM_SELLFIN_START"; +export const ITEM_SELLFIN_SUCCESS = "ITEM_SELLFIN_SUCCESS"; + +export const ITEM_REPORT_SUCCESS = "ITEM_REPORT_SUCCESS"; + +export const REVIEW_START = "REVIEW_START"; +export const REVIEW_SUCCESS = "REVIEW_SUCCESS"; +export const REVIEW_FAIL = "REVIEW_FAIL"; + +export const REVIEW_POST_START = "REVIEW_POST_START"; +export const REVIEW_POST_SUCCESS = "REVIEW_POST_SUCCESS"; + +export const REVIEW_EDIT_START = "REVIEW_EDIT_START"; +export const REVIEW_EDIT_SUCCESS = "REVIEW_EDIT_SUCCESS"; + +export const REVIEW_DEL_START = "REVIEW_DEL_START"; +export const REVIEW_DEL_SUCCESS = "REVIEW_DEL_SUCCESS"; + +export const REVIEW_UPVOTE_SUCCESS = "REVIEW_UPVOTE_SUCCESS"; +export const REVIEW_DOWNVOTE_SUCCESS = "REVIEW_DOWNVOTE_SUCCESS"; + +export const REVIEW_REPORT_SUCCESS = "REVIEW_REPORT_SUCCESS"; +export const REVIEW_RESOLVE_SUCCESS = "REVIEW_RESOLVE_SUCCESS"; diff --git a/src/store/actions/auth.tsx b/src/store/actions/auth.tsx new file mode 100644 index 0000000..88ea84d --- /dev/null +++ b/src/store/actions/auth.tsx @@ -0,0 +1,44 @@ +import * as actionTypes from "./actionTypes"; +import axios from "../../axios-ins"; +import qs from "querystring"; + +export const authStart = () => ({ + type: actionTypes.AUTH_START, +}); + +export const authSuccess = (data) => ({ + type: actionTypes.AUTH_SUCCESS, + data: data, +}); + +export const authFail = (err) => ({ + type: actionTypes.AUTH_FAIL, + data: err, +}); + +export const auth = (data, isSignUp: boolean) => (dispatch) => { + dispatch(authStart()); + let url = "/login"; + if (isSignUp) { + url = "/register"; + } + axios + .post(url, qs.stringify(data)) + .then((res) => { + dispatch(authSuccess(res.data)); + }) + .catch((err) => { + dispatch(authFail(err)); + }); +}; + +export const authLogout = () => (dispatch) => { + axios + .get("/logout") + .then((res) => { + dispatch({ type: actionTypes.AUTH_LOGOUT }); + }) + .catch((err) => { + dispatch(authFail(err)); + }); +}; diff --git a/src/store/actions/chat.tsx b/src/store/actions/chat.tsx new file mode 100644 index 0000000..5614d52 --- /dev/null +++ b/src/store/actions/chat.tsx @@ -0,0 +1,13 @@ +import io from "socket.io-client"; + +export const mountChat = () => (dispatch) => { + const socket = io("http://localhost:5000/chat"); + let stack: Record; + let username: string; + socket.on("connect", () => { + socket.emit("setUserData", username); + }); + socket.on("onlineStack", (sta: Record) => { + stack = sta; + }); +}; diff --git a/src/store/actions/index.tsx b/src/store/actions/index.tsx new file mode 100644 index 0000000..f644ee6 --- /dev/null +++ b/src/store/actions/index.tsx @@ -0,0 +1,2 @@ +export { authSuccess } from "./auth"; +export {} from "./item"; diff --git a/src/store/actions/item.tsx b/src/store/actions/item.tsx new file mode 100644 index 0000000..3091911 --- /dev/null +++ b/src/store/actions/item.tsx @@ -0,0 +1,146 @@ +import axios from "../../axios-ins"; +import * as actionTypes from "./actionTypes"; +import qs from "querystring"; + +export const getItemStart = () => ({ + type: actionTypes.ITEM_START, +}); + +export const getItemSuccess = (data) => ({ + type: actionTypes.ITEM_SUCCESS, + data: data, +}); + +export const postItemStart = () => ({ + type: actionTypes.ITEM_POST_START, +}); + +export const postItemSuccess = (data) => ({ + type: actionTypes.ITEM_POST_SUCCESS, + data: data, +}); + +export const itemFail = (err) => ({ + type: actionTypes.ITEM_FAIL, + err: err, +}); + +export const editItemStart = () => ({ + type: actionTypes.ITEM_EDIT_START, +}); + +export const editItemSuccess = (data) => ({ + type: actionTypes.ITEM_EDIT_SUCCESS, + data: data, +}); + +export const delItemStart = () => ({ + type: actionTypes.ITEM_DEL_START, +}); + +export const delItemSuccess = () => ({ + type: actionTypes.ITEM_DEL_SUCCESS, +}); + +export const sellIniItemStart = () => ({ + type: actionTypes.ITEM_SELLINI_START, +}); + +export const sellIniItemSuccess = () => ({ + type: actionTypes.ITEM_SELLINI_SUCCESS, +}); + +export const sellFinItemStart = () => ({ + type: actionTypes.ITEM_SELLFIN_START, +}); + +export const sellFinItemSuccess = () => ({ + type: actionTypes.ITEM_SELLFIN_SUCCESS, +}); + +export const reportItemSuccess = () => ({ + type: actionTypes.ITEM_REPORT_SUCCESS, +}); + +export const getItem = () => (dispatch) => { + dispatch(getItemStart()); + axios + .get("/item") + .then((res) => { + dispatch(getItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const postItem = (data) => (dispatch) => { + dispatch(postItemStart()); + axios + .post("/item", qs.stringify(data)) + .then((res) => { + dispatch(postItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const editItem = (data, id) => (dispatch) => { + dispatch(editItemStart()); + axios + .put("/item/" + id, qs.stringify(data)) + .then((res) => { + dispatch(editItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const delItem = (id) => (dispatch) => { + dispatch(delItemStart()); + axios + .delete("/item/" + id) + .then((res) => { + dispatch(delItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const selliniItem = (id, data) => (dispatch) => { + dispatch(sellIniItemStart()); + axios + .patch("/item/" + id + "/sellIni", qs.stringify(data)) + .then((res) => { + dispatch(sellIniItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const sellfniItem = (id, data) => (dispatch) => { + dispatch(sellFinItemStart()); + axios + .patch("/item/" + id + "/sellFin", qs.stringify(data)) + .then((res) => { + dispatch(sellFinItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const reportItem = (id) => (dispatch) => { + axios + .patch("/item/" + id + "/report") + .then((res) => { + dispatch(reportItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; diff --git a/src/store/actions/misc.tsx b/src/store/actions/misc.tsx new file mode 100644 index 0000000..681db76 --- /dev/null +++ b/src/store/actions/misc.tsx @@ -0,0 +1,79 @@ +import axios from "axios"; +import * as actionTypes from "./actionTypes"; + +export const miscStart = () => ({ + type: actionTypes.MISC_START, +}); + +export const miscFail = (err) => ({ + type: actionTypes.MISC_FAIL, + err: err, +}); + +export const miscFollow = (category) => ({ + type: actionTypes.MISC_FOLLOW, + cat: category, +}); + +export const miscUnfollow = (category) => ({ + type: actionTypes.MISC_UNFOLLOW, + cat: category, +}); + +export const miscNotifs = (notifs) => ({ + type: actionTypes.MISC_NOTIFS, + notifs: notifs, +}); + +export const miscReport = (rep) => ({ + type: actionTypes.MISC_REPORT, + report: rep, +}); + +export const follow = (cat) => (dispatch) => { + dispatch(miscStart()); + axios + .patch("/follow/" + cat) + .then((res) => { + miscFollow(cat); + }) + .catch((err) => { + miscFail(err); + }); +}; + +export const unfollow = (cat) => (dispatch) => { + dispatch(miscStart()); + axios + .patch("/unfollow/" + cat) + .then((res) => { + miscUnfollow(cat); + }) + .catch((err) => { + miscFail(err); + }); +}; + +export const notifs = () => (dispatch) => { + dispatch(miscStart()); + axios + .get("/notifications") + .then((res) => { + dispatch(miscNotifs(res.data)); + }) + .catch((err) => { + dispatch(miscFail(err)); + }); +}; + +export const report = () => (dispatch) => { + dispatch(miscStart()); + axios + .get("/report") + .then((res) => { + dispatch(miscReport(res.data)); + }) + .catch((err) => { + dispatch(miscFail(err)); + }); +}; diff --git a/src/store/actions/review.tsx b/src/store/actions/review.tsx new file mode 100644 index 0000000..1b9a31b --- /dev/null +++ b/src/store/actions/review.tsx @@ -0,0 +1,151 @@ +import axios from "../../axios-ins"; +import qs from "querystring"; +import * as actionTypes from "./actionTypes"; + +export const getReviewStart = () => ({ + type: actionTypes.REVIEW_START, +}); + +export const getReviewSuccess = (data) => ({ + type: actionTypes.REVIEW_SUCCESS, + data: data, +}); + +export const postReviewStart = () => ({ + type: actionTypes.REVIEW_POST_START, +}); + +export const postReviewSuccess = (data) => ({ + type: actionTypes.REVIEW_POST_SUCCESS, + data: data, +}); + +export const reviewFail = (err) => ({ + type: actionTypes.REVIEW_FAIL, + err: err, +}); + +export const editReviewStart = () => ({ + type: actionTypes.REVIEW_EDIT_START, +}); + +export const editReviewSuccess = (data) => ({ + type: actionTypes.REVIEW_EDIT_SUCCESS, + data: data, +}); + +export const delReviewStart = () => ({ + type: actionTypes.REVIEW_DEL_START, +}); + +export const delReviewSuccess = () => ({ + type: actionTypes.REVIEW_DEL_SUCCESS, +}); + +export const upvoteReviewSuccess = () => ({ + type: actionTypes.REVIEW_UPVOTE_SUCCESS, +}); + +export const downvoteReviewSuccess = () => ({ + type: actionTypes.REVIEW_DOWNVOTE_SUCCESS, +}); + +export const reportReviewSuccess = () => ({ + type: actionTypes.REVIEW_REPORT_SUCCESS, +}); + +export const resolveReviewSuccess = () => ({ + type: actionTypes.REVIEW_RESOLVE_SUCCESS, +}); + +export const getReview = (id) => (dispatch) => { + dispatch(getReviewStart()); + axios + .get("/users/" + id + "/reviews/") + .then((res) => { + dispatch(getReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const postReview = (data, id) => (dispatch) => { + dispatch(postReviewStart()); + axios + .post("/users/" + id + "/reviews/", qs.stringify(data)) + .then((res) => { + dispatch(postReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const editReview = (data, id, reviewId) => (dispatch) => { + dispatch(editReviewStart()); + axios + .put("/users/" + id + "/reviews/" + reviewId, qs.stringify(data)) + .then((res) => { + dispatch(editReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const delReview = (id, reviewId) => (dispatch) => { + dispatch(delReviewStart()); + axios + .delete("/users/" + id + "/reviews/" + reviewId) + .then((res) => { + dispatch(delReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const upvoteReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/upvote") + .then((res) => { + dispatch(upvoteReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const downvoteReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/downvote") + .then((res) => { + dispatch(downvoteReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const reportReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/report") + .then((res) => { + dispatch(reportReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const resolveReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/resolve") + .then((res) => { + dispatch(resolveReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; diff --git a/src/store/reducers/auth.tsx b/src/store/reducers/auth.tsx new file mode 100644 index 0000000..44f672d --- /dev/null +++ b/src/store/reducers/auth.tsx @@ -0,0 +1,7 @@ +const initState = {}; + +const authReducer = (state = initState, action = {}) => { + return state; +}; + +export default authReducer; diff --git a/src/store/reducers/index.tsx b/src/store/reducers/index.tsx new file mode 100644 index 0000000..c682e0e --- /dev/null +++ b/src/store/reducers/index.tsx @@ -0,0 +1,11 @@ +import authReducer from "./auth"; +import itemReducer from "./item"; + +import { combineReducers } from "redux"; + +const rootReducer = combineReducers({ + auth: authReducer, + item: itemReducer, +}); + +export default rootReducer; diff --git a/src/store/reducers/item.tsx b/src/store/reducers/item.tsx new file mode 100644 index 0000000..9db8373 --- /dev/null +++ b/src/store/reducers/item.tsx @@ -0,0 +1,80 @@ +const initState = { + items: [ + { + id: 1, + name: "Asus Laptop", + price: 40000, + category: "laptop", + image: "/images/laptop.jfif", + }, + { + id: 2, + name: "Macbook Air", + price: 60000, + category: "laptop", + image: "/images/laptop.jfif", + }, + { + id: 3, + name: "Hero Thunderbird", + price: 4000, + category: "bicycle", + image: "/images/bicycle.jfif", + }, + { + id: 4, + name: "Decathlon BTWX 100", + price: 5000, + category: "bicycle", + image: "/images/bicycle.jfif", + }, + { + id: 5, + name: "Samsung S10e", + price: 25000, + category: "mobile", + image: "/images/mobile.jfif", + }, + { + id: 6, + name: "Vivo V15", + price: 14000, + category: "mobile", + image: "/images/mobile.jfif", + }, + { + id: 7, + name: "Kurl On memory foam ", + price: 2000, + category: "matteress", + image: "/images/matteress.jfif", + }, + { + id: 8, + name: "SleepX", + price: 1500, + category: "matteress", + image: "/images/matteress.jfif", + }, + { + id: 9, + name: "Order of the phoenix", + price: 300, + category: "book", + image: "/images/book.jfif", + }, + { + id: 10, + name: "Differential Equation - Kreyzig", + price: 200, + category: "book", + image: "/images/book.jfif", + }, + ], +}; + +const itemReducer = (state = initState, action) => { + return state; +}; + +export default itemReducer; From 08037696e1d2131128b143f02b03700de0547b67 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Sun, 31 May 2020 17:36:20 +0530 Subject: [PATCH 6/7] lint errors --- package-lock.json | 5 - package.json | 1 - src/App.test.tsx | 14 +- src/App.tsx | 187 +++++++------- src/axios-ins.tsx | 8 +- src/components/CategoryCard/CategoryCard.tsx | 136 +++++------ src/components/HeaderCard/HeaderCard.css | 8 +- src/components/HeaderCard/HeaderCard.tsx | 72 +++--- src/components/ItemCard/ItemCard.tsx | 33 +-- src/components/ItemDetail/ItemDetail.tsx | 167 +++++++------ src/components/ItemList/ItemList.tsx | 53 ++-- src/components/PostAd/PostAd.css | 5 +- src/components/PostAd/PostAd.tsx | 244 +++++++++---------- src/components/RegisterForm/RegisterForm.tsx | 160 ++++++------ src/components/SearchBar/SearchBar.css | 4 +- src/components/SearchBar/SearchBar.tsx | 29 ++- src/index.tsx | 21 +- src/pages/Health/Health.tsx | 16 +- src/pages/categories/categories.tsx | 38 +-- src/pages/chats/chats.tsx | 37 +-- src/pages/home/home.tsx | 173 ++++++------- src/pages/home/home2.tsx | 221 +++++++---------- src/pages/myaccount/myaccount.css | 22 +- src/pages/myaccount/myaccount.tsx | 158 +++--------- src/pages/register/register.tsx | 28 ++- src/serviceWorker.ts | 216 ++++++++-------- src/setupTests.ts | 2 +- src/store/actions/actionTypes.tsx | 77 +++--- src/store/actions/auth.tsx | 70 +++--- src/store/actions/chat.tsx | 20 +- src/store/actions/index.tsx | 4 +- src/store/actions/item.tsx | 229 +++++++++-------- src/store/actions/misc.tsx | 122 +++++----- src/store/actions/review.tsx | 242 +++++++++--------- src/store/reducers/auth.tsx | 10 +- src/store/reducers/index.tsx | 16 +- src/store/reducers/item.tsx | 154 ++++++------ 37 files changed, 1388 insertions(+), 1614 deletions(-) diff --git a/package-lock.json b/package-lock.json index c859a29..0c5799c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10829,11 +10829,6 @@ "whatwg-fetch": "^3.0.0" } }, - "react-axios": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/react-axios/-/react-axios-2.0.3.tgz", - "integrity": "sha512-63kY2iupdRgbvPq9G8xmM0NWUnt2Q5YmpotMoLQsxKOzKXKZg2Lo6CzF/bcZvtmv3WnfjBU6Bg8nZQO28eIAZw==" - }, "react-dev-utils": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", diff --git a/package.json b/package.json index 2a9aee4..6792182 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "ionicons": "^5.0.0", "querystring": "^0.2.0", "react": "^16.13.0", - "react-axios": "^2.0.3", "react-dom": "^16.13.0", "react-redux": "^7.2.0", "react-router": "^5.1.2", diff --git a/src/App.test.tsx b/src/App.test.tsx index ae51219..25e68dc 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,10 +1,10 @@ -import React from "react"; -import { render } from "@testing-library/react"; -import App from "./App"; +import React from 'react'; +import { render } from '@testing-library/react'; +import App from './App'; // eslint-disable-next-line no-undef -test("renders without crashing", () => { - const { baseElement } = render(); - // eslint-disable-next-line no-undef - expect(baseElement).toBeDefined(); +test('renders without crashing', () => { + const { baseElement } = render(); + // eslint-disable-next-line no-undef + expect(baseElement).toBeDefined(); }); diff --git a/src/App.tsx b/src/App.tsx index 1b58861..0985b5d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,109 +1,110 @@ -import React from "react"; -import { Redirect, Route } from "react-router-dom"; -import axios from "axios"; -import qs from "querystring"; -import { connect } from "react-redux"; +import React from 'react'; +import { Redirect, Route } from 'react-router-dom'; +import axios from 'axios'; +import qs from 'querystring' +import {connect} from 'react-redux' import { - IonApp, - IonIcon, - IonLabel, - IonRouterOutlet, - IonTabBar, - IonTabButton, - IonTabs, -} from "@ionic/react"; -import { IonReactRouter } from "@ionic/react-router"; + IonApp, + IonIcon, + IonLabel, + IonRouterOutlet, + IonTabBar, + IonTabButton, + IonTabs, +} from '@ionic/react'; +import { IonReactRouter } from '@ionic/react-router'; import { - chatboxOutline, - gridOutline, - homeOutline, - personOutline, -} from "ionicons/icons"; -import Home from "./pages/home/home"; -import Categories from "./pages/categories/categories"; -import Chats from "./pages/chats/chats"; -import MyAccount from "./pages/myaccount/myaccount"; + chatboxOutline, + gridOutline, + homeOutline, + personOutline, +} from 'ionicons/icons'; +import Home from './pages/home/home'; +import Categories from './pages/categories/categories'; +import Chats from './pages/chats/chats'; +import MyAccount from './pages/myaccount/myaccount'; /* new imports */ -import Register from "./pages/register/register"; -import Health from "./pages/Health/Health"; -import ItemDetail from "./components/ItemDetail/ItemDetail"; -import PostAd from "./components/PostAd/PostAd"; +import Register from './pages/register/register'; +import Health from './pages/Health/Health'; +import ItemDetail from './components/ItemDetail/ItemDetail'; + +import PostAd from './components/PostAd/PostAd'; /* Core CSS required for Ionic components to work properly */ -import "@ionic/react/css/core.css"; +import '@ionic/react/css/core.css'; /* Basic CSS for apps built with Ionic */ -import "@ionic/react/css/normalize.css"; -import "@ionic/react/css/structure.css"; -import "@ionic/react/css/typography.css"; +import '@ionic/react/css/normalize.css'; +import '@ionic/react/css/structure.css'; +import '@ionic/react/css/typography.css'; /* Optional CSS utils that can be commented out */ -import "@ionic/react/css/padding.css"; -import "@ionic/react/css/float-elements.css"; -import "@ionic/react/css/text-alignment.css"; -import "@ionic/react/css/text-transformation.css"; -import "@ionic/react/css/flex-utils.css"; -import "@ionic/react/css/display.css"; +import '@ionic/react/css/padding.css'; +import '@ionic/react/css/float-elements.css'; +import '@ionic/react/css/text-alignment.css'; +import '@ionic/react/css/text-transformation.css'; +import '@ionic/react/css/flex-utils.css'; +import '@ionic/react/css/display.css'; /* Theme variables */ -import "./theme/variables.css"; -import { authSuccess } from "./store/actions/index"; +import './theme/variables.css'; +import {authSuccess} from './store/actions/index' class App extends React.Component { - componentDidMount() { - const eventUser = new EventSource("http://localhost:5000/streamUser"); - eventUser.onmessage = (e) => this.props.changeUser(e.data); - const data = { - username: "ssh", - password: "12345", - }; - axios - .post("http://localhost:5000/login", qs.stringify(data)) - .then((res) => console.log(res)) - .catch((err) => console.log(err.response)); - } - render() { - return ( - - - - - - - - - - - - - - - - - - Home - - - - Categories - - - - Chats - - - - My Account - - - - - - ); - } + componentDidMount() { + const eventUser = new EventSource('http://localhost:5000/streamUser'); + eventUser.onmessage = e => this.props.changeUser(e.data) + const data = { + username: 'ssh', + password: '12345' + } + axios + .post('http://localhost:5000/login', qs.stringify(data)) + .then((res) => console.log(res)) + .catch((err) => console.log(err.response)); + } + render() { + return ( + + + + + + + + + + + + + + + + + + Home + + + + Categories + + + + Chats + + + + My Account + + + + + + ); + } } -const mapDispatchToProps = (dispatch) => ({ - changeUser: (data) => dispatch(authSuccess(data)), -}); +const mapDispatchToProps = dispatch => ({ + changeUser : (data) => dispatch(authSuccess(data)) +}) export default connect(null, mapDispatchToProps)(App); diff --git a/src/axios-ins.tsx b/src/axios-ins.tsx index c11f0c5..7d45821 100644 --- a/src/axios-ins.tsx +++ b/src/axios-ins.tsx @@ -1,7 +1,7 @@ -import axios from "axios"; +import axios from 'axios' const instance = axios.create({ - baseURL: "http://localhost:5000", -}); + baseURL: 'http://localhost:5000' +}) -export default instance; +export default instance; \ No newline at end of file diff --git a/src/components/CategoryCard/CategoryCard.tsx b/src/components/CategoryCard/CategoryCard.tsx index 21a3f2e..589dbc5 100644 --- a/src/components/CategoryCard/CategoryCard.tsx +++ b/src/components/CategoryCard/CategoryCard.tsx @@ -1,85 +1,71 @@ -import React from "react"; -import { - IonGrid, - IonRow, - IonCol, - IonIcon, - IonLabel, - IonText, - IonChip, -} from "@ionic/react"; -import { - bicycle, - laptopOutline, - phonePortraitOutline, - tabletLandscapeOutline, - bookOutline, - constructOutline, -} from "ionicons/icons"; -import "./CategoryCard.css"; +import React from 'react'; +import { IonGrid, IonRow, IonCol, IonIcon, IonLabel, IonText,IonChip } from '@ionic/react'; +import { bicycle, laptopOutline, phonePortraitOutline, tabletLandscapeOutline, bookOutline, constructOutline} from 'ionicons/icons'; +import './CategoryCard.css'; + const CategoryCard: React.FC = () => ( - - - - - - -
Laptops
-
-
-
+ + + + + + + +
Laptops
+
+
+ + + + +
Bicycles
+
+
+ +
+ + + + + + +
Phones
+
+
+ + + + +
Matteresses
+
+
+ +
+ + + + + + +
Books
+
+
- - - - -
Bicycles
-
-
-
-
+ + + +
Misc.
+
+
- - - - - -
Phones
-
-
-
+ - - - - -
Matteresses
-
-
-
-
+
- - - - - -
Books
-
-
-
+
+ - - - - -
Misc.
-
-
-
- - ); export default CategoryCard; diff --git a/src/components/HeaderCard/HeaderCard.css b/src/components/HeaderCard/HeaderCard.css index 400d777..b02d93c 100644 --- a/src/components/HeaderCard/HeaderCard.css +++ b/src/components/HeaderCard/HeaderCard.css @@ -17,11 +17,9 @@ width: 200px; text-align: center; - display: inline-block; + margin-left: auto; + margin-right: auto; + display: flex; align-items: center; justify-content: center; - padding-left: 10px; -} -.wrapper { - text-align: center; } diff --git a/src/components/HeaderCard/HeaderCard.tsx b/src/components/HeaderCard/HeaderCard.tsx index 57466af..f42f089 100644 --- a/src/components/HeaderCard/HeaderCard.tsx +++ b/src/components/HeaderCard/HeaderCard.tsx @@ -1,42 +1,42 @@ -import React from "react"; +import React from 'react'; import { - IonCardHeader, - IonCardTitle, - IonCardContent, - IonCard, - IonButton, -} from "@ionic/react"; -import "./HeaderCard.css"; -import SearchBar from "../SearchBar/SearchBar"; -import { RouteComponentProps } from "react-router-dom"; + IonCardHeader, + IonCardTitle, + IonCardContent, + IonCard, + IonButton, +} from '@ionic/react'; +import './HeaderCard.css'; +import SearchBar from '../SearchBar/SearchBar'; +import { RouteComponentProps } from 'react-router-dom' const HeaderCard: React.FC = (props) => { - const clicked = (route: string) => { - props.history.push(route); - }; - return ( - - - Welcome To - IITD Marketplace - - - Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, we got - you covered ! - - -
- - Sign in to start - - - - Login - -
-
-
- ); + const clicked = (route: string) => { + props.history.push(route); + } + return ( + + + Welcome To + + IITD Marketplace + + + + Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, + we got you covered ! + + + + clicked("/register")}> + Sign in to start + + clicked('/login')}> + Login + + + + ); }; export default HeaderCard; diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx index 34a68c8..f0dc75f 100644 --- a/src/components/ItemCard/ItemCard.tsx +++ b/src/components/ItemCard/ItemCard.tsx @@ -1,20 +1,21 @@ -import React from "react"; -import { IonCard, IonCardHeader, IonCardSubtitle } from "@ionic/react"; +import React from 'react'; +import { IonCard, IonCardHeader, IonCardSubtitle } from '@ionic/react'; -class ItemCard extends React.Component { - render() { - const { item } = this.props; - return ( -
- - cardImg - - {item.name} Rs. {item.price} - - -
- ); - } +class ItemCard extends React.Component { + render() { + const { item } = this.props; + return ( +
+ + cardImg + + {item.name} Rs.{' '} + {item.price} + + +
+ ); + } } export default ItemCard; diff --git a/src/components/ItemDetail/ItemDetail.tsx b/src/components/ItemDetail/ItemDetail.tsx index b0ee839..0c66406 100644 --- a/src/components/ItemDetail/ItemDetail.tsx +++ b/src/components/ItemDetail/ItemDetail.tsx @@ -1,86 +1,93 @@ -import React from "react"; +import React from 'react'; import { - IonContent, - IonHeader, - IonPage, - IonChip, - IonToolbar, - IonCard, - IonCardHeader, - IonCardSubtitle, - IonCardTitle, - IonCardContent, - IonIcon, - IonLabel, - IonButton, - IonText, -} from "@ionic/react"; -import { locationOutline } from "ionicons/icons"; + IonContent, + IonHeader, + IonPage, + IonChip, + IonToolbar, + IonCard, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, + IonCardContent, + IonIcon, + IonLabel, + IonButton, + IonText, +} from '@ionic/react'; +import { locationOutline } from 'ionicons/icons'; const ItemDetail: React.FC = () => { - return ( - - - - - - Asus Tuf GT505 - - Rs. 40000 - - - - - - - - Electronics - - - Laptops - - - - - - Seller Details - - - N. Satwik - -

- {" "} - Zanskar House -

-
- - Chat With Seller - -
-
- - - Product Details - - -
    -
  • 4 months old
  • -
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • -
  • RGB keyboard
  • -
  • ...
  • -
  • ...
  • -
-
-
- - - Reviews - - - -
-
- ); + return ( + + + + + + Asus Tuf GT505 + + Rs. 40000 + + + + + + + + Electronics + + + Laptops + + + + + + Seller Details + + + N. Satwik + +

+ {' '} + {' '} + Zanskar House +

+
+ + Chat With Seller + +
+
+ + + Product Details + + +
    +
  • 4 months old
  • +
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • +
  • RGB keyboard
  • +
  • ...
  • +
  • ...
  • +
+
+
+ + + Reviews + + + +
+
+ ); }; export default ItemDetail; diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index 7f1b7a5..af70ac4 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,30 +1,33 @@ -import React from "react"; -import { IonCol, IonRow } from "@ionic/react"; -import ItemCard from "../ItemCard/ItemCard"; +import React from 'react'; +import { IonCol, IonRow } from '@ionic/react'; +import ItemCard from '../ItemCard/ItemCard'; // import categories from '../../pages/categories/categories'; -class ItemList extends React.Component { - render() { - const itemList = this.props.items.map((item) => { - if (this.props.category === "all") { - return ( - - - - ); - } - if (this.props.category === item.category) { - return ( - - - - ); - } else { - return null; - } - }); - return {itemList}; - } + +class ItemList extends React.Component{ + render() { + + const itemList = this.props.items.map((item) => { + if (this.props.category === 'all') { + return ( + + + + ); + } + if (this.props.category === item.category) { + return ( + + + + ); + } else { + return null; + } + }); + + return {itemList}; + } } export default ItemList; diff --git a/src/components/PostAd/PostAd.css b/src/components/PostAd/PostAd.css index 849da90..deeebdd 100644 --- a/src/components/PostAd/PostAd.css +++ b/src/components/PostAd/PostAd.css @@ -2,7 +2,4 @@ align-content: center; width:20%; } -.btn { - text-align: center; - -} \ No newline at end of file + \ No newline at end of file diff --git a/src/components/PostAd/PostAd.tsx b/src/components/PostAd/PostAd.tsx index 0a00b53..3ade72d 100644 --- a/src/components/PostAd/PostAd.tsx +++ b/src/components/PostAd/PostAd.tsx @@ -1,133 +1,127 @@ -import React, { useState } from "react"; +import React, { useState } from 'react'; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import "./PostAd.css"; -import { RouteComponentProps } from "react-router"; +import './PostAd.css'; +import { RouteComponentProps } from 'react-router'; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, - IonPage, - IonContent, - IonHeader, - IonButtons, - IonBackButton, -} from "@ionic/react"; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, + IonPage, + IonContent, +} from '@ionic/react'; const PostAd: React.FC = () => { - const [name, setName] = useState(); - const [date, setDate] = useState(); - const [condition, setCondition] = useState(); - const [price, setPrice] = useState(); - const [category, setCategory] = useState(); - const [description, setDescription] = useState(); + const [name, setName] = useState(); + const [date, setDate] = useState(); + const [condition, setCondition] = useState(); + const [price, setPrice] = useState(); + const [category, setCategory] = useState(); + const [description, setDescription] = useState(); - return ( - - - - - - - - - Post Your Ad - - - -
- - - - Name of The Product - - setName(e.detail.value!)} - required - /> - - - - Tentative Date of Purchase - - setDate(e.detail.value!)} - required - /> - - - - Condition - - setCondition(e.detail.value!)} - required - /> - - - - Category - - setCategory(e.detail.value)} - > - Laptops - Mobile - Books - Cycle - Miscallaneous - - - - - Asking Price - - setPrice(e.detail.value!)} - required - /> - - - - Description - - setDescription(e.detail.value!)} - required - /> - - - - - -
-
- - Post - -
-
-
- ); + return ( + + + + Post Your Ad + +
+ + + + Name of The Product + + setName(e.detail.value!)} + required + /> + + + + Tentative Date of Purchase + + setDate(e.detail.value!)} + required + /> + + + + Condition + + + setCondition(e.detail.value!) + } + required + /> + + + + Category + + setCategory(e.detail.value)} + > + Laptops + Mobile + Books + Cycle + Miscallaneous + + + + + Asking Price + + setPrice(e.detail.value!)} + required + /> + + + + Description + + + setDescription(e.detail.value!) + } + required + /> + + + + + +
+
+ + Post + +
+
+
+ ); }; export default PostAd; diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx index 2eaf6c2..3acef6f 100644 --- a/src/components/RegisterForm/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -1,87 +1,87 @@ -import React, { useState } from "react"; +import React, { useState } from 'react'; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, -} from "@ionic/react"; -import "./RegisterForm.css"; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, +} from '@ionic/react'; +import './RegisterForm.css'; const RegisterForm: React.FC = () => { - const [uname, setUname] = useState(); - const [pass, setPass] = useState(); - const [entryno, setEntryno] = useState(); - const [hostel, setHostel] = useState(); + const [uname, setUname] = useState(); + const [pass, setPass] = useState(); + const [entryno, setEntryno] = useState(); + const [hostel, setHostel] = useState(); - return ( -
- - Join us today ! - -
- - - - Username - - setUname(e.detail.value!)} - required - /> - - - - Password - - setPass(e.detail.value!)} - required - /> - - - - Entry Number - - setEntryno(e.detail.value!)} - required - /> - - - - Hostel - - setHostel(e.detail.value)} - > - Aravalli - Girnar - Jwalamukhi - Himadri - Zanskar - - - -
-
- - Register - -
-
- ); + return ( +
+ + Join us today ! + +
+ + + + Username + + setUname(e.detail.value!)} + required + /> + + + + Password + + setPass(e.detail.value!)} + required + /> + + + + Entry Number + + setEntryno(e.detail.value!)} + required + /> + + + + Hostel + + setHostel(e.detail.value)} + > + Aravalli + Girnar + Jwalamukhi + Himadri + Zanskar + + + +
+
+ + Register + +
+
+ ); }; export default RegisterForm; diff --git a/src/components/SearchBar/SearchBar.css b/src/components/SearchBar/SearchBar.css index d19a6e1..b896f4a 100644 --- a/src/components/SearchBar/SearchBar.css +++ b/src/components/SearchBar/SearchBar.css @@ -1,3 +1,3 @@ .searchbar{ - -} + align-self: start; +} \ No newline at end of file diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 671aa17..3638167 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,20 +1,19 @@ -import React, { useState } from "react"; -import { IonToolbar, IonSearchbar } from "@ionic/react"; -import "./SearchBar.css"; +import React, { useState } from 'react'; +import { IonToolbar, IonSearchbar } from '@ionic/react'; +import './SearchBar.css'; const SearchBar: React.FC = () => { - const [searchText, setSearchText] = useState(""); - return ( - - setSearchText(e.detail.value!)} - placeholder="Search" - /> - - ); + const [searchText, setSearchText] = useState(''); + return ( + + setSearchText(e.detail.value!)} + placeholder="Search" + /> + + ); }; export default SearchBar; diff --git a/src/index.tsx b/src/index.tsx index f075bbf..427ebae 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,17 +1,12 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import App from "./App"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; -import { createStore, applyMiddleware } from "redux"; -import rootReducer from "./store/reducers"; -import thunk from "redux-thunk"; -import { Provider } from "react-redux"; +import { createStore, applyMiddleware } from 'redux' +import rootReducer from './store/reducers' +import thunk from 'redux-thunk' +import { Provider } from 'react-redux' const store = createStore(rootReducer, applyMiddleware(thunk)); -ReactDOM.render( - - - , - document.getElementById("root") -); +ReactDOM.render(, document.getElementById('root')); diff --git a/src/pages/Health/Health.tsx b/src/pages/Health/Health.tsx index 3526d85..8368aaf 100644 --- a/src/pages/Health/Health.tsx +++ b/src/pages/Health/Health.tsx @@ -1,13 +1,13 @@ -import React from "react"; -import { withRouter } from "react-router-dom"; -import { IonPage } from "@ionic/react"; +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import { IonPage } from '@ionic/react'; const Health: React.FC = () => { - return ( - -

Ok, Healthy!

-
- ); + return ( + +

Ok, Healthy!

+
+ ); }; export default withRouter(Health); diff --git a/src/pages/categories/categories.tsx b/src/pages/categories/categories.tsx index b4d0390..51d005e 100644 --- a/src/pages/categories/categories.tsx +++ b/src/pages/categories/categories.tsx @@ -1,32 +1,16 @@ -import React from "react"; -import { - IonContent, - IonPage, - IonHeader, - IonToolbar, - IonButtons, - IonBackButton, - IonTitle, -} from "@ionic/react"; -import CategoryCard from "../../components/CategoryCard/CategoryCard"; -import { RouteComponentProps } from "react-router"; +import React from 'react'; +import { IonContent, IonPage } from '@ionic/react'; +import CategoryCard from '../../components/CategoryCard/CategoryCard'; +import { RouteComponentProps } from 'react-router'; const categories: React.FC = (props) => { - return ( - - - - - - - Categories - - - - - - - ); + return ( + + + + + + ); }; export default categories; diff --git a/src/pages/chats/chats.tsx b/src/pages/chats/chats.tsx index e9705cb..f34d0d6 100644 --- a/src/pages/chats/chats.tsx +++ b/src/pages/chats/chats.tsx @@ -1,31 +1,16 @@ -import React from "react"; -import { - IonContent, - IonPage, - IonHeader, - IonToolbar, - IonButtons, - IonBackButton, - IonTitle, -} from "@ionic/react"; -import HeaderCard from "../../components/HeaderCard/HeaderCard"; -import { RouteComponentProps } from "react-router"; +import React from 'react'; +import { IonContent, IonPage } from '@ionic/react'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import { RouteComponentProps } from 'react-router'; const chats: React.FC = (props) => { - return ( - - - - - - - - Chats - - - - - ); + return ( + + + + + + ); }; export default chats; diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index a9c502f..0aa358c 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -1,101 +1,90 @@ -import React from "react"; +import React from 'react'; import { - IonContent, - IonLabel, - IonSegment, - IonSegmentButton, - IonPage, - IonFab, - IonFabButton, - IonIcon, - IonToolbar, - IonFabList, - IonHeader, - IonRow, - IonCol, - IonButtons, - IonBackButton, - IonTitle, -} from "@ionic/react"; -import { add, createOutline } from "ionicons/icons"; -import "./home.css"; -import HeaderCard from "../../components/HeaderCard/HeaderCard"; -import ItemList from "../../components/ItemList/ItemList"; -import { connect } from "react-redux"; -import { RouteComponentProps } from "react-router"; -import SearchBar from "../../components/SearchBar/SearchBar"; + IonContent, + IonLabel, + IonSegment, + IonSegmentButton, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonFabList, +} from '@ionic/react'; +import { add, createOutline } from 'ionicons/icons'; +import './home.css'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import ItemList from '../../components/ItemList/ItemList'; +// import CategoryCard from '../../components/CategoryCard/CategoryCard'; + +import { connect } from 'react-redux'; +import { RouteComponentProps } from 'react-router'; class Home extends React.Component { - // eslint-disable-next-line react/destructuring-assignment - // eslint-disable-next-line react/state-in-constructor - state = { - category: "all", - }; - render() { - return ( - - - - - - - - - - - - - - - - - this.setState({ category: e.detail.value })} - color="primary" - > - - All - - - Laptops - - - Mobiles - - - Bicycles - - - Books - - - - - - - - - - this.props.history.push("/postad")} - > - - {/* Post an Ad */} - - - - - - ); - } + // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: 'all', + }; + render() { + return ( + + + + + + this.setState({ category: e.detail.value }) + } + color="primary" + > + + All + + + Laptops + + + Mobiles + + + Bicycles + + + Books + + + + + + + + + + this.props.history.push('/postad')}> + + {/* Post an Ad */} + + + + + + ); + } } const mapStatetoProps = (state: any) => { - return { - items: state.item.items, - }; + return { + items: state.item.items, + }; }; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/home/home2.tsx b/src/pages/home/home2.tsx index ebef08e..5c796ac 100644 --- a/src/pages/home/home2.tsx +++ b/src/pages/home/home2.tsx @@ -1,150 +1,95 @@ -import React from "react"; -import { - IonContent, - IonLabel, - IonSegment, - IonSegmentButton, - IonPage, - IonFab, - IonFabButton, - IonIcon, - IonToolbar, - IonFabList, - IonHeader, - IonText, - IonRow, - IonCol, - IonCard, -} from "@ionic/react"; -import { - add, - notificationsOutline, - personCircle, - heart, - heartOutline, - heartHalf, - checkmarkCircle, - lockClosed, - analytics, - ribbon, - ribbonOutline, -} from "ionicons/icons"; -import "./home2.css"; -import HeaderCard from "../../components/HeaderCard/HeaderCard"; -import ItemList from "../../components/ItemList/ItemList"; +import React from 'react'; +import { IonContent, IonLabel,IonSegment, IonSegmentButton, IonPage, IonFab, IonFabButton, IonIcon, IonToolbar, IonFabList, IonHeader, IonText, IonRow, IonCol, IonCard, } from '@ionic/react'; +import { add, notificationsOutline, personCircle, heart, heartOutline, heartHalf, checkmarkCircle, lockClosed, analytics, ribbon, ribbonOutline } from 'ionicons/icons'; +import './home2.css'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import ItemList from '../../components/ItemList/ItemList'; -import { connect } from "react-redux"; -import { RouteComponentProps } from "react-router"; -import SearchBar from "../../components/SearchBar/SearchBar"; -import CategoryCard from "../../components/CategoryCard/CategoryCard"; +import { connect } from 'react-redux'; +import { RouteComponentProps } from 'react-router'; + +import SearchBar from '../../components/SearchBar/SearchBar' +import CategoryCard from '../../components/CategoryCard/CategoryCard'; + class Home extends React.Component { - // eslint-disable-next-line react/destructuring-assignment - // eslint-disable-next-line react/state-in-constructor - state = { - category: "all", - }; - render() { - return ( - - - - - - - - - - - - - - - - -
- Safe -
-
- - - -
- Secure -
-
-
- - - - -
- Dynamic -
-
- - - -
- Friendly -
-
-
-
+ // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: 'all', + }; + render() { + return ( + + + + + + + + + + + + + + + + +
+ Safe +
+
+ + +
+ Secure +
+
+
+ + + +
+ Dynamic +
+
+ + +
+ Friendly +
+
+
+
+ + +

Choose a category

+ +
+ + + + + + this.props.history.push('/postad')} /> + + + +
- - -

Choose a category

-
- -
- - - this.props.history.push("/postad")} - /> - - -
-
- ); - } + + + ); + } } const mapStatetoProps = (state: any) => { - return { - items: state.item.items, - }; + return { + items: state.item.items, + }; }; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/myaccount/myaccount.css b/src/pages/myaccount/myaccount.css index b583f12..0afcaf6 100644 --- a/src/pages/myaccount/myaccount.css +++ b/src/pages/myaccount/myaccount.css @@ -1,20 +1,6 @@ -.effect { - border: 1px solid #ccc; - padding: 7px 14px; - - background: transparent; - color:black; -} -.avatar { - height:100px; - width:100px; - position: relative; - display: block; - margin-left: auto; - margin-right: auto; -} - -.colgap { - padding-bottom: 30px ; +.buttons{ + text-align: center; + padding:2em; + padding-top:6em; } \ No newline at end of file diff --git a/src/pages/myaccount/myaccount.tsx b/src/pages/myaccount/myaccount.tsx index 6d938e4..2b41383 100644 --- a/src/pages/myaccount/myaccount.tsx +++ b/src/pages/myaccount/myaccount.tsx @@ -1,123 +1,43 @@ -import React from "react"; +import React from 'react'; import { - IonContent, - IonHeader, - IonButton, - IonItem, - IonLabel, - IonToolbar, - IonTitle, - IonGrid, - IonRow, - IonCol, - IonInput, - IonSegment, - IonSegmentButton, - IonPage, - IonBackButton, - IonButtons, -} from "@ionic/react"; -import "./myaccount.css"; + IonContent, + IonHeader, + IonPage, + IonItem, + IonLabel, + IonThumbnail, + IonToolbar, +} from '@ionic/react'; +import './myaccount.css'; +import HeaderCard from '../../components/HeaderCard/HeaderCard'; +import { RouteComponentProps } from 'react-router'; -const Myaccount: React.FC = () => { - return ( - - - - - - - Profile - - - -
- - - -
- - - - Profile - - - Buy/Sell History - - - - - - -
- Name -
- -
- -
-
- -
- Entry No. -
-
- -
-
- - -
- Phone No. -
-
- -
-
- -
- Email -
- -
- -
-
- - -
- Hostel -
-
- -
-
- - - Update Info - -
- - - Get on PlayStore - - - Get on AppStore - - - - - Contact For Help - - -
-
-
- ); +const myaccount: React.FC = (props) => { + return ( + + + +

+
+ + Guest User + + + + +
+
+
+
+
+ + + +
+ ); }; -export default Myaccount; +export default myaccount; diff --git a/src/pages/register/register.tsx b/src/pages/register/register.tsx index 15c1387..c919f8b 100644 --- a/src/pages/register/register.tsx +++ b/src/pages/register/register.tsx @@ -1,16 +1,20 @@ -import React from "react"; -import RegisterForm from "../../components/RegisterForm/RegisterForm"; -import { IonPage } from "@ionic/react"; -import { RouteComponentProps } from "react-router"; +import React from 'react' +import RegisterForm from '../../components/RegisterForm/RegisterForm' +import {IonPage} from '@ionic/react' +import {RouteComponentProps} from 'react-router' class Register extends React.Component { - state = { - isSignUp: true, - }; - render() { - let register = ; - return {register}; - } + state = { + isSignUp: true + } + render() { + let register = + return ( + + {register} + + ) + } } -export default Register; +export default Register; \ No newline at end of file diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index 73c4506..35e67cb 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -11,132 +11,136 @@ // opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( - window.location.hostname === "localhost" || - // [::1] is the IPv6 localhost address. - window.location.hostname === "[::1]" || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.0/8 are considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) ); type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; + onSuccess?: (registration: ServiceWorkerRegistration) => void; + onUpdate?: (registration: ServiceWorkerRegistration) => void; }; export function register(config?: Config) { - if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL!, window.location.href); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL( + process.env.PUBLIC_URL!, + window.location.href + ); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return; + } - window.addEventListener("load", () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - "This web app is being served cache-first by a service " + - "worker. To learn more, visit https://bit.ly/CRA-PWA" - ); + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit https://bit.ly/CRA-PWA' + ); + }); + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } - }); - } + } } function registerValidSW(swUrl: string, config?: Config) { - navigator.serviceWorker - .register(swUrl) - .then((registration) => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === "installed") { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - "New content is available and will be used when all " + - "tabs for this page are closed. See https://bit.ly/CRA-PWA." - ); + navigator.serviceWorker + .register(swUrl) + .then((registration) => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + 'New content is available and will be used when all ' + + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + ); - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log("Content is cached for offline use."); + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.'); - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch((error) => { - console.error("Error during service worker registration:", error); - }); + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch((error) => { + console.error('Error during service worker registration:', error); + }); } function checkValidServiceWorker(swUrl: string, config?: Config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { "Service-Worker": "script" }, - }) - .then((response) => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get("content-type"); - if ( - response.status === 404 || - (contentType != null && contentType.indexOf("javascript") === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then((registration) => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl, { + headers: { 'Service-Worker': 'script' }, }) - .catch(() => { - console.log( - "No internet connection found. App is running in offline mode." - ); - }); + .then((response) => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get('content-type'); + if ( + response.status === 404 || + (contentType != null && + contentType.indexOf('javascript') === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then((registration) => { + registration.unregister().then(() => { + window.location.reload(); + }); + }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + 'No internet connection found. App is running in offline mode.' + ); + }); } export function unregister() { - if ("serviceWorker" in navigator) { - navigator.serviceWorker.ready.then((registration) => { - registration.unregister(); - }); - } + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then((registration) => { + registration.unregister(); + }); + } } diff --git a/src/setupTests.ts b/src/setupTests.ts index 5fdf001..74b1a27 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -2,4 +2,4 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom -import "@testing-library/jest-dom/extend-expect"; +import '@testing-library/jest-dom/extend-expect'; diff --git a/src/store/actions/actionTypes.tsx b/src/store/actions/actionTypes.tsx index 7210a39..dd03c21 100644 --- a/src/store/actions/actionTypes.tsx +++ b/src/store/actions/actionTypes.tsx @@ -1,51 +1,54 @@ -export const MISC_FOLLOW = "MISC_FOLLOW"; -export const MISC_UNFOLLOW = "MISC_UNFOLLOW"; -export const MISC_NOTIFS = "MISC_NOTIFS"; -export const MISC_REPORT = "MISC_REPORT"; -export const MISC_START = "MISC_START"; -export const MISC_FAIL = "MISC_FAIL"; +export const MISC_FOLLOW = 'MISC_FOLLOW' +export const MISC_UNFOLLOW = 'MISC_UNFOLLOW' +export const MISC_NOTIFS = 'MISC_NOTIFS' +export const MISC_REPORT = 'MISC_REPORT' +export const MISC_START = 'MISC_START' +export const MISC_FAIL = 'MISC_FAIL' -export const AUTH_SUCCESS = "AUTH_SUCCESS"; -export const AUTH_FAIL = "AUTH_FAIL"; -export const AUTH_START = "AUTH_START"; -export const AUTH_LOGOUT = "AUTH_LOGOUT"; -export const ITEM_START = "ITEM_START"; -export const ITEM_SUCCESS = "ITEM_SUCCESS"; -export const ITEM_FAIL = "ITEM_FAIL"; +export const AUTH_SUCCESS = 'AUTH_SUCCESS' +export const AUTH_FAIL = 'AUTH_FAIL' +export const AUTH_START = 'AUTH_START' +export const AUTH_LOGOUT = 'AUTH_LOGOUT' -export const ITEM_POST_START = "ITEM_POST_START"; -export const ITEM_POST_SUCCESS = "ITEM_POST_SUCCESS"; -export const ITEM_EDIT_START = "ITEM_EDIT_START"; -export const ITEM_EDIT_SUCCESS = "ITEM_EDIT_SUCCESS"; +export const ITEM_START = 'ITEM_START' +export const ITEM_SUCCESS = 'ITEM_SUCCESS' +export const ITEM_FAIL = 'ITEM_FAIL' -export const ITEM_DEL_START = "ITEM_DEL_START"; -export const ITEM_DEL_SUCCESS = "ITEM_DEL_SUCCESS"; +export const ITEM_POST_START = 'ITEM_POST_START' +export const ITEM_POST_SUCCESS = 'ITEM_POST_SUCCESS' -export const ITEM_SELLINI_START = "ITEM_SELLINI_START"; -export const ITEM_SELLINI_SUCCESS = "ITEM_SELLINI_SUCCESS"; +export const ITEM_EDIT_START = 'ITEM_EDIT_START' +export const ITEM_EDIT_SUCCESS = 'ITEM_EDIT_SUCCESS' -export const ITEM_SELLFIN_START = "ITEM_SELLFIN_START"; -export const ITEM_SELLFIN_SUCCESS = "ITEM_SELLFIN_SUCCESS"; +export const ITEM_DEL_START = 'ITEM_DEL_START' +export const ITEM_DEL_SUCCESS = 'ITEM_DEL_SUCCESS' -export const ITEM_REPORT_SUCCESS = "ITEM_REPORT_SUCCESS"; +export const ITEM_SELLINI_START = 'ITEM_SELLINI_START' +export const ITEM_SELLINI_SUCCESS = 'ITEM_SELLINI_SUCCESS' -export const REVIEW_START = "REVIEW_START"; -export const REVIEW_SUCCESS = "REVIEW_SUCCESS"; -export const REVIEW_FAIL = "REVIEW_FAIL"; +export const ITEM_SELLFIN_START = 'ITEM_SELLFIN_START' +export const ITEM_SELLFIN_SUCCESS = 'ITEM_SELLFIN_SUCCESS' -export const REVIEW_POST_START = "REVIEW_POST_START"; -export const REVIEW_POST_SUCCESS = "REVIEW_POST_SUCCESS"; +export const ITEM_REPORT_SUCCESS = 'ITEM_REPORT_SUCCESS' -export const REVIEW_EDIT_START = "REVIEW_EDIT_START"; -export const REVIEW_EDIT_SUCCESS = "REVIEW_EDIT_SUCCESS"; -export const REVIEW_DEL_START = "REVIEW_DEL_START"; -export const REVIEW_DEL_SUCCESS = "REVIEW_DEL_SUCCESS"; +export const REVIEW_START = 'REVIEW_START' +export const REVIEW_SUCCESS = 'REVIEW_SUCCESS' +export const REVIEW_FAIL = 'REVIEW_FAIL' -export const REVIEW_UPVOTE_SUCCESS = "REVIEW_UPVOTE_SUCCESS"; -export const REVIEW_DOWNVOTE_SUCCESS = "REVIEW_DOWNVOTE_SUCCESS"; +export const REVIEW_POST_START = 'REVIEW_POST_START' +export const REVIEW_POST_SUCCESS = 'REVIEW_POST_SUCCESS' -export const REVIEW_REPORT_SUCCESS = "REVIEW_REPORT_SUCCESS"; -export const REVIEW_RESOLVE_SUCCESS = "REVIEW_RESOLVE_SUCCESS"; +export const REVIEW_EDIT_START = 'REVIEW_EDIT_START' +export const REVIEW_EDIT_SUCCESS = 'REVIEW_EDIT_SUCCESS' + +export const REVIEW_DEL_START = 'REVIEW_DEL_START' +export const REVIEW_DEL_SUCCESS = 'REVIEW_DEL_SUCCESS' + +export const REVIEW_UPVOTE_SUCCESS = 'REVIEW_UPVOTE_SUCCESS' +export const REVIEW_DOWNVOTE_SUCCESS = 'REVIEW_DOWNVOTE_SUCCESS' + +export const REVIEW_REPORT_SUCCESS = 'REVIEW_REPORT_SUCCESS' +export const REVIEW_RESOLVE_SUCCESS = 'REVIEW_RESOLVE_SUCCESS' \ No newline at end of file diff --git a/src/store/actions/auth.tsx b/src/store/actions/auth.tsx index 88ea84d..fd49354 100644 --- a/src/store/actions/auth.tsx +++ b/src/store/actions/auth.tsx @@ -1,44 +1,42 @@ -import * as actionTypes from "./actionTypes"; -import axios from "../../axios-ins"; -import qs from "querystring"; +import * as actionTypes from './actionTypes'; +import axios from '../../axios-ins' +import qs from 'querystring' export const authStart = () => ({ - type: actionTypes.AUTH_START, -}); + type: actionTypes.AUTH_START +}) export const authSuccess = (data) => ({ - type: actionTypes.AUTH_SUCCESS, - data: data, -}); + type: actionTypes.AUTH_SUCCESS, + data: data +}) export const authFail = (err) => ({ - type: actionTypes.AUTH_FAIL, - data: err, -}); + type: actionTypes.AUTH_FAIL, + data: err +}) -export const auth = (data, isSignUp: boolean) => (dispatch) => { - dispatch(authStart()); - let url = "/login"; - if (isSignUp) { - url = "/register"; - } - axios - .post(url, qs.stringify(data)) - .then((res) => { - dispatch(authSuccess(res.data)); - }) - .catch((err) => { - dispatch(authFail(err)); - }); -}; +export const auth = (data, isSignUp: boolean) => dispatch => { + dispatch(authStart()) + let url = '/login' + if (isSignUp) { + url = '/register' + } + axios.post(url, qs.stringify(data)) + .then(res => { + dispatch(authSuccess(res.data)) + }) + .catch(err => { + dispatch(authFail(err)) + }) +} -export const authLogout = () => (dispatch) => { - axios - .get("/logout") - .then((res) => { - dispatch({ type: actionTypes.AUTH_LOGOUT }); - }) - .catch((err) => { - dispatch(authFail(err)); - }); -}; +export const authLogout = () => dispatch => { + axios.get('/logout') + .then(res => { + dispatch({type: actionTypes.AUTH_LOGOUT}) + }) + .catch(err => { + dispatch(authFail(err)) + }) +} diff --git a/src/store/actions/chat.tsx b/src/store/actions/chat.tsx index 5614d52..c84c944 100644 --- a/src/store/actions/chat.tsx +++ b/src/store/actions/chat.tsx @@ -1,13 +1,13 @@ -import io from "socket.io-client"; +import io from 'socket.io-client'; export const mountChat = () => (dispatch) => { - const socket = io("http://localhost:5000/chat"); - let stack: Record; - let username: string; - socket.on("connect", () => { - socket.emit("setUserData", username); - }); - socket.on("onlineStack", (sta: Record) => { - stack = sta; - }); + const socket = io('http://localhost:5000/chat'); + let stack: Record; + let username: string; + socket.on('connect', () => { + socket.emit('setUserData', username); + }); + socket.on('onlineStack', (sta: Record) => { + stack = sta; + }) }; diff --git a/src/store/actions/index.tsx b/src/store/actions/index.tsx index f644ee6..d865232 100644 --- a/src/store/actions/index.tsx +++ b/src/store/actions/index.tsx @@ -1,2 +1,2 @@ -export { authSuccess } from "./auth"; -export {} from "./item"; +export {authSuccess} from './auth' +export {} from './item' \ No newline at end of file diff --git a/src/store/actions/item.tsx b/src/store/actions/item.tsx index 3091911..ffa2bd6 100644 --- a/src/store/actions/item.tsx +++ b/src/store/actions/item.tsx @@ -1,146 +1,139 @@ -import axios from "../../axios-ins"; -import * as actionTypes from "./actionTypes"; -import qs from "querystring"; +import axios from '../../axios-ins'; +import * as actionTypes from './actionTypes' +import qs from 'querystring' export const getItemStart = () => ({ - type: actionTypes.ITEM_START, -}); + type: actionTypes.ITEM_START +}) export const getItemSuccess = (data) => ({ - type: actionTypes.ITEM_SUCCESS, - data: data, -}); + type: actionTypes.ITEM_SUCCESS, + data: data +}) export const postItemStart = () => ({ - type: actionTypes.ITEM_POST_START, -}); + type: actionTypes.ITEM_POST_START +}) export const postItemSuccess = (data) => ({ - type: actionTypes.ITEM_POST_SUCCESS, - data: data, -}); + type: actionTypes.ITEM_POST_SUCCESS, + data: data +}) export const itemFail = (err) => ({ - type: actionTypes.ITEM_FAIL, - err: err, -}); + type: actionTypes.ITEM_FAIL, + err: err +}) export const editItemStart = () => ({ - type: actionTypes.ITEM_EDIT_START, -}); + type: actionTypes.ITEM_EDIT_START +}) export const editItemSuccess = (data) => ({ - type: actionTypes.ITEM_EDIT_SUCCESS, - data: data, -}); + type: actionTypes.ITEM_EDIT_SUCCESS, + data: data +}) export const delItemStart = () => ({ - type: actionTypes.ITEM_DEL_START, -}); + type: actionTypes.ITEM_DEL_START +}) export const delItemSuccess = () => ({ - type: actionTypes.ITEM_DEL_SUCCESS, -}); + type: actionTypes.ITEM_DEL_SUCCESS +}) export const sellIniItemStart = () => ({ - type: actionTypes.ITEM_SELLINI_START, -}); + type: actionTypes.ITEM_SELLINI_START +}) export const sellIniItemSuccess = () => ({ - type: actionTypes.ITEM_SELLINI_SUCCESS, -}); + type: actionTypes.ITEM_SELLINI_SUCCESS +}) export const sellFinItemStart = () => ({ - type: actionTypes.ITEM_SELLFIN_START, -}); + type: actionTypes.ITEM_SELLFIN_START +}) export const sellFinItemSuccess = () => ({ - type: actionTypes.ITEM_SELLFIN_SUCCESS, -}); + type: actionTypes.ITEM_SELLFIN_SUCCESS +}) export const reportItemSuccess = () => ({ - type: actionTypes.ITEM_REPORT_SUCCESS, -}); - -export const getItem = () => (dispatch) => { - dispatch(getItemStart()); - axios - .get("/item") - .then((res) => { - dispatch(getItemSuccess(res.data)); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const postItem = (data) => (dispatch) => { - dispatch(postItemStart()); - axios - .post("/item", qs.stringify(data)) - .then((res) => { - dispatch(postItemSuccess(res.data)); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const editItem = (data, id) => (dispatch) => { - dispatch(editItemStart()); - axios - .put("/item/" + id, qs.stringify(data)) - .then((res) => { - dispatch(editItemSuccess(res.data)); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const delItem = (id) => (dispatch) => { - dispatch(delItemStart()); - axios - .delete("/item/" + id) - .then((res) => { - dispatch(delItemSuccess()); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const selliniItem = (id, data) => (dispatch) => { - dispatch(sellIniItemStart()); - axios - .patch("/item/" + id + "/sellIni", qs.stringify(data)) - .then((res) => { - dispatch(sellIniItemSuccess()); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const sellfniItem = (id, data) => (dispatch) => { - dispatch(sellFinItemStart()); - axios - .patch("/item/" + id + "/sellFin", qs.stringify(data)) - .then((res) => { - dispatch(sellFinItemSuccess()); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; - -export const reportItem = (id) => (dispatch) => { - axios - .patch("/item/" + id + "/report") - .then((res) => { - dispatch(reportItemSuccess()); - }) - .catch((err) => { - dispatch(itemFail(err)); - }); -}; + type: actionTypes.ITEM_REPORT_SUCCESS +}) + +export const getItem = () => dispatch => { + dispatch(getItemStart()) + axios.get('/item') + .then(res => { + dispatch(getItemSuccess(res.data)) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const postItem = (data) => dispatch => { + dispatch(postItemStart()) + axios.post('/item', qs.stringify(data)) + .then(res => { + dispatch(postItemSuccess(res.data)) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const editItem = (data, id) => dispatch => { + dispatch(editItemStart()) + axios.put('/item/'+ id, qs.stringify(data)) + .then(res => { + dispatch(editItemSuccess(res.data)) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const delItem = (id) => dispatch => { + dispatch(delItemStart()) + axios.delete('/item/'+ id) + .then(res => { + dispatch(delItemSuccess()) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const selliniItem = (id, data) => dispatch => { + dispatch(sellIniItemStart()) + axios.patch('/item/'+ id + '/sellIni', qs.stringify(data)) + .then(res => { + dispatch(sellIniItemSuccess()) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const sellfniItem = (id, data) => dispatch => { + dispatch(sellFinItemStart()) + axios.patch('/item/'+ id + '/sellFin', qs.stringify(data)) + .then(res => { + dispatch(sellFinItemSuccess()) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} + +export const reportItem = (id) => dispatch => { + axios.patch('/item/'+ id + '/report') + .then(res => { + dispatch(reportItemSuccess()) + }) + .catch(err => { + dispatch(itemFail(err)) + }) +} diff --git a/src/store/actions/misc.tsx b/src/store/actions/misc.tsx index 681db76..ca0ee12 100644 --- a/src/store/actions/misc.tsx +++ b/src/store/actions/misc.tsx @@ -1,79 +1,75 @@ -import axios from "axios"; -import * as actionTypes from "./actionTypes"; +import axios from 'axios'; +import * as actionTypes from './actionTypes'; export const miscStart = () => ({ - type: actionTypes.MISC_START, -}); + type: actionTypes.MISC_START +}) export const miscFail = (err) => ({ - type: actionTypes.MISC_FAIL, - err: err, -}); + type: actionTypes.MISC_FAIL, + err: err +}) export const miscFollow = (category) => ({ - type: actionTypes.MISC_FOLLOW, - cat: category, -}); + type: actionTypes.MISC_FOLLOW, + cat: category +}) export const miscUnfollow = (category) => ({ - type: actionTypes.MISC_UNFOLLOW, - cat: category, -}); + type: actionTypes.MISC_UNFOLLOW, + cat: category +}) export const miscNotifs = (notifs) => ({ - type: actionTypes.MISC_NOTIFS, - notifs: notifs, -}); + type: actionTypes.MISC_NOTIFS, + notifs: notifs +}) export const miscReport = (rep) => ({ - type: actionTypes.MISC_REPORT, - report: rep, -}); + type: actionTypes.MISC_REPORT, + report: rep +}) -export const follow = (cat) => (dispatch) => { - dispatch(miscStart()); - axios - .patch("/follow/" + cat) - .then((res) => { - miscFollow(cat); - }) - .catch((err) => { - miscFail(err); - }); -}; +export const follow = (cat) => dispatch => { + dispatch(miscStart()) + axios.patch('/follow/' + cat) + .then(res => { + miscFollow(cat) + }) + .catch(err => { + miscFail(err) + }) +} -export const unfollow = (cat) => (dispatch) => { - dispatch(miscStart()); - axios - .patch("/unfollow/" + cat) - .then((res) => { - miscUnfollow(cat); - }) - .catch((err) => { - miscFail(err); - }); -}; +export const unfollow = (cat) => dispatch => { + dispatch(miscStart()) + axios.patch('/unfollow/' + cat) + .then(res => { + miscUnfollow(cat) + }) + .catch(err => { + miscFail(err) + }) +} -export const notifs = () => (dispatch) => { - dispatch(miscStart()); - axios - .get("/notifications") - .then((res) => { - dispatch(miscNotifs(res.data)); - }) - .catch((err) => { - dispatch(miscFail(err)); - }); -}; +export const notifs = () => dispatch => { + dispatch(miscStart()) + axios.get('/notifications') + .then(res => { + dispatch(miscNotifs(res.data)) + }) + .catch(err => { + dispatch(miscFail(err)) + }) +} -export const report = () => (dispatch) => { - dispatch(miscStart()); - axios - .get("/report") - .then((res) => { - dispatch(miscReport(res.data)); - }) - .catch((err) => { - dispatch(miscFail(err)); - }); -}; +export const report = () => dispatch => { + dispatch(miscStart()) + axios.get('/report') + .then(res => { + dispatch(miscReport(res.data)) + }) + .catch(err => { + dispatch(miscFail(err)) + }) +} \ No newline at end of file diff --git a/src/store/actions/review.tsx b/src/store/actions/review.tsx index 1b9a31b..317be3e 100644 --- a/src/store/actions/review.tsx +++ b/src/store/actions/review.tsx @@ -1,151 +1,143 @@ -import axios from "../../axios-ins"; -import qs from "querystring"; -import * as actionTypes from "./actionTypes"; +import axios from '../../axios-ins' +import qs from 'querystring' +import * as actionTypes from './actionTypes' export const getReviewStart = () => ({ - type: actionTypes.REVIEW_START, -}); + type: actionTypes.REVIEW_START +}) export const getReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_SUCCESS, - data: data, -}); + type: actionTypes.REVIEW_SUCCESS, + data: data +}) export const postReviewStart = () => ({ - type: actionTypes.REVIEW_POST_START, -}); + type: actionTypes.REVIEW_POST_START +}) export const postReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_POST_SUCCESS, - data: data, -}); + type: actionTypes.REVIEW_POST_SUCCESS, + data: data +}) export const reviewFail = (err) => ({ - type: actionTypes.REVIEW_FAIL, - err: err, -}); + type: actionTypes.REVIEW_FAIL, + err: err +}) export const editReviewStart = () => ({ - type: actionTypes.REVIEW_EDIT_START, -}); + type: actionTypes.REVIEW_EDIT_START +}) export const editReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_EDIT_SUCCESS, - data: data, -}); + type: actionTypes.REVIEW_EDIT_SUCCESS, + data: data +}) export const delReviewStart = () => ({ - type: actionTypes.REVIEW_DEL_START, -}); + type: actionTypes.REVIEW_DEL_START +}) export const delReviewSuccess = () => ({ - type: actionTypes.REVIEW_DEL_SUCCESS, -}); + type: actionTypes.REVIEW_DEL_SUCCESS +}) export const upvoteReviewSuccess = () => ({ - type: actionTypes.REVIEW_UPVOTE_SUCCESS, -}); + type: actionTypes.REVIEW_UPVOTE_SUCCESS +}) export const downvoteReviewSuccess = () => ({ - type: actionTypes.REVIEW_DOWNVOTE_SUCCESS, -}); + type: actionTypes.REVIEW_DOWNVOTE_SUCCESS +}) export const reportReviewSuccess = () => ({ - type: actionTypes.REVIEW_REPORT_SUCCESS, -}); + type: actionTypes.REVIEW_REPORT_SUCCESS +}) export const resolveReviewSuccess = () => ({ - type: actionTypes.REVIEW_RESOLVE_SUCCESS, -}); - -export const getReview = (id) => (dispatch) => { - dispatch(getReviewStart()); - axios - .get("/users/" + id + "/reviews/") - .then((res) => { - dispatch(getReviewSuccess(res.data)); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const postReview = (data, id) => (dispatch) => { - dispatch(postReviewStart()); - axios - .post("/users/" + id + "/reviews/", qs.stringify(data)) - .then((res) => { - dispatch(postReviewSuccess(res.data)); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const editReview = (data, id, reviewId) => (dispatch) => { - dispatch(editReviewStart()); - axios - .put("/users/" + id + "/reviews/" + reviewId, qs.stringify(data)) - .then((res) => { - dispatch(editReviewSuccess(res.data)); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const delReview = (id, reviewId) => (dispatch) => { - dispatch(delReviewStart()); - axios - .delete("/users/" + id + "/reviews/" + reviewId) - .then((res) => { - dispatch(delReviewSuccess()); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const upvoteReview = (id, reviewId) => (dispatch) => { - axios - .patch("/users/" + id + "/reviews/" + reviewId + "/upvote") - .then((res) => { - dispatch(upvoteReviewSuccess()); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const downvoteReview = (id, reviewId) => (dispatch) => { - axios - .patch("/users/" + id + "/reviews/" + reviewId + "/downvote") - .then((res) => { - dispatch(downvoteReviewSuccess()); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const reportReview = (id, reviewId) => (dispatch) => { - axios - .patch("/users/" + id + "/reviews/" + reviewId + "/report") - .then((res) => { - dispatch(reportReviewSuccess()); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; - -export const resolveReview = (id, reviewId) => (dispatch) => { - axios - .patch("/users/" + id + "/reviews/" + reviewId + "/resolve") - .then((res) => { - dispatch(resolveReviewSuccess()); - }) - .catch((err) => { - dispatch(reviewFail(err)); - }); -}; + type: actionTypes.REVIEW_RESOLVE_SUCCESS +}) + +export const getReview = (id) => dispatch => { + dispatch(getReviewStart()) + axios.get('/users/' + id + '/reviews/') + .then(res => { + dispatch(getReviewSuccess(res.data)) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const postReview = (data, id) => dispatch => { + dispatch(postReviewStart()) + axios.post('/users/' + id + '/reviews/', qs.stringify(data)) + .then(res => { + dispatch(postReviewSuccess(res.data)) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const editReview = (data, id, reviewId) => dispatch => { + dispatch(editReviewStart()) + axios.put('/users/' + id + '/reviews/'+ reviewId, qs.stringify(data)) + .then(res => { + dispatch(editReviewSuccess(res.data)) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const delReview = (id, reviewId) => dispatch => { + dispatch(delReviewStart()) + axios.delete('/users/' + id + '/reviews/'+ reviewId) + .then(res => { + dispatch(delReviewSuccess()) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const upvoteReview = (id, reviewId) => dispatch => { + axios.patch('/users/' + id + '/reviews/'+ reviewId + '/upvote') + .then(res => { + dispatch(upvoteReviewSuccess()) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const downvoteReview = (id, reviewId) => dispatch => { + axios.patch('/users/' + id + '/reviews/'+ reviewId + '/downvote') + .then(res => { + dispatch(downvoteReviewSuccess()) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const reportReview = (id, reviewId) => dispatch => { + axios.patch('/users/' + id + '/reviews/'+ reviewId + '/report') + .then(res => { + dispatch(reportReviewSuccess()) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} + +export const resolveReview = (id, reviewId) => dispatch => { + axios.patch('/users/' + id + '/reviews/'+ reviewId + '/resolve') + .then(res => { + dispatch(resolveReviewSuccess()) + }) + .catch(err => { + dispatch(reviewFail(err)) + }) +} \ No newline at end of file diff --git a/src/store/reducers/auth.tsx b/src/store/reducers/auth.tsx index 44f672d..0ae0bc9 100644 --- a/src/store/reducers/auth.tsx +++ b/src/store/reducers/auth.tsx @@ -1,7 +1,7 @@ -const initState = {}; +const initState = {} -const authReducer = (state = initState, action = {}) => { - return state; -}; +const authReducer = (state = initState,action={}) => { + return state +} -export default authReducer; +export default authReducer \ No newline at end of file diff --git a/src/store/reducers/index.tsx b/src/store/reducers/index.tsx index c682e0e..39344fd 100644 --- a/src/store/reducers/index.tsx +++ b/src/store/reducers/index.tsx @@ -1,11 +1,11 @@ -import authReducer from "./auth"; -import itemReducer from "./item"; +import authReducer from './auth' +import itemReducer from './item' -import { combineReducers } from "redux"; +import { combineReducers } from 'redux' -const rootReducer = combineReducers({ - auth: authReducer, - item: itemReducer, -}); +const rootReducer = combineReducers ({ + auth : authReducer, + item : itemReducer +}) -export default rootReducer; +export default rootReducer; \ No newline at end of file diff --git a/src/store/reducers/item.tsx b/src/store/reducers/item.tsx index 9db8373..8e09c7e 100644 --- a/src/store/reducers/item.tsx +++ b/src/store/reducers/item.tsx @@ -1,80 +1,80 @@ const initState = { - items: [ - { - id: 1, - name: "Asus Laptop", - price: 40000, - category: "laptop", - image: "/images/laptop.jfif", - }, - { - id: 2, - name: "Macbook Air", - price: 60000, - category: "laptop", - image: "/images/laptop.jfif", - }, - { - id: 3, - name: "Hero Thunderbird", - price: 4000, - category: "bicycle", - image: "/images/bicycle.jfif", - }, - { - id: 4, - name: "Decathlon BTWX 100", - price: 5000, - category: "bicycle", - image: "/images/bicycle.jfif", - }, - { - id: 5, - name: "Samsung S10e", - price: 25000, - category: "mobile", - image: "/images/mobile.jfif", - }, - { - id: 6, - name: "Vivo V15", - price: 14000, - category: "mobile", - image: "/images/mobile.jfif", - }, - { - id: 7, - name: "Kurl On memory foam ", - price: 2000, - category: "matteress", - image: "/images/matteress.jfif", - }, - { - id: 8, - name: "SleepX", - price: 1500, - category: "matteress", - image: "/images/matteress.jfif", - }, - { - id: 9, - name: "Order of the phoenix", - price: 300, - category: "book", - image: "/images/book.jfif", - }, - { - id: 10, - name: "Differential Equation - Kreyzig", - price: 200, - category: "book", - image: "/images/book.jfif", - }, - ], -}; + items: [ + { + id: 1, + name: 'Asus Laptop', + price: 40000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 2, + name: 'Macbook Air', + price: 60000, + category: 'laptop', + image: '/images/laptop.jfif', + }, + { + id: 3, + name: 'Hero Thunderbird', + price: 4000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 4, + name: 'Decathlon BTWX 100', + price: 5000, + category: 'bicycle', + image: '/images/bicycle.jfif', + }, + { + id: 5, + name: 'Samsung S10e', + price: 25000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 6, + name: 'Vivo V15', + price: 14000, + category: 'mobile', + image: '/images/mobile.jfif', + }, + { + id: 7, + name: 'Kurl On memory foam ', + price: 2000, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 8, + name: 'SleepX', + price: 1500, + category: 'matteress', + image: '/images/matteress.jfif', + }, + { + id: 9, + name: 'Order of the phoenix', + price: 300, + category: 'book', + image: '/images/book.jfif', + }, + { + id: 10, + name: 'Differential Equation - Kreyzig', + price: 200, + category: 'book', + image: '/images/book.jfif', + }, + ], +} -const itemReducer = (state = initState, action) => { - return state; -}; +const itemReducer = (state = initState,action) => { + return state +} -export default itemReducer; +export default itemReducer \ No newline at end of file From 4d097cd14f6ff1c251f2dcc011ad89c6b2ff2a78 Mon Sep 17 00:00:00 2001 From: Satyakam Singhal Date: Sun, 31 May 2020 17:38:27 +0530 Subject: [PATCH 7/7] profile added --- package-lock.json | 5 + package.json | 1 + src/App.test.tsx | 14 +- src/App.tsx | 187 +++++++------- src/axios-ins.tsx | 8 +- src/components/CategoryCard/CategoryCard.tsx | 135 +++++----- src/components/HeaderCard/HeaderCard.css | 8 +- src/components/HeaderCard/HeaderCard.tsx | 71 +++--- src/components/ItemCard/ItemCard.tsx | 33 ++- src/components/ItemDetail/ItemDetail.tsx | 167 ++++++------- src/components/ItemList/ItemList.tsx | 53 ++-- src/components/PostAd/PostAd.css | 5 +- src/components/PostAd/PostAd.tsx | 244 ++++++++++--------- src/components/RegisterForm/RegisterForm.tsx | 160 ++++++------ src/components/SearchBar/SearchBar.css | 4 +- src/components/SearchBar/SearchBar.tsx | 29 +-- src/index.tsx | 21 +- src/pages/Health/Health.tsx | 16 +- src/pages/categories/categories.tsx | 38 ++- src/pages/chats/chats.tsx | 36 ++- src/pages/home/home.tsx | 172 +++++++------ src/pages/home/home2.tsx | 212 +++++++++------- src/pages/myaccount/myaccount.css | 22 +- src/pages/myaccount/myaccount.tsx | 158 +++++++++--- src/pages/register/register.tsx | 28 +-- src/serviceWorker.ts | 216 ++++++++-------- src/setupTests.ts | 2 +- src/store/actions/actionTypes.tsx | 77 +++--- src/store/actions/auth.tsx | 70 +++--- src/store/actions/chat.tsx | 20 +- src/store/actions/index.tsx | 4 +- src/store/actions/item.tsx | 229 ++++++++--------- src/store/actions/misc.tsx | 122 +++++----- src/store/actions/review.tsx | 242 +++++++++--------- src/store/reducers/auth.tsx | 10 +- src/store/reducers/index.tsx | 16 +- src/store/reducers/item.tsx | 154 ++++++------ 37 files changed, 1601 insertions(+), 1388 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c5799c..c859a29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10829,6 +10829,11 @@ "whatwg-fetch": "^3.0.0" } }, + "react-axios": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/react-axios/-/react-axios-2.0.3.tgz", + "integrity": "sha512-63kY2iupdRgbvPq9G8xmM0NWUnt2Q5YmpotMoLQsxKOzKXKZg2Lo6CzF/bcZvtmv3WnfjBU6Bg8nZQO28eIAZw==" + }, "react-dev-utils": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", diff --git a/package.json b/package.json index 6792182..2a9aee4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "ionicons": "^5.0.0", "querystring": "^0.2.0", "react": "^16.13.0", + "react-axios": "^2.0.3", "react-dom": "^16.13.0", "react-redux": "^7.2.0", "react-router": "^5.1.2", diff --git a/src/App.test.tsx b/src/App.test.tsx index 25e68dc..ae51219 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,10 +1,10 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; +import React from "react"; +import { render } from "@testing-library/react"; +import App from "./App"; // eslint-disable-next-line no-undef -test('renders without crashing', () => { - const { baseElement } = render(); - // eslint-disable-next-line no-undef - expect(baseElement).toBeDefined(); +test("renders without crashing", () => { + const { baseElement } = render(); + // eslint-disable-next-line no-undef + expect(baseElement).toBeDefined(); }); diff --git a/src/App.tsx b/src/App.tsx index 0985b5d..1b58861 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,110 +1,109 @@ -import React from 'react'; -import { Redirect, Route } from 'react-router-dom'; -import axios from 'axios'; -import qs from 'querystring' -import {connect} from 'react-redux' +import React from "react"; +import { Redirect, Route } from "react-router-dom"; +import axios from "axios"; +import qs from "querystring"; +import { connect } from "react-redux"; import { - IonApp, - IonIcon, - IonLabel, - IonRouterOutlet, - IonTabBar, - IonTabButton, - IonTabs, -} from '@ionic/react'; -import { IonReactRouter } from '@ionic/react-router'; + IonApp, + IonIcon, + IonLabel, + IonRouterOutlet, + IonTabBar, + IonTabButton, + IonTabs, +} from "@ionic/react"; +import { IonReactRouter } from "@ionic/react-router"; import { - chatboxOutline, - gridOutline, - homeOutline, - personOutline, -} from 'ionicons/icons'; -import Home from './pages/home/home'; -import Categories from './pages/categories/categories'; -import Chats from './pages/chats/chats'; -import MyAccount from './pages/myaccount/myaccount'; + chatboxOutline, + gridOutline, + homeOutline, + personOutline, +} from "ionicons/icons"; +import Home from "./pages/home/home"; +import Categories from "./pages/categories/categories"; +import Chats from "./pages/chats/chats"; +import MyAccount from "./pages/myaccount/myaccount"; /* new imports */ -import Register from './pages/register/register'; -import Health from './pages/Health/Health'; -import ItemDetail from './components/ItemDetail/ItemDetail'; - -import PostAd from './components/PostAd/PostAd'; +import Register from "./pages/register/register"; +import Health from "./pages/Health/Health"; +import ItemDetail from "./components/ItemDetail/ItemDetail"; +import PostAd from "./components/PostAd/PostAd"; /* Core CSS required for Ionic components to work properly */ -import '@ionic/react/css/core.css'; +import "@ionic/react/css/core.css"; /* Basic CSS for apps built with Ionic */ -import '@ionic/react/css/normalize.css'; -import '@ionic/react/css/structure.css'; -import '@ionic/react/css/typography.css'; +import "@ionic/react/css/normalize.css"; +import "@ionic/react/css/structure.css"; +import "@ionic/react/css/typography.css"; /* Optional CSS utils that can be commented out */ -import '@ionic/react/css/padding.css'; -import '@ionic/react/css/float-elements.css'; -import '@ionic/react/css/text-alignment.css'; -import '@ionic/react/css/text-transformation.css'; -import '@ionic/react/css/flex-utils.css'; -import '@ionic/react/css/display.css'; +import "@ionic/react/css/padding.css"; +import "@ionic/react/css/float-elements.css"; +import "@ionic/react/css/text-alignment.css"; +import "@ionic/react/css/text-transformation.css"; +import "@ionic/react/css/flex-utils.css"; +import "@ionic/react/css/display.css"; /* Theme variables */ -import './theme/variables.css'; -import {authSuccess} from './store/actions/index' +import "./theme/variables.css"; +import { authSuccess } from "./store/actions/index"; class App extends React.Component { - componentDidMount() { - const eventUser = new EventSource('http://localhost:5000/streamUser'); - eventUser.onmessage = e => this.props.changeUser(e.data) - const data = { - username: 'ssh', - password: '12345' - } - axios - .post('http://localhost:5000/login', qs.stringify(data)) - .then((res) => console.log(res)) - .catch((err) => console.log(err.response)); - } - render() { - return ( - - - - - - - - - - - - - - - - - - Home - - - - Categories - - - - Chats - - - - My Account - - - - - - ); - } + componentDidMount() { + const eventUser = new EventSource("http://localhost:5000/streamUser"); + eventUser.onmessage = (e) => this.props.changeUser(e.data); + const data = { + username: "ssh", + password: "12345", + }; + axios + .post("http://localhost:5000/login", qs.stringify(data)) + .then((res) => console.log(res)) + .catch((err) => console.log(err.response)); + } + render() { + return ( + + + + + + + + + + + + + + + + + + Home + + + + Categories + + + + Chats + + + + My Account + + + + + + ); + } } -const mapDispatchToProps = dispatch => ({ - changeUser : (data) => dispatch(authSuccess(data)) -}) +const mapDispatchToProps = (dispatch) => ({ + changeUser: (data) => dispatch(authSuccess(data)), +}); export default connect(null, mapDispatchToProps)(App); diff --git a/src/axios-ins.tsx b/src/axios-ins.tsx index 7d45821..c11f0c5 100644 --- a/src/axios-ins.tsx +++ b/src/axios-ins.tsx @@ -1,7 +1,7 @@ -import axios from 'axios' +import axios from "axios"; const instance = axios.create({ - baseURL: 'http://localhost:5000' -}) + baseURL: "http://localhost:5000", +}); -export default instance; \ No newline at end of file +export default instance; diff --git a/src/components/CategoryCard/CategoryCard.tsx b/src/components/CategoryCard/CategoryCard.tsx index 589dbc5..9a08f76 100644 --- a/src/components/CategoryCard/CategoryCard.tsx +++ b/src/components/CategoryCard/CategoryCard.tsx @@ -1,71 +1,84 @@ -import React from 'react'; -import { IonGrid, IonRow, IonCol, IonIcon, IonLabel, IonText,IonChip } from '@ionic/react'; -import { bicycle, laptopOutline, phonePortraitOutline, tabletLandscapeOutline, bookOutline, constructOutline} from 'ionicons/icons'; -import './CategoryCard.css'; - +import React from "react"; +import { + IonGrid, + IonRow, + IonCol, + IonIcon, + IonText, + IonChip, +} from "@ionic/react"; +import { + bicycle, + laptopOutline, + phonePortraitOutline, + tabletLandscapeOutline, + bookOutline, + constructOutline, +} from "ionicons/icons"; +import "./CategoryCard.css"; const CategoryCard: React.FC = () => ( - - - - - - - -
Laptops
-
-
- - - - -
Bicycles
-
-
- -
- - - - - - -
Phones
-
-
- - - - -
Matteresses
-
-
- -
- - - - - - -
Books
-
-
+ + + + + + +
Laptops
+
+
+
- - - -
Misc.
-
-
+ + + + +
Bicycles
+
+
+
+
- + + + + + +
Phones
+
+
+
-
+ + + + +
Matteresses
+
+
+
+
-
- + + + + + +
Books
+
+
+
+ + + + +
Misc.
+
+
+
+
+ ); export default CategoryCard; diff --git a/src/components/HeaderCard/HeaderCard.css b/src/components/HeaderCard/HeaderCard.css index b02d93c..400d777 100644 --- a/src/components/HeaderCard/HeaderCard.css +++ b/src/components/HeaderCard/HeaderCard.css @@ -17,9 +17,11 @@ width: 200px; text-align: center; - margin-left: auto; - margin-right: auto; - display: flex; + display: inline-block; align-items: center; justify-content: center; + padding-left: 10px; +} +.wrapper { + text-align: center; } diff --git a/src/components/HeaderCard/HeaderCard.tsx b/src/components/HeaderCard/HeaderCard.tsx index f42f089..f2f2bc8 100644 --- a/src/components/HeaderCard/HeaderCard.tsx +++ b/src/components/HeaderCard/HeaderCard.tsx @@ -1,42 +1,41 @@ -import React from 'react'; +import React from "react"; import { - IonCardHeader, - IonCardTitle, - IonCardContent, - IonCard, - IonButton, -} from '@ionic/react'; -import './HeaderCard.css'; -import SearchBar from '../SearchBar/SearchBar'; -import { RouteComponentProps } from 'react-router-dom' + IonCardHeader, + IonCardTitle, + IonCardContent, + IonCard, + IonButton, +} from "@ionic/react"; +import "./HeaderCard.css"; +import { RouteComponentProps } from "react-router-dom"; const HeaderCard: React.FC = (props) => { - const clicked = (route: string) => { - props.history.push(route); - } - return ( - - - Welcome To - - IITD Marketplace - - - - Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, - we got you covered ! - - - - clicked("/register")}> - Sign in to start - - clicked('/login')}> - Login - - - - ); + const clicked = (route: string) => { + props.history.push(route); + }; + return ( + + + Welcome To + IITD Marketplace + + + Wanna buy, sell, rent items among IIT Delhi peeps? Dont worry, we got + you covered ! + + +
+ + Sign in to start + + + + Login + +
+
+
+ ); }; export default HeaderCard; diff --git a/src/components/ItemCard/ItemCard.tsx b/src/components/ItemCard/ItemCard.tsx index f0dc75f..34a68c8 100644 --- a/src/components/ItemCard/ItemCard.tsx +++ b/src/components/ItemCard/ItemCard.tsx @@ -1,21 +1,20 @@ -import React from 'react'; -import { IonCard, IonCardHeader, IonCardSubtitle } from '@ionic/react'; +import React from "react"; +import { IonCard, IonCardHeader, IonCardSubtitle } from "@ionic/react"; -class ItemCard extends React.Component { - render() { - const { item } = this.props; - return ( -
- - cardImg - - {item.name} Rs.{' '} - {item.price} - - -
- ); - } +class ItemCard extends React.Component { + render() { + const { item } = this.props; + return ( +
+ + cardImg + + {item.name} Rs. {item.price} + + +
+ ); + } } export default ItemCard; diff --git a/src/components/ItemDetail/ItemDetail.tsx b/src/components/ItemDetail/ItemDetail.tsx index 0c66406..b0ee839 100644 --- a/src/components/ItemDetail/ItemDetail.tsx +++ b/src/components/ItemDetail/ItemDetail.tsx @@ -1,93 +1,86 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonHeader, - IonPage, - IonChip, - IonToolbar, - IonCard, - IonCardHeader, - IonCardSubtitle, - IonCardTitle, - IonCardContent, - IonIcon, - IonLabel, - IonButton, - IonText, -} from '@ionic/react'; -import { locationOutline } from 'ionicons/icons'; + IonContent, + IonHeader, + IonPage, + IonChip, + IonToolbar, + IonCard, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, + IonCardContent, + IonIcon, + IonLabel, + IonButton, + IonText, +} from "@ionic/react"; +import { locationOutline } from "ionicons/icons"; const ItemDetail: React.FC = () => { - return ( - - - - - - Asus Tuf GT505 - - Rs. 40000 - - - - - - - - Electronics - - - Laptops - - - - - - Seller Details - - - N. Satwik - -

- {' '} - {' '} - Zanskar House -

-
- - Chat With Seller - -
-
- - - Product Details - - -
    -
  • 4 months old
  • -
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • -
  • RGB keyboard
  • -
  • ...
  • -
  • ...
  • -
-
-
- - - Reviews - - - -
-
- ); + return ( + + + + + + Asus Tuf GT505 + + Rs. 40000 + + + + + + + + Electronics + + + Laptops + + + + + + Seller Details + + + N. Satwik + +

+ {" "} + Zanskar House +

+
+ + Chat With Seller + +
+
+ + + Product Details + + +
    +
  • 4 months old
  • +
  • 8 GB RAM, 512 GB SSD, i5 9th gen
  • +
  • RGB keyboard
  • +
  • ...
  • +
  • ...
  • +
+
+
+ + + Reviews + + + +
+
+ ); }; export default ItemDetail; diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index af70ac4..7f1b7a5 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,33 +1,30 @@ -import React from 'react'; -import { IonCol, IonRow } from '@ionic/react'; -import ItemCard from '../ItemCard/ItemCard'; +import React from "react"; +import { IonCol, IonRow } from "@ionic/react"; +import ItemCard from "../ItemCard/ItemCard"; // import categories from '../../pages/categories/categories'; +class ItemList extends React.Component { + render() { + const itemList = this.props.items.map((item) => { + if (this.props.category === "all") { + return ( + + + + ); + } + if (this.props.category === item.category) { + return ( + + + + ); + } else { + return null; + } + }); - -class ItemList extends React.Component{ - render() { - - const itemList = this.props.items.map((item) => { - if (this.props.category === 'all') { - return ( - - - - ); - } - if (this.props.category === item.category) { - return ( - - - - ); - } else { - return null; - } - }); - - return {itemList}; - } + return {itemList}; + } } export default ItemList; diff --git a/src/components/PostAd/PostAd.css b/src/components/PostAd/PostAd.css index deeebdd..849da90 100644 --- a/src/components/PostAd/PostAd.css +++ b/src/components/PostAd/PostAd.css @@ -2,4 +2,7 @@ align-content: center; width:20%; } - \ No newline at end of file +.btn { + text-align: center; + +} \ No newline at end of file diff --git a/src/components/PostAd/PostAd.tsx b/src/components/PostAd/PostAd.tsx index 3ade72d..0a00b53 100644 --- a/src/components/PostAd/PostAd.tsx +++ b/src/components/PostAd/PostAd.tsx @@ -1,127 +1,133 @@ -import React, { useState } from 'react'; +import React, { useState } from "react"; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import './PostAd.css'; -import { RouteComponentProps } from 'react-router'; +import "./PostAd.css"; +import { RouteComponentProps } from "react-router"; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, - IonPage, - IonContent, -} from '@ionic/react'; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, + IonPage, + IonContent, + IonHeader, + IonButtons, + IonBackButton, +} from "@ionic/react"; const PostAd: React.FC = () => { - const [name, setName] = useState(); - const [date, setDate] = useState(); - const [condition, setCondition] = useState(); - const [price, setPrice] = useState(); - const [category, setCategory] = useState(); - const [description, setDescription] = useState(); + const [name, setName] = useState(); + const [date, setDate] = useState(); + const [condition, setCondition] = useState(); + const [price, setPrice] = useState(); + const [category, setCategory] = useState(); + const [description, setDescription] = useState(); - return ( - - - - Post Your Ad - -
- - - - Name of The Product - - setName(e.detail.value!)} - required - /> - - - - Tentative Date of Purchase - - setDate(e.detail.value!)} - required - /> - - - - Condition - - - setCondition(e.detail.value!) - } - required - /> - - - - Category - - setCategory(e.detail.value)} - > - Laptops - Mobile - Books - Cycle - Miscallaneous - - - - - Asking Price - - setPrice(e.detail.value!)} - required - /> - - - - Description - - - setDescription(e.detail.value!) - } - required - /> - - - - - -
-
- - Post - -
-
-
- ); + return ( + + + + + + + + + Post Your Ad + + + +
+ + + + Name of The Product + + setName(e.detail.value!)} + required + /> + + + + Tentative Date of Purchase + + setDate(e.detail.value!)} + required + /> + + + + Condition + + setCondition(e.detail.value!)} + required + /> + + + + Category + + setCategory(e.detail.value)} + > + Laptops + Mobile + Books + Cycle + Miscallaneous + + + + + Asking Price + + setPrice(e.detail.value!)} + required + /> + + + + Description + + setDescription(e.detail.value!)} + required + /> + + + + + +
+
+ + Post + +
+
+
+ ); }; export default PostAd; diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx index 3acef6f..2eaf6c2 100644 --- a/src/components/RegisterForm/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -1,87 +1,87 @@ -import React, { useState } from 'react'; +import React, { useState } from "react"; import { - IonTitle, - IonToolbar, - IonSelect, - IonSelectOption, - IonInput, - IonItem, - IonLabel, - IonList, - IonButton, -} from '@ionic/react'; -import './RegisterForm.css'; + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonInput, + IonItem, + IonLabel, + IonList, + IonButton, +} from "@ionic/react"; +import "./RegisterForm.css"; const RegisterForm: React.FC = () => { - const [uname, setUname] = useState(); - const [pass, setPass] = useState(); - const [entryno, setEntryno] = useState(); - const [hostel, setHostel] = useState(); + const [uname, setUname] = useState(); + const [pass, setPass] = useState(); + const [entryno, setEntryno] = useState(); + const [hostel, setHostel] = useState(); - return ( -
- - Join us today ! - -
- - - - Username - - setUname(e.detail.value!)} - required - /> - - - - Password - - setPass(e.detail.value!)} - required - /> - - - - Entry Number - - setEntryno(e.detail.value!)} - required - /> - - - - Hostel - - setHostel(e.detail.value)} - > - Aravalli - Girnar - Jwalamukhi - Himadri - Zanskar - - - -
-
- - Register - -
-
- ); + return ( +
+ + Join us today ! + +
+ + + + Username + + setUname(e.detail.value!)} + required + /> + + + + Password + + setPass(e.detail.value!)} + required + /> + + + + Entry Number + + setEntryno(e.detail.value!)} + required + /> + + + + Hostel + + setHostel(e.detail.value)} + > + Aravalli + Girnar + Jwalamukhi + Himadri + Zanskar + + + +
+
+ + Register + +
+
+ ); }; export default RegisterForm; diff --git a/src/components/SearchBar/SearchBar.css b/src/components/SearchBar/SearchBar.css index b896f4a..d19a6e1 100644 --- a/src/components/SearchBar/SearchBar.css +++ b/src/components/SearchBar/SearchBar.css @@ -1,3 +1,3 @@ .searchbar{ - align-self: start; -} \ No newline at end of file + +} diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 3638167..671aa17 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,19 +1,20 @@ -import React, { useState } from 'react'; -import { IonToolbar, IonSearchbar } from '@ionic/react'; -import './SearchBar.css'; +import React, { useState } from "react"; +import { IonToolbar, IonSearchbar } from "@ionic/react"; +import "./SearchBar.css"; const SearchBar: React.FC = () => { - const [searchText, setSearchText] = useState(''); - return ( - - setSearchText(e.detail.value!)} - placeholder="Search" - /> - - ); + const [searchText, setSearchText] = useState(""); + return ( + + setSearchText(e.detail.value!)} + placeholder="Search" + /> + + ); }; export default SearchBar; diff --git a/src/index.tsx b/src/index.tsx index 427ebae..f075bbf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,17 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App"; -import { createStore, applyMiddleware } from 'redux' -import rootReducer from './store/reducers' -import thunk from 'redux-thunk' -import { Provider } from 'react-redux' +import { createStore, applyMiddleware } from "redux"; +import rootReducer from "./store/reducers"; +import thunk from "redux-thunk"; +import { Provider } from "react-redux"; const store = createStore(rootReducer, applyMiddleware(thunk)); -ReactDOM.render(, document.getElementById('root')); +ReactDOM.render( + + + , + document.getElementById("root") +); diff --git a/src/pages/Health/Health.tsx b/src/pages/Health/Health.tsx index 8368aaf..3526d85 100644 --- a/src/pages/Health/Health.tsx +++ b/src/pages/Health/Health.tsx @@ -1,13 +1,13 @@ -import React from 'react'; -import { withRouter } from 'react-router-dom'; -import { IonPage } from '@ionic/react'; +import React from "react"; +import { withRouter } from "react-router-dom"; +import { IonPage } from "@ionic/react"; const Health: React.FC = () => { - return ( - -

Ok, Healthy!

-
- ); + return ( + +

Ok, Healthy!

+
+ ); }; export default withRouter(Health); diff --git a/src/pages/categories/categories.tsx b/src/pages/categories/categories.tsx index 51d005e..726034a 100644 --- a/src/pages/categories/categories.tsx +++ b/src/pages/categories/categories.tsx @@ -1,16 +1,32 @@ -import React from 'react'; -import { IonContent, IonPage } from '@ionic/react'; -import CategoryCard from '../../components/CategoryCard/CategoryCard'; -import { RouteComponentProps } from 'react-router'; +import React from "react"; +import { + IonContent, + IonPage, + IonHeader, + IonToolbar, + IonButtons, + IonBackButton, + IonTitle, +} from "@ionic/react"; +import CategoryCard from "../../components/CategoryCard/CategoryCard"; +import { RouteComponentProps } from "react-router"; const categories: React.FC = (props) => { - return ( - - - - - - ); + return ( + + + + + + + Categories + + + + + + + ); }; export default categories; diff --git a/src/pages/chats/chats.tsx b/src/pages/chats/chats.tsx index f34d0d6..c9b1d97 100644 --- a/src/pages/chats/chats.tsx +++ b/src/pages/chats/chats.tsx @@ -1,16 +1,30 @@ -import React from 'react'; -import { IonContent, IonPage } from '@ionic/react'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -import { RouteComponentProps } from 'react-router'; +import React from "react"; +import { + IonContent, + IonPage, + IonHeader, + IonToolbar, + IonButtons, + IonBackButton, + IonTitle, +} from "@ionic/react"; +import { RouteComponentProps } from "react-router"; const chats: React.FC = (props) => { - return ( - - - - - - ); + return ( + + + + + + + + Chats + + + + + ); }; export default chats; diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index 0aa358c..a37b8d3 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -1,90 +1,100 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonLabel, - IonSegment, - IonSegmentButton, - IonPage, - IonFab, - IonFabButton, - IonIcon, - IonToolbar, - IonFabList, -} from '@ionic/react'; -import { add, createOutline } from 'ionicons/icons'; -import './home.css'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -import ItemList from '../../components/ItemList/ItemList'; -// import CategoryCard from '../../components/CategoryCard/CategoryCard'; - -import { connect } from 'react-redux'; -import { RouteComponentProps } from 'react-router'; + IonContent, + IonLabel, + IonSegment, + IonSegmentButton, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonFabList, + IonHeader, + IonRow, + IonCol, + IonButtons, + IonBackButton, +} from "@ionic/react"; +import { add, createOutline } from "ionicons/icons"; +import "./home.css"; +import HeaderCard from "../../components/HeaderCard/HeaderCard"; +import ItemList from "../../components/ItemList/ItemList"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import SearchBar from "../../components/SearchBar/SearchBar"; class Home extends React.Component { - // eslint-disable-next-line react/destructuring-assignment - // eslint-disable-next-line react/state-in-constructor - state = { - category: 'all', - }; - render() { - return ( - - - - - - this.setState({ category: e.detail.value }) - } - color="primary" - > - - All - - - Laptops - - - Mobiles - - - Bicycles - - - Books - - - - - - - - - - this.props.history.push('/postad')}> - - {/* Post an Ad */} - - - - - - ); - } + // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: "all", + }; + render() { + return ( + + + + + + + + + + + + + + + + + this.setState({ category: e.detail.value })} + color="primary" + > + + All + + + Laptops + + + Mobiles + + + Bicycles + + + Books + + + + + + + + + + this.props.history.push("/postad")} + > + + {/* Post an Ad */} + + + + + + ); + } } const mapStatetoProps = (state: any) => { - return { - items: state.item.items, - }; + return { + items: state.item.items, + }; }; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/home/home2.tsx b/src/pages/home/home2.tsx index 5c796ac..a54592f 100644 --- a/src/pages/home/home2.tsx +++ b/src/pages/home/home2.tsx @@ -1,95 +1,141 @@ -import React from 'react'; -import { IonContent, IonLabel,IonSegment, IonSegmentButton, IonPage, IonFab, IonFabButton, IonIcon, IonToolbar, IonFabList, IonHeader, IonText, IonRow, IonCol, IonCard, } from '@ionic/react'; -import { add, notificationsOutline, personCircle, heart, heartOutline, heartHalf, checkmarkCircle, lockClosed, analytics, ribbon, ribbonOutline } from 'ionicons/icons'; -import './home2.css'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -import ItemList from '../../components/ItemList/ItemList'; +import React from "react"; +import { + IonContent, + IonPage, + IonFab, + IonFabButton, + IonIcon, + IonToolbar, + IonHeader, + IonText, + IonRow, + IonCol, + IonCard, +} from "@ionic/react"; +import { + add, + notificationsOutline, + personCircle, + heartHalf, + checkmarkCircle, + lockClosed, + analytics, + ribbonOutline, +} from "ionicons/icons"; +import "./home2.css"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; -import { connect } from 'react-redux'; -import { RouteComponentProps } from 'react-router'; - -import SearchBar from '../../components/SearchBar/SearchBar' -import CategoryCard from '../../components/CategoryCard/CategoryCard'; - +import SearchBar from "../../components/SearchBar/SearchBar"; +import CategoryCard from "../../components/CategoryCard/CategoryCard"; class Home extends React.Component { - // eslint-disable-next-line react/destructuring-assignment - // eslint-disable-next-line react/state-in-constructor - state = { - category: 'all', - }; - render() { - return ( - - - - - - - - - - - - - - - - -
- Safe -
-
- - -
- Secure -
-
-
- - - -
- Dynamic -
-
- - -
- Friendly -
-
-
-
- - -

Choose a category

- -
- - - - - - this.props.history.push('/postad')} /> - - - -
+ // eslint-disable-next-line react/destructuring-assignment + // eslint-disable-next-line react/state-in-constructor + state = { + category: "all", + }; + render() { + return ( + + + + + + + + + + + + + + + + +
+ Safe +
+
+ + + +
+ Secure +
+
+
+ + + + +
+ Dynamic +
+
+ + + +
+ Friendly +
+
+
+
+ + +

Choose a category

+
+ +
-
- - ); - } + + + this.props.history.push("/postad")} + /> + + + +
+ ); + } } const mapStatetoProps = (state: any) => { - return { - items: state.item.items, - }; + return { + items: state.item.items, + }; }; export default connect(mapStatetoProps)(Home); diff --git a/src/pages/myaccount/myaccount.css b/src/pages/myaccount/myaccount.css index 0afcaf6..b583f12 100644 --- a/src/pages/myaccount/myaccount.css +++ b/src/pages/myaccount/myaccount.css @@ -1,6 +1,20 @@ +.effect { + border: 1px solid #ccc; + padding: 7px 14px; + + background: transparent; + color:black; +} +.avatar { + height:100px; + width:100px; + position: relative; + display: block; + margin-left: auto; + margin-right: auto; -.buttons{ - text-align: center; - padding:2em; - padding-top:6em; +} + +.colgap { + padding-bottom: 30px ; } \ No newline at end of file diff --git a/src/pages/myaccount/myaccount.tsx b/src/pages/myaccount/myaccount.tsx index 2b41383..e86bd9a 100644 --- a/src/pages/myaccount/myaccount.tsx +++ b/src/pages/myaccount/myaccount.tsx @@ -1,43 +1,123 @@ -import React from 'react'; +import React from "react"; import { - IonContent, - IonHeader, - IonPage, - IonItem, - IonLabel, - IonThumbnail, - IonToolbar, -} from '@ionic/react'; -import './myaccount.css'; -import HeaderCard from '../../components/HeaderCard/HeaderCard'; -import { RouteComponentProps } from 'react-router'; + IonContent, + IonHeader, + IonButton, + IonItem, + IonLabel, + IonToolbar, + IonTitle, + IonGrid, + IonRow, + IonCol, + IonInput, + IonSegment, + IonSegmentButton, + IonPage, + IonBackButton, + IonButtons, +} from "@ionic/react"; +import "./myaccount.css"; -const myaccount: React.FC = (props) => { - return ( - - - -

-
- - Guest User - - - - -
-
-
-
-
- - - -
- ); +const Myaccount: React.FC = () => { + return ( + + + + + + + Profile + + + +
+ + + +
+ + + + Profile + + + Buy/Sell History + + + + + + +
+ Name +
+ +
+ +
+
+ +
+ Entry No. +
+
+ +
+
+ + +
+ Phone No. +
+
+ +
+
+ +
+ Email +
+ +
+ +
+
+ + +
+ Hostel +
+
+ +
+
+ + + Update Info + +
+ + + Get on PlayStore + + + Get on AppStore + + + + + Contact For Help + + +
+
+
+ ); }; -export default myaccount; +export default Myaccount; diff --git a/src/pages/register/register.tsx b/src/pages/register/register.tsx index c919f8b..15c1387 100644 --- a/src/pages/register/register.tsx +++ b/src/pages/register/register.tsx @@ -1,20 +1,16 @@ -import React from 'react' -import RegisterForm from '../../components/RegisterForm/RegisterForm' -import {IonPage} from '@ionic/react' -import {RouteComponentProps} from 'react-router' +import React from "react"; +import RegisterForm from "../../components/RegisterForm/RegisterForm"; +import { IonPage } from "@ionic/react"; +import { RouteComponentProps } from "react-router"; class Register extends React.Component { - state = { - isSignUp: true - } - render() { - let register = - return ( - - {register} - - ) - } + state = { + isSignUp: true, + }; + render() { + let register = ; + return {register}; + } } -export default Register; \ No newline at end of file +export default Register; diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index 35e67cb..73c4506 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -11,136 +11,132 @@ // opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) + window.location.hostname === "localhost" || + // [::1] is the IPv6 localhost address. + window.location.hostname === "[::1]" || + // 127.0.0.0/8 are considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) ); type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; + onSuccess?: (registration: ServiceWorkerRegistration) => void; + onUpdate?: (registration: ServiceWorkerRegistration) => void; }; export function register(config?: Config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL( - process.env.PUBLIC_URL!, - window.location.href - ); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } + if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL!, window.location.href); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return; + } - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + window.addEventListener("load", () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + "This web app is being served cache-first by a service " + + "worker. To learn more, visit https://bit.ly/CRA-PWA" + ); }); - } + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } + }); + } } function registerValidSW(swUrl: string, config?: Config) { - navigator.serviceWorker - .register(swUrl) - .then((registration) => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); + navigator.serviceWorker + .register(swUrl) + .then((registration) => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === "installed") { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + "New content is available and will be used when all " + + "tabs for this page are closed. See https://bit.ly/CRA-PWA." + ); - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log("Content is cached for offline use."); - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch((error) => { - console.error('Error during service worker registration:', error); - }); + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch((error) => { + console.error("Error during service worker registration:", error); + }); } function checkValidServiceWorker(swUrl: string, config?: Config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { 'Service-Worker': 'script' }, - }) - .then((response) => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && - contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then((registration) => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl, { + headers: { "Service-Worker": "script" }, + }) + .then((response) => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get("content-type"); + if ( + response.status === 404 || + (contentType != null && contentType.indexOf("javascript") === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then((registration) => { + registration.unregister().then(() => { + window.location.reload(); + }); }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + "No internet connection found. App is running in offline mode." + ); + }); } export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then((registration) => { - registration.unregister(); - }); - } + if ("serviceWorker" in navigator) { + navigator.serviceWorker.ready.then((registration) => { + registration.unregister(); + }); + } } diff --git a/src/setupTests.ts b/src/setupTests.ts index 74b1a27..5fdf001 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -2,4 +2,4 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect'; +import "@testing-library/jest-dom/extend-expect"; diff --git a/src/store/actions/actionTypes.tsx b/src/store/actions/actionTypes.tsx index dd03c21..7210a39 100644 --- a/src/store/actions/actionTypes.tsx +++ b/src/store/actions/actionTypes.tsx @@ -1,54 +1,51 @@ -export const MISC_FOLLOW = 'MISC_FOLLOW' -export const MISC_UNFOLLOW = 'MISC_UNFOLLOW' -export const MISC_NOTIFS = 'MISC_NOTIFS' -export const MISC_REPORT = 'MISC_REPORT' -export const MISC_START = 'MISC_START' -export const MISC_FAIL = 'MISC_FAIL' +export const MISC_FOLLOW = "MISC_FOLLOW"; +export const MISC_UNFOLLOW = "MISC_UNFOLLOW"; +export const MISC_NOTIFS = "MISC_NOTIFS"; +export const MISC_REPORT = "MISC_REPORT"; +export const MISC_START = "MISC_START"; +export const MISC_FAIL = "MISC_FAIL"; +export const AUTH_SUCCESS = "AUTH_SUCCESS"; +export const AUTH_FAIL = "AUTH_FAIL"; +export const AUTH_START = "AUTH_START"; +export const AUTH_LOGOUT = "AUTH_LOGOUT"; -export const AUTH_SUCCESS = 'AUTH_SUCCESS' -export const AUTH_FAIL = 'AUTH_FAIL' -export const AUTH_START = 'AUTH_START' -export const AUTH_LOGOUT = 'AUTH_LOGOUT' +export const ITEM_START = "ITEM_START"; +export const ITEM_SUCCESS = "ITEM_SUCCESS"; +export const ITEM_FAIL = "ITEM_FAIL"; +export const ITEM_POST_START = "ITEM_POST_START"; +export const ITEM_POST_SUCCESS = "ITEM_POST_SUCCESS"; -export const ITEM_START = 'ITEM_START' -export const ITEM_SUCCESS = 'ITEM_SUCCESS' -export const ITEM_FAIL = 'ITEM_FAIL' +export const ITEM_EDIT_START = "ITEM_EDIT_START"; +export const ITEM_EDIT_SUCCESS = "ITEM_EDIT_SUCCESS"; -export const ITEM_POST_START = 'ITEM_POST_START' -export const ITEM_POST_SUCCESS = 'ITEM_POST_SUCCESS' +export const ITEM_DEL_START = "ITEM_DEL_START"; +export const ITEM_DEL_SUCCESS = "ITEM_DEL_SUCCESS"; -export const ITEM_EDIT_START = 'ITEM_EDIT_START' -export const ITEM_EDIT_SUCCESS = 'ITEM_EDIT_SUCCESS' +export const ITEM_SELLINI_START = "ITEM_SELLINI_START"; +export const ITEM_SELLINI_SUCCESS = "ITEM_SELLINI_SUCCESS"; -export const ITEM_DEL_START = 'ITEM_DEL_START' -export const ITEM_DEL_SUCCESS = 'ITEM_DEL_SUCCESS' +export const ITEM_SELLFIN_START = "ITEM_SELLFIN_START"; +export const ITEM_SELLFIN_SUCCESS = "ITEM_SELLFIN_SUCCESS"; -export const ITEM_SELLINI_START = 'ITEM_SELLINI_START' -export const ITEM_SELLINI_SUCCESS = 'ITEM_SELLINI_SUCCESS' +export const ITEM_REPORT_SUCCESS = "ITEM_REPORT_SUCCESS"; -export const ITEM_SELLFIN_START = 'ITEM_SELLFIN_START' -export const ITEM_SELLFIN_SUCCESS = 'ITEM_SELLFIN_SUCCESS' +export const REVIEW_START = "REVIEW_START"; +export const REVIEW_SUCCESS = "REVIEW_SUCCESS"; +export const REVIEW_FAIL = "REVIEW_FAIL"; -export const ITEM_REPORT_SUCCESS = 'ITEM_REPORT_SUCCESS' +export const REVIEW_POST_START = "REVIEW_POST_START"; +export const REVIEW_POST_SUCCESS = "REVIEW_POST_SUCCESS"; +export const REVIEW_EDIT_START = "REVIEW_EDIT_START"; +export const REVIEW_EDIT_SUCCESS = "REVIEW_EDIT_SUCCESS"; -export const REVIEW_START = 'REVIEW_START' -export const REVIEW_SUCCESS = 'REVIEW_SUCCESS' -export const REVIEW_FAIL = 'REVIEW_FAIL' +export const REVIEW_DEL_START = "REVIEW_DEL_START"; +export const REVIEW_DEL_SUCCESS = "REVIEW_DEL_SUCCESS"; -export const REVIEW_POST_START = 'REVIEW_POST_START' -export const REVIEW_POST_SUCCESS = 'REVIEW_POST_SUCCESS' +export const REVIEW_UPVOTE_SUCCESS = "REVIEW_UPVOTE_SUCCESS"; +export const REVIEW_DOWNVOTE_SUCCESS = "REVIEW_DOWNVOTE_SUCCESS"; -export const REVIEW_EDIT_START = 'REVIEW_EDIT_START' -export const REVIEW_EDIT_SUCCESS = 'REVIEW_EDIT_SUCCESS' - -export const REVIEW_DEL_START = 'REVIEW_DEL_START' -export const REVIEW_DEL_SUCCESS = 'REVIEW_DEL_SUCCESS' - -export const REVIEW_UPVOTE_SUCCESS = 'REVIEW_UPVOTE_SUCCESS' -export const REVIEW_DOWNVOTE_SUCCESS = 'REVIEW_DOWNVOTE_SUCCESS' - -export const REVIEW_REPORT_SUCCESS = 'REVIEW_REPORT_SUCCESS' -export const REVIEW_RESOLVE_SUCCESS = 'REVIEW_RESOLVE_SUCCESS' \ No newline at end of file +export const REVIEW_REPORT_SUCCESS = "REVIEW_REPORT_SUCCESS"; +export const REVIEW_RESOLVE_SUCCESS = "REVIEW_RESOLVE_SUCCESS"; diff --git a/src/store/actions/auth.tsx b/src/store/actions/auth.tsx index fd49354..88ea84d 100644 --- a/src/store/actions/auth.tsx +++ b/src/store/actions/auth.tsx @@ -1,42 +1,44 @@ -import * as actionTypes from './actionTypes'; -import axios from '../../axios-ins' -import qs from 'querystring' +import * as actionTypes from "./actionTypes"; +import axios from "../../axios-ins"; +import qs from "querystring"; export const authStart = () => ({ - type: actionTypes.AUTH_START -}) + type: actionTypes.AUTH_START, +}); export const authSuccess = (data) => ({ - type: actionTypes.AUTH_SUCCESS, - data: data -}) + type: actionTypes.AUTH_SUCCESS, + data: data, +}); export const authFail = (err) => ({ - type: actionTypes.AUTH_FAIL, - data: err -}) + type: actionTypes.AUTH_FAIL, + data: err, +}); -export const auth = (data, isSignUp: boolean) => dispatch => { - dispatch(authStart()) - let url = '/login' - if (isSignUp) { - url = '/register' - } - axios.post(url, qs.stringify(data)) - .then(res => { - dispatch(authSuccess(res.data)) - }) - .catch(err => { - dispatch(authFail(err)) - }) -} +export const auth = (data, isSignUp: boolean) => (dispatch) => { + dispatch(authStart()); + let url = "/login"; + if (isSignUp) { + url = "/register"; + } + axios + .post(url, qs.stringify(data)) + .then((res) => { + dispatch(authSuccess(res.data)); + }) + .catch((err) => { + dispatch(authFail(err)); + }); +}; -export const authLogout = () => dispatch => { - axios.get('/logout') - .then(res => { - dispatch({type: actionTypes.AUTH_LOGOUT}) - }) - .catch(err => { - dispatch(authFail(err)) - }) -} +export const authLogout = () => (dispatch) => { + axios + .get("/logout") + .then((res) => { + dispatch({ type: actionTypes.AUTH_LOGOUT }); + }) + .catch((err) => { + dispatch(authFail(err)); + }); +}; diff --git a/src/store/actions/chat.tsx b/src/store/actions/chat.tsx index c84c944..5614d52 100644 --- a/src/store/actions/chat.tsx +++ b/src/store/actions/chat.tsx @@ -1,13 +1,13 @@ -import io from 'socket.io-client'; +import io from "socket.io-client"; export const mountChat = () => (dispatch) => { - const socket = io('http://localhost:5000/chat'); - let stack: Record; - let username: string; - socket.on('connect', () => { - socket.emit('setUserData', username); - }); - socket.on('onlineStack', (sta: Record) => { - stack = sta; - }) + const socket = io("http://localhost:5000/chat"); + let stack: Record; + let username: string; + socket.on("connect", () => { + socket.emit("setUserData", username); + }); + socket.on("onlineStack", (sta: Record) => { + stack = sta; + }); }; diff --git a/src/store/actions/index.tsx b/src/store/actions/index.tsx index d865232..f644ee6 100644 --- a/src/store/actions/index.tsx +++ b/src/store/actions/index.tsx @@ -1,2 +1,2 @@ -export {authSuccess} from './auth' -export {} from './item' \ No newline at end of file +export { authSuccess } from "./auth"; +export {} from "./item"; diff --git a/src/store/actions/item.tsx b/src/store/actions/item.tsx index ffa2bd6..3091911 100644 --- a/src/store/actions/item.tsx +++ b/src/store/actions/item.tsx @@ -1,139 +1,146 @@ -import axios from '../../axios-ins'; -import * as actionTypes from './actionTypes' -import qs from 'querystring' +import axios from "../../axios-ins"; +import * as actionTypes from "./actionTypes"; +import qs from "querystring"; export const getItemStart = () => ({ - type: actionTypes.ITEM_START -}) + type: actionTypes.ITEM_START, +}); export const getItemSuccess = (data) => ({ - type: actionTypes.ITEM_SUCCESS, - data: data -}) + type: actionTypes.ITEM_SUCCESS, + data: data, +}); export const postItemStart = () => ({ - type: actionTypes.ITEM_POST_START -}) + type: actionTypes.ITEM_POST_START, +}); export const postItemSuccess = (data) => ({ - type: actionTypes.ITEM_POST_SUCCESS, - data: data -}) + type: actionTypes.ITEM_POST_SUCCESS, + data: data, +}); export const itemFail = (err) => ({ - type: actionTypes.ITEM_FAIL, - err: err -}) + type: actionTypes.ITEM_FAIL, + err: err, +}); export const editItemStart = () => ({ - type: actionTypes.ITEM_EDIT_START -}) + type: actionTypes.ITEM_EDIT_START, +}); export const editItemSuccess = (data) => ({ - type: actionTypes.ITEM_EDIT_SUCCESS, - data: data -}) + type: actionTypes.ITEM_EDIT_SUCCESS, + data: data, +}); export const delItemStart = () => ({ - type: actionTypes.ITEM_DEL_START -}) + type: actionTypes.ITEM_DEL_START, +}); export const delItemSuccess = () => ({ - type: actionTypes.ITEM_DEL_SUCCESS -}) + type: actionTypes.ITEM_DEL_SUCCESS, +}); export const sellIniItemStart = () => ({ - type: actionTypes.ITEM_SELLINI_START -}) + type: actionTypes.ITEM_SELLINI_START, +}); export const sellIniItemSuccess = () => ({ - type: actionTypes.ITEM_SELLINI_SUCCESS -}) + type: actionTypes.ITEM_SELLINI_SUCCESS, +}); export const sellFinItemStart = () => ({ - type: actionTypes.ITEM_SELLFIN_START -}) + type: actionTypes.ITEM_SELLFIN_START, +}); export const sellFinItemSuccess = () => ({ - type: actionTypes.ITEM_SELLFIN_SUCCESS -}) + type: actionTypes.ITEM_SELLFIN_SUCCESS, +}); export const reportItemSuccess = () => ({ - type: actionTypes.ITEM_REPORT_SUCCESS -}) - -export const getItem = () => dispatch => { - dispatch(getItemStart()) - axios.get('/item') - .then(res => { - dispatch(getItemSuccess(res.data)) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const postItem = (data) => dispatch => { - dispatch(postItemStart()) - axios.post('/item', qs.stringify(data)) - .then(res => { - dispatch(postItemSuccess(res.data)) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const editItem = (data, id) => dispatch => { - dispatch(editItemStart()) - axios.put('/item/'+ id, qs.stringify(data)) - .then(res => { - dispatch(editItemSuccess(res.data)) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const delItem = (id) => dispatch => { - dispatch(delItemStart()) - axios.delete('/item/'+ id) - .then(res => { - dispatch(delItemSuccess()) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const selliniItem = (id, data) => dispatch => { - dispatch(sellIniItemStart()) - axios.patch('/item/'+ id + '/sellIni', qs.stringify(data)) - .then(res => { - dispatch(sellIniItemSuccess()) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const sellfniItem = (id, data) => dispatch => { - dispatch(sellFinItemStart()) - axios.patch('/item/'+ id + '/sellFin', qs.stringify(data)) - .then(res => { - dispatch(sellFinItemSuccess()) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} - -export const reportItem = (id) => dispatch => { - axios.patch('/item/'+ id + '/report') - .then(res => { - dispatch(reportItemSuccess()) - }) - .catch(err => { - dispatch(itemFail(err)) - }) -} + type: actionTypes.ITEM_REPORT_SUCCESS, +}); + +export const getItem = () => (dispatch) => { + dispatch(getItemStart()); + axios + .get("/item") + .then((res) => { + dispatch(getItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const postItem = (data) => (dispatch) => { + dispatch(postItemStart()); + axios + .post("/item", qs.stringify(data)) + .then((res) => { + dispatch(postItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const editItem = (data, id) => (dispatch) => { + dispatch(editItemStart()); + axios + .put("/item/" + id, qs.stringify(data)) + .then((res) => { + dispatch(editItemSuccess(res.data)); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const delItem = (id) => (dispatch) => { + dispatch(delItemStart()); + axios + .delete("/item/" + id) + .then((res) => { + dispatch(delItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const selliniItem = (id, data) => (dispatch) => { + dispatch(sellIniItemStart()); + axios + .patch("/item/" + id + "/sellIni", qs.stringify(data)) + .then((res) => { + dispatch(sellIniItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const sellfniItem = (id, data) => (dispatch) => { + dispatch(sellFinItemStart()); + axios + .patch("/item/" + id + "/sellFin", qs.stringify(data)) + .then((res) => { + dispatch(sellFinItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; + +export const reportItem = (id) => (dispatch) => { + axios + .patch("/item/" + id + "/report") + .then((res) => { + dispatch(reportItemSuccess()); + }) + .catch((err) => { + dispatch(itemFail(err)); + }); +}; diff --git a/src/store/actions/misc.tsx b/src/store/actions/misc.tsx index ca0ee12..681db76 100644 --- a/src/store/actions/misc.tsx +++ b/src/store/actions/misc.tsx @@ -1,75 +1,79 @@ -import axios from 'axios'; -import * as actionTypes from './actionTypes'; +import axios from "axios"; +import * as actionTypes from "./actionTypes"; export const miscStart = () => ({ - type: actionTypes.MISC_START -}) + type: actionTypes.MISC_START, +}); export const miscFail = (err) => ({ - type: actionTypes.MISC_FAIL, - err: err -}) + type: actionTypes.MISC_FAIL, + err: err, +}); export const miscFollow = (category) => ({ - type: actionTypes.MISC_FOLLOW, - cat: category -}) + type: actionTypes.MISC_FOLLOW, + cat: category, +}); export const miscUnfollow = (category) => ({ - type: actionTypes.MISC_UNFOLLOW, - cat: category -}) + type: actionTypes.MISC_UNFOLLOW, + cat: category, +}); export const miscNotifs = (notifs) => ({ - type: actionTypes.MISC_NOTIFS, - notifs: notifs -}) + type: actionTypes.MISC_NOTIFS, + notifs: notifs, +}); export const miscReport = (rep) => ({ - type: actionTypes.MISC_REPORT, - report: rep -}) + type: actionTypes.MISC_REPORT, + report: rep, +}); -export const follow = (cat) => dispatch => { - dispatch(miscStart()) - axios.patch('/follow/' + cat) - .then(res => { - miscFollow(cat) - }) - .catch(err => { - miscFail(err) - }) -} +export const follow = (cat) => (dispatch) => { + dispatch(miscStart()); + axios + .patch("/follow/" + cat) + .then((res) => { + miscFollow(cat); + }) + .catch((err) => { + miscFail(err); + }); +}; -export const unfollow = (cat) => dispatch => { - dispatch(miscStart()) - axios.patch('/unfollow/' + cat) - .then(res => { - miscUnfollow(cat) - }) - .catch(err => { - miscFail(err) - }) -} +export const unfollow = (cat) => (dispatch) => { + dispatch(miscStart()); + axios + .patch("/unfollow/" + cat) + .then((res) => { + miscUnfollow(cat); + }) + .catch((err) => { + miscFail(err); + }); +}; -export const notifs = () => dispatch => { - dispatch(miscStart()) - axios.get('/notifications') - .then(res => { - dispatch(miscNotifs(res.data)) - }) - .catch(err => { - dispatch(miscFail(err)) - }) -} +export const notifs = () => (dispatch) => { + dispatch(miscStart()); + axios + .get("/notifications") + .then((res) => { + dispatch(miscNotifs(res.data)); + }) + .catch((err) => { + dispatch(miscFail(err)); + }); +}; -export const report = () => dispatch => { - dispatch(miscStart()) - axios.get('/report') - .then(res => { - dispatch(miscReport(res.data)) - }) - .catch(err => { - dispatch(miscFail(err)) - }) -} \ No newline at end of file +export const report = () => (dispatch) => { + dispatch(miscStart()); + axios + .get("/report") + .then((res) => { + dispatch(miscReport(res.data)); + }) + .catch((err) => { + dispatch(miscFail(err)); + }); +}; diff --git a/src/store/actions/review.tsx b/src/store/actions/review.tsx index 317be3e..1b9a31b 100644 --- a/src/store/actions/review.tsx +++ b/src/store/actions/review.tsx @@ -1,143 +1,151 @@ -import axios from '../../axios-ins' -import qs from 'querystring' -import * as actionTypes from './actionTypes' +import axios from "../../axios-ins"; +import qs from "querystring"; +import * as actionTypes from "./actionTypes"; export const getReviewStart = () => ({ - type: actionTypes.REVIEW_START -}) + type: actionTypes.REVIEW_START, +}); export const getReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_SUCCESS, - data: data -}) + type: actionTypes.REVIEW_SUCCESS, + data: data, +}); export const postReviewStart = () => ({ - type: actionTypes.REVIEW_POST_START -}) + type: actionTypes.REVIEW_POST_START, +}); export const postReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_POST_SUCCESS, - data: data -}) + type: actionTypes.REVIEW_POST_SUCCESS, + data: data, +}); export const reviewFail = (err) => ({ - type: actionTypes.REVIEW_FAIL, - err: err -}) + type: actionTypes.REVIEW_FAIL, + err: err, +}); export const editReviewStart = () => ({ - type: actionTypes.REVIEW_EDIT_START -}) + type: actionTypes.REVIEW_EDIT_START, +}); export const editReviewSuccess = (data) => ({ - type: actionTypes.REVIEW_EDIT_SUCCESS, - data: data -}) + type: actionTypes.REVIEW_EDIT_SUCCESS, + data: data, +}); export const delReviewStart = () => ({ - type: actionTypes.REVIEW_DEL_START -}) + type: actionTypes.REVIEW_DEL_START, +}); export const delReviewSuccess = () => ({ - type: actionTypes.REVIEW_DEL_SUCCESS -}) + type: actionTypes.REVIEW_DEL_SUCCESS, +}); export const upvoteReviewSuccess = () => ({ - type: actionTypes.REVIEW_UPVOTE_SUCCESS -}) + type: actionTypes.REVIEW_UPVOTE_SUCCESS, +}); export const downvoteReviewSuccess = () => ({ - type: actionTypes.REVIEW_DOWNVOTE_SUCCESS -}) + type: actionTypes.REVIEW_DOWNVOTE_SUCCESS, +}); export const reportReviewSuccess = () => ({ - type: actionTypes.REVIEW_REPORT_SUCCESS -}) + type: actionTypes.REVIEW_REPORT_SUCCESS, +}); export const resolveReviewSuccess = () => ({ - type: actionTypes.REVIEW_RESOLVE_SUCCESS -}) - -export const getReview = (id) => dispatch => { - dispatch(getReviewStart()) - axios.get('/users/' + id + '/reviews/') - .then(res => { - dispatch(getReviewSuccess(res.data)) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const postReview = (data, id) => dispatch => { - dispatch(postReviewStart()) - axios.post('/users/' + id + '/reviews/', qs.stringify(data)) - .then(res => { - dispatch(postReviewSuccess(res.data)) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const editReview = (data, id, reviewId) => dispatch => { - dispatch(editReviewStart()) - axios.put('/users/' + id + '/reviews/'+ reviewId, qs.stringify(data)) - .then(res => { - dispatch(editReviewSuccess(res.data)) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const delReview = (id, reviewId) => dispatch => { - dispatch(delReviewStart()) - axios.delete('/users/' + id + '/reviews/'+ reviewId) - .then(res => { - dispatch(delReviewSuccess()) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const upvoteReview = (id, reviewId) => dispatch => { - axios.patch('/users/' + id + '/reviews/'+ reviewId + '/upvote') - .then(res => { - dispatch(upvoteReviewSuccess()) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const downvoteReview = (id, reviewId) => dispatch => { - axios.patch('/users/' + id + '/reviews/'+ reviewId + '/downvote') - .then(res => { - dispatch(downvoteReviewSuccess()) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const reportReview = (id, reviewId) => dispatch => { - axios.patch('/users/' + id + '/reviews/'+ reviewId + '/report') - .then(res => { - dispatch(reportReviewSuccess()) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} - -export const resolveReview = (id, reviewId) => dispatch => { - axios.patch('/users/' + id + '/reviews/'+ reviewId + '/resolve') - .then(res => { - dispatch(resolveReviewSuccess()) - }) - .catch(err => { - dispatch(reviewFail(err)) - }) -} \ No newline at end of file + type: actionTypes.REVIEW_RESOLVE_SUCCESS, +}); + +export const getReview = (id) => (dispatch) => { + dispatch(getReviewStart()); + axios + .get("/users/" + id + "/reviews/") + .then((res) => { + dispatch(getReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const postReview = (data, id) => (dispatch) => { + dispatch(postReviewStart()); + axios + .post("/users/" + id + "/reviews/", qs.stringify(data)) + .then((res) => { + dispatch(postReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const editReview = (data, id, reviewId) => (dispatch) => { + dispatch(editReviewStart()); + axios + .put("/users/" + id + "/reviews/" + reviewId, qs.stringify(data)) + .then((res) => { + dispatch(editReviewSuccess(res.data)); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const delReview = (id, reviewId) => (dispatch) => { + dispatch(delReviewStart()); + axios + .delete("/users/" + id + "/reviews/" + reviewId) + .then((res) => { + dispatch(delReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const upvoteReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/upvote") + .then((res) => { + dispatch(upvoteReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const downvoteReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/downvote") + .then((res) => { + dispatch(downvoteReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const reportReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/report") + .then((res) => { + dispatch(reportReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; + +export const resolveReview = (id, reviewId) => (dispatch) => { + axios + .patch("/users/" + id + "/reviews/" + reviewId + "/resolve") + .then((res) => { + dispatch(resolveReviewSuccess()); + }) + .catch((err) => { + dispatch(reviewFail(err)); + }); +}; diff --git a/src/store/reducers/auth.tsx b/src/store/reducers/auth.tsx index 0ae0bc9..44f672d 100644 --- a/src/store/reducers/auth.tsx +++ b/src/store/reducers/auth.tsx @@ -1,7 +1,7 @@ -const initState = {} +const initState = {}; -const authReducer = (state = initState,action={}) => { - return state -} +const authReducer = (state = initState, action = {}) => { + return state; +}; -export default authReducer \ No newline at end of file +export default authReducer; diff --git a/src/store/reducers/index.tsx b/src/store/reducers/index.tsx index 39344fd..c682e0e 100644 --- a/src/store/reducers/index.tsx +++ b/src/store/reducers/index.tsx @@ -1,11 +1,11 @@ -import authReducer from './auth' -import itemReducer from './item' +import authReducer from "./auth"; +import itemReducer from "./item"; -import { combineReducers } from 'redux' +import { combineReducers } from "redux"; -const rootReducer = combineReducers ({ - auth : authReducer, - item : itemReducer -}) +const rootReducer = combineReducers({ + auth: authReducer, + item: itemReducer, +}); -export default rootReducer; \ No newline at end of file +export default rootReducer; diff --git a/src/store/reducers/item.tsx b/src/store/reducers/item.tsx index 8e09c7e..9db8373 100644 --- a/src/store/reducers/item.tsx +++ b/src/store/reducers/item.tsx @@ -1,80 +1,80 @@ const initState = { - items: [ - { - id: 1, - name: 'Asus Laptop', - price: 40000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 2, - name: 'Macbook Air', - price: 60000, - category: 'laptop', - image: '/images/laptop.jfif', - }, - { - id: 3, - name: 'Hero Thunderbird', - price: 4000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 4, - name: 'Decathlon BTWX 100', - price: 5000, - category: 'bicycle', - image: '/images/bicycle.jfif', - }, - { - id: 5, - name: 'Samsung S10e', - price: 25000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 6, - name: 'Vivo V15', - price: 14000, - category: 'mobile', - image: '/images/mobile.jfif', - }, - { - id: 7, - name: 'Kurl On memory foam ', - price: 2000, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 8, - name: 'SleepX', - price: 1500, - category: 'matteress', - image: '/images/matteress.jfif', - }, - { - id: 9, - name: 'Order of the phoenix', - price: 300, - category: 'book', - image: '/images/book.jfif', - }, - { - id: 10, - name: 'Differential Equation - Kreyzig', - price: 200, - category: 'book', - image: '/images/book.jfif', - }, - ], -} + items: [ + { + id: 1, + name: "Asus Laptop", + price: 40000, + category: "laptop", + image: "/images/laptop.jfif", + }, + { + id: 2, + name: "Macbook Air", + price: 60000, + category: "laptop", + image: "/images/laptop.jfif", + }, + { + id: 3, + name: "Hero Thunderbird", + price: 4000, + category: "bicycle", + image: "/images/bicycle.jfif", + }, + { + id: 4, + name: "Decathlon BTWX 100", + price: 5000, + category: "bicycle", + image: "/images/bicycle.jfif", + }, + { + id: 5, + name: "Samsung S10e", + price: 25000, + category: "mobile", + image: "/images/mobile.jfif", + }, + { + id: 6, + name: "Vivo V15", + price: 14000, + category: "mobile", + image: "/images/mobile.jfif", + }, + { + id: 7, + name: "Kurl On memory foam ", + price: 2000, + category: "matteress", + image: "/images/matteress.jfif", + }, + { + id: 8, + name: "SleepX", + price: 1500, + category: "matteress", + image: "/images/matteress.jfif", + }, + { + id: 9, + name: "Order of the phoenix", + price: 300, + category: "book", + image: "/images/book.jfif", + }, + { + id: 10, + name: "Differential Equation - Kreyzig", + price: 200, + category: "book", + image: "/images/book.jfif", + }, + ], +}; -const itemReducer = (state = initState,action) => { - return state -} +const itemReducer = (state = initState, action) => { + return state; +}; -export default itemReducer \ No newline at end of file +export default itemReducer;