From 68b880124293eae56d458d019224e5b90a2c0434 Mon Sep 17 00:00:00 2001 From: Santhosh Date: Tue, 8 Mar 2022 17:59:27 +0530 Subject: [PATCH 1/3] Feature-#1123 Add text on main page --- src/Components/Navbar.css | 29 +++++++++++++++++++++++++++++ src/Components/Navbar.js | 22 +++++++++++++--------- src/Components/UserProfile/User.js | 8 +++++++- src/images/linkfree.ico | Bin 0 -> 4286 bytes 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/images/linkfree.ico diff --git a/src/Components/Navbar.css b/src/Components/Navbar.css index 51bde9c4eda..a8d68bdf10f 100644 --- a/src/Components/Navbar.css +++ b/src/Components/Navbar.css @@ -1,3 +1,32 @@ .p-menubar-button { display: none !important; } + +.p-menubar-root-list { + display: flex; + justify-content: center; +} + +.p-menubar { + flex-wrap: wrap; + justify-content: space-between; +} + +.p-menubar-end { + margin-left: 8rem !important; +} + +.p-menuitem-link { + cursor: default !important; +} + +.linkfree-icon { + background-image: url('../images/linkfree.ico'); + width: 1rem; + height: 1rem; + background-size: 1rem 1rem; +} + +.p-menuitem-text { + font-weight: 600; +} diff --git a/src/Components/Navbar.js b/src/Components/Navbar.js index dab15dbefb7..546dee81e93 100644 --- a/src/Components/Navbar.js +++ b/src/Components/Navbar.js @@ -12,6 +12,7 @@ import GetIcons from './Icons/GetIcons' function Navbar({ items, start, end }) { const [version, setVersion] = useState('') + const [loading, setLoading] = useState(true) // Added to prevent items shifting in the page before loading useEffect(() => { fetch('/app.json') @@ -21,9 +22,10 @@ function Navbar({ items, start, end }) { console.log('Navbar useEffect', error) alert('An error occurred, please try again later.') }) + .finally(() => setLoading(false)) }, []) - if (!end) { + if (!end && !loading) { end = (
- ) + if (!items && !loading) { + items = [ + { + label: 'LinkFree', + icon: 'linkfree-icon', + }, + ] + } + + return } Navbar.propTypes = { diff --git a/src/Components/UserProfile/User.js b/src/Components/UserProfile/User.js index 4dacb0ce7c6..dbbc722661e 100644 --- a/src/Components/UserProfile/User.js +++ b/src/Components/UserProfile/User.js @@ -30,7 +30,13 @@ function User() { <> + } diff --git a/src/images/linkfree.ico b/src/images/linkfree.ico new file mode 100644 index 0000000000000000000000000000000000000000..5a16e416279bd2cefb1ab0b9decfbaa69d000183 GIT binary patch literal 4286 zcmcgw2~d+q6kaS!tp_Tjj6<#AJ{07>B1c5!5)}}y)+1824pKy=9>|~tiq!(+PzSL^ zWyHZ-5gjKWDgpw6P&`165R@|n5D5e@#IO6~&~d08G{*j!FK_qXx9@xV^8VfThY%(D zVX+9kSmf*^LZ;D{!C;RNXDaC^{U&5T9UFcDQ2J2tD)_!P9`lnIM+oxg?{60P#WcM< zoyYIzRn&r4&X-ZiwA*>*wbfK+Q~g9L9X{0lNP5(+;mxP~KxN-f0a?}yvKp`o5i*=b z6ou4>JSurqFO|v|ijC&na(`kgNF$tvbYgaI!blt+GEST-^vNPo4Dk^+k`=FI#Qrbi z;q!?3{RzabK7lxNfw=U5ENT-|e%0Z6pVBAJmHtc&$fDLW@7f_Ywc&)_E+j79AYL71 z#G^Tx%zb3{u8tzwgi{qa$nVjdFl3LI<){&RQ9E&Z1!Diid+5HRC2^?kTBi5Cxh<&SoIM8@=Bp{x`2u1TU_K1C{8Cl*hBP(T4@@TorxioXP$STQ_L$tVDea53ejxi-Y_N`0{}Wq%I-Q7%$mP8GdCXvWsh--N~V7_ zbGL zd634-!k=f(HYS}pm$sI>QAH7)j13bb1NZ6H5kYEeTV?87rBDk1d?PE6c{>})S093V zuoP~)pJHKX6P$whSQk|bQ=cmv6~S+y&9b0?=CW%r*eAuzZ4$6{0cOE1@Q!JPLrgzh zk4xZn`VHJpyn)Rj8K!OOgVI8}57<{-p}9ZyQ~aRZn;HI@bH0WCHW7?MgwWYo4z1uW zI31C|VfSr}wabA|Y9AKU6L5YapdSW|S@#CStrNuNvA?|h)c46>xnvg2Fk26O>Vvl3 zX6P6>z+_WCG=sb0cBC4v`_o|&m<`9Rr?Dyg9Oeb4LocWXW7g9%*|(qaKjF&FPtW%8 z{sWl7-T@;^Z7^||ZJ-PD?Zsj(?gK0dPQa@80@#M+!`3$#eq3*4-!oKlVV|it`V@xyfv)p?hS4=iZwL+!p}7HFsbgkOmfeH}?Fr z6Q@ojLESY4x_ZV?v-}04OmAw+!_CZ@?3%Gh+wT(e3=Ls8OLK7jmZo#+^|W=oeS$An zFY$DT^YVi@nR*@5?PH-ednt@;xlrRAgUZqhkOeIu=JM}L$4@qi zj+$ZM3k|okm>tpwRj=EaY8eIM*Y~y_Vd{dpbs$zxVm@~LadnBRadpSEZ8;WyyvxnB zZLKUXP|4QTF}3-|C#&&GZ@NyV{u_n~TnY388fgAiwbMNQsG9RFe`0hDKOv0fy`jDq zYaQiGpeSV9*{vB`&orO1Sw z7n*vcxO%_6ex!BCJ8r(Wevj(+uix&sOS+`={X>J8W{)=A*Os$0r4!8(Db8n$%H*{_ z(!8-wg_;KYBvP_s0Q5a1bx2>?Hcw4=O9Ss@RtG|l*M$z<{~XdV=y}MPWo?zjs$lwX T`}FzOr1;M>VEF$5|9AgyX${br literal 0 HcmV?d00001 From 06e5440418f8b0166aaceabd4c37837b2a5336b7 Mon Sep 17 00:00:00 2001 From: santhoshbala0178 Date: Wed, 9 Mar 2022 10:37:49 +0530 Subject: [PATCH 2/3] Feature #1171 - Fix review comments --- src/Components/Home/Placeholders.js | 2 +- src/Components/Home/Searchbar.js | 3 +++ src/Components/Navbar.css | 21 +++++++++++++++------ src/Components/Navbar.js | 3 ++- src/Components/UserProfile/User.js | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/Components/Home/Placeholders.js b/src/Components/Home/Placeholders.js index 6b4d5c269a0..717ffc47e8b 100644 --- a/src/Components/Home/Placeholders.js +++ b/src/Components/Home/Placeholders.js @@ -6,7 +6,7 @@ import { Skeleton } from 'primereact/skeleton' function Placeholder({ list }) { return ( <> - +
{list.map((user, key) => { return ( diff --git a/src/Components/Home/Searchbar.js b/src/Components/Home/Searchbar.js index 3999c2643ed..98e656d8ec0 100644 --- a/src/Components/Home/Searchbar.js +++ b/src/Components/Home/Searchbar.js @@ -15,6 +15,9 @@ const Searchbar = ({ searchHandler, searchTerm }) => { name="user" id="search-input" placeholder="Search user..." + style={{ + width: '100%', + }} />
diff --git a/src/Components/Navbar.css b/src/Components/Navbar.css index a8d68bdf10f..98673478a97 100644 --- a/src/Components/Navbar.css +++ b/src/Components/Navbar.css @@ -13,20 +13,29 @@ } .p-menubar-end { - margin-left: 8rem !important; + margin-left: 12rem !important; } -.p-menuitem-link { - cursor: default !important; +@media screen and (max-width: 550px) { + .p-menubar-end { + margin-left: auto !important; + } +} + +@media screen and (max-width: 360px) { + .p-menubar-start { + width: 60% !important; + } } .linkfree-icon { background-image: url('../images/linkfree.ico'); - width: 1rem; - height: 1rem; - background-size: 1rem 1rem; + width: 2rem; + height: 2rem; + background-size: 2rem 2rem; } .p-menuitem-text { font-weight: 600; + font-size: 20px; } diff --git a/src/Components/Navbar.js b/src/Components/Navbar.js index 546dee81e93..a3666c54d5e 100644 --- a/src/Components/Navbar.js +++ b/src/Components/Navbar.js @@ -42,11 +42,12 @@ function Navbar({ items, start, end }) { ) } - if (!items && !loading) { + if (!items) { items = [ { label: 'LinkFree', icon: 'linkfree-icon', + url: '/', }, ] } diff --git a/src/Components/UserProfile/User.js b/src/Components/UserProfile/User.js index dbbc722661e..de3982ed9e2 100644 --- a/src/Components/UserProfile/User.js +++ b/src/Components/UserProfile/User.js @@ -34,7 +34,7 @@ function User() { to="/" aria-label="Go back to Home" style={{ - 'margin-right': '15rem', // Added to center the icon & label + marginRight: '13rem', // Added to center the icon & label }} > From e08bce6272753fc5b1ef6d7ce3b702dbca060fb4 Mon Sep 17 00:00:00 2001 From: santhoshbala0178 Date: Wed, 16 Mar 2022 07:34:42 +0530 Subject: [PATCH 3/3] Removed unnecessary styling --- src/Components/Home/Searchbar.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Components/Home/Searchbar.js b/src/Components/Home/Searchbar.js index 98e656d8ec0..3999c2643ed 100644 --- a/src/Components/Home/Searchbar.js +++ b/src/Components/Home/Searchbar.js @@ -15,9 +15,6 @@ const Searchbar = ({ searchHandler, searchTerm }) => { name="user" id="search-input" placeholder="Search user..." - style={{ - width: '100%', - }} />