diff --git a/src/components/Home.jsx b/src/components/Home.jsx index 0f9c16e..c9bb6a4 100644 --- a/src/components/Home.jsx +++ b/src/components/Home.jsx @@ -12,8 +12,8 @@ export default function Home() { const { token, isLoggedIn } = useSelector(state => state.user) const [articles, setArticles] = useState([]) const [loading, setLoading] = useState(false) - const [articleByTag, setArticleByTag] = useState('') const [message, setMessage] = useState('') + const [articleByTag, setArticleByTag] = useState('') const [articleByFollowing, setArticleByFollowing] = useState(false) const [meta, setMeta] = useState({ to: 0, @@ -34,8 +34,8 @@ export default function Home() { setArticles(response.data.data) setMeta(response.data.meta) }else { - setMessage('No articles found.') - } + setMessage('No articles found') + } setLoading(false) } else if (articleByFollowing) { const response = await axios.get(`${BASE_URL}/followings/articles`, @@ -44,8 +44,8 @@ export default function Home() { setArticles(response.data.data) setMeta(response.data.meta) }else { - setMessage('No articles found.') - } + setMessage('No articles found') + } setLoading(false) } else { const response = await axios.get(`${BASE_URL}/articles`) @@ -101,17 +101,17 @@ export default function Home() { } {/* display all the published articles */} { - message ? + message ?
- No articles found + { message }
- : + : + /> } {/* display all the tags */} diff --git a/src/components/user/articles/UserArticles.jsx b/src/components/user/articles/UserArticles.jsx index 6511421..7ff21f0 100644 --- a/src/components/user/articles/UserArticles.jsx +++ b/src/components/user/articles/UserArticles.jsx @@ -24,12 +24,12 @@ export default function UserArticles() { try { const response = await axios.get(`${BASE_URL}/user/articles`, getConfig(token)) - if (response.data.data.length) { - setArticles(response.data.data) - }else { - setMessage('No articles found.') - } - setLoading(false) + if (response.data.data.length) { + setArticles(response.data.data) + }else { + setMessage('No articles found') + } + setLoading(false) } catch (error) { setLoading(false) console.log(error) @@ -64,7 +64,7 @@ export default function UserArticles() {
{ message }
- : + :
List of published articles