diff --git a/src/Components/Article/RelatedPosts.jsx b/src/Components/Article/RelatedPosts.jsx index 164344bd..00ae2b8a 100644 --- a/src/Components/Article/RelatedPosts.jsx +++ b/src/Components/Article/RelatedPosts.jsx @@ -7,6 +7,8 @@ import {NamePlate} from '../../Layout/Text/styledText'; import {MarginTop} from '../../Layout/Margin/styledMargin'; import {ArticleMainHr} from '../../Layout/Hr/styledHr'; import {ReadMore} from '../../Layout/Button/styledButton'; +import { Link } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; const RelatedPosts = (props) => { @@ -14,7 +16,11 @@ const RelatedPosts = (props) => { const articles = props.articles; const user = props.user; const recentPosts = articles.slice(0, 4) + const history = useHistory() + const handleReadMore = async () => { + history.push('/blog') +} return ( {recentPosts.map(article => { @@ -28,10 +34,12 @@ const RelatedPosts = (props) => {  ·  {timeFormater} - +
-

{articles.title || "No Code Approach — Process Speech and convert to Text — Logic Apps"}

-

{articles.description || "Using Azure Cognitive Services Speech to Text and Logic apps No Code — Workflow style We can re use the same pattern for other Azure Cognitive..."} + +

{article.title || "No Code Approach — Process Speech and convert to Text — Logic Apps"}

+ +

{article.description || "Using Azure Cognitive Services Speech to Text and Logic apps No Code — Workflow style We can re use the same pattern for other Azure Cognitive..."}

post @@ -49,7 +57,7 @@ const RelatedPosts = (props) => { ) })} - Read more from me + Read more from me
) diff --git a/src/Components/Article/RightColumn.jsx b/src/Components/Article/RightColumn.jsx index ee615217..c7299833 100644 --- a/src/Components/Article/RightColumn.jsx +++ b/src/Components/Article/RightColumn.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useContext} from 'react'; import {PageLinks, StyledRightContainer, AlignContent, SideUserContainer, PostContainer} from '../../Layout/Container/styledArticle'; import {SquareImage, CircleImage} from '../../Layout/Image/styledImage'; @@ -9,18 +9,32 @@ import {MdBookmarkBorder} from 'react-icons/md'; import { MarginTop } from '../../Layout/Margin/styledMargin'; import { ArticleInput } from '../../Layout/Input/styledInput'; import { Link } from 'react-router-dom'; - +import { useHistory } from 'react-router-dom'; +import { GlobalState } from '../../GlobalState'; const RightColumn = ({user, articles}) => { + const recentPosts = articles.slice(0, 5); + const history = useHistory(); + const state = useContext(GlobalState); + const [isLoggedIn] = state.userAPI.isLoggedIn - const recentPosts = articles.slice(0, 5) console.log(user) + + const handleClick= async (e) => { + history.push(`/${e}`) + } return ( - Get Started - Sign In + {!isLoggedIn ? + <> + handleClick('register')} >Get Started + Sign In + + : +

Welcome, {user.name.split(' ')[0]}

+ }
diff --git a/src/Components/Footer/Footer.css b/src/Components/Footer/Footer.css index 2e904bb0..00e39044 100755 --- a/src/Components/Footer/Footer.css +++ b/src/Components/Footer/Footer.css @@ -103,6 +103,16 @@ footer p { margin-left: 50px; } +@media only screen and (min-device-width: 375px) and (max-device-width: 1180px) { + .twitter-footer { + display: none; + } + + .social_footer_ul { + margin-left: 10% !important; + } +} + @media only screen and (max-width: 480px) { .dompl { margin: 0%; diff --git a/src/Components/NavBar/NavBar.css b/src/Components/NavBar/NavBar.css index eb7b6b31..5df2b572 100755 --- a/src/Components/NavBar/NavBar.css +++ b/src/Components/NavBar/NavBar.css @@ -78,7 +78,8 @@ height: 8vh; background-color: #1a1e23; } - .nav-logo { + .nav-logo, + .nav-title { display: none; } .nav-link { diff --git a/src/Components/NavBar/NavBar.jsx b/src/Components/NavBar/NavBar.jsx index 363e788d..3e2bbd7e 100755 --- a/src/Components/NavBar/NavBar.jsx +++ b/src/Components/NavBar/NavBar.jsx @@ -133,7 +133,7 @@ const NavBar = () => { HoseaCodes : -

Welcome, {user.name.split(' ')[0]}

+

Welcome, {user.name.split(' ')[0]}

}
    {isAdmin && adminRouter()} diff --git a/src/Components/NavBar/SideBar.jsx b/src/Components/NavBar/SideBar.jsx index 644e7afe..584d823b 100644 --- a/src/Components/NavBar/SideBar.jsx +++ b/src/Components/NavBar/SideBar.jsx @@ -36,7 +36,9 @@ const SideBar = () => { return ( - + + + diff --git a/src/Layout/Card/styledCard.jsx b/src/Layout/Card/styledCard.jsx index 47d209bf..bcd718c7 100644 --- a/src/Layout/Card/styledCard.jsx +++ b/src/Layout/Card/styledCard.jsx @@ -188,6 +188,9 @@ export const CardTitle = styled.h3` margin-top: 0; padding-top: 0; padding-bottom: 0; + @media only screen and (min-device-width: 375px) and (max-device-width: 1180px) { + font-size: 3.5rem; + } `; export const CardSubtitle = styled.h5` diff --git a/src/Layout/Container/styledArticle.jsx b/src/Layout/Container/styledArticle.jsx index bdf89fc4..52a0c213 100644 --- a/src/Layout/Container/styledArticle.jsx +++ b/src/Layout/Container/styledArticle.jsx @@ -78,6 +78,10 @@ export const AlignContent = styled.div` ${props => props.Gray && css` color: dimgray; `} + ${props => props.Column && css` + @media only screen and (min-device-width: 375px) and (max-device-width: 1180px) { + flex-direction: column; + }`} `; export const Tag = styled.div` diff --git a/src/Layout/Text/styledText.jsx b/src/Layout/Text/styledText.jsx index 3b86b0f8..10d73d57 100644 --- a/src/Layout/Text/styledText.jsx +++ b/src/Layout/Text/styledText.jsx @@ -62,6 +62,9 @@ export const BlogTitle= styled.h2` font-size: 6rem; ${props => props.Green && css` `} + @media only screen and (min-device-width: 375px) and (max-device-width: 1180px) { + font-size: 4rem; + } `; export const Subtitle= styled.h6` diff --git a/src/Pages/Articles/ArticleCard.jsx b/src/Pages/Articles/ArticleCard.jsx index 9bf7d871..1f30b5f9 100755 --- a/src/Pages/Articles/ArticleCard.jsx +++ b/src/Pages/Articles/ArticleCard.jsx @@ -35,7 +35,7 @@ const ArticleItem = (props) => {

    {title}

    1    {timeFormater}

    -

    {description}

    +

    {props.truncate(description)}


    {/*
    {ReactHtmlParser(sanitizedHtml)}
    */} diff --git a/src/Pages/Articles/Articles.css b/src/Pages/Articles/Articles.css index 3e9fda0b..480e986d 100755 --- a/src/Pages/Articles/Articles.css +++ b/src/Pages/Articles/Articles.css @@ -33,6 +33,7 @@ font-weight: bold; opacity: 0.5; text-decoration: none; + padding: 2%; } #tabs .nav-tabs .nav-link { @@ -45,7 +46,6 @@ .blog-tabs { display: flex; - justify-content: space-between; } .nav-item .nav-link { @@ -108,6 +108,7 @@ align-items: center; justify-content: center; text-align: center; + width: 100%; } .article-category-container { @@ -149,12 +150,6 @@ font-family: var(--main-font-family); cursor: pointer; } -.work-content { - text-overflow: ellipsis; - height: 20vh; - overflow: hidden; - font-size: 3rem !important; -} .article-line { background-color: lightgray; @@ -174,7 +169,7 @@ cursor: pointer; display: flex; flex-direction: column; - width: 50%; + width: 80%; height: 55%; border-radius: 12px; } @@ -188,7 +183,7 @@ .article-card-header { color: white; - font-size: 4rem !important; + font-size: 4rem; text-decoration: none; } @@ -303,7 +298,7 @@ .article-img { width: 100%; - height: 40rem; + height: 100%; object-fit: fill; border-radius: 12px; } @@ -463,7 +458,17 @@ .blog-categories h6 { text-transform: uppercase; } +@media only screen and (min-device-width: 375px) and (max-device-width: 1180px) { + .popular, + .subscribe-container, + .article-sidebar-container { + display: none !important; + } + .article-box { + grid-template-columns: 1fr; + } +} @media only screen and (max-width: 768px) { .article-sidebar { display: none; @@ -480,12 +485,6 @@ .article-box { padding: 8%; } - .article-card-header { - font-size: 3rem !important; - } - .work-content { - font-size: 2rem !important; - } .article-header, .blog-tabs, diff --git a/src/Pages/Articles/Articles.jsx b/src/Pages/Articles/Articles.jsx index bf2bb390..fc53c913 100755 --- a/src/Pages/Articles/Articles.jsx +++ b/src/Pages/Articles/Articles.jsx @@ -39,7 +39,10 @@ const Articles = () => { }); const currentPosts = mainPosts.slice(indexOfFirstPost, indexOfLastPost) - + const popularPosts = mainPosts.slice(indexOfLastPost, mainPosts.length) + const truncate = (str) => { + return str.length > 10 ? str.substring(0, 150) + "..." : str; + } const paginate = pageNum => setCurrentPage(pageNum); const nextPage = () => { if (currentPage > articles.length) return; @@ -198,7 +201,7 @@ const Articles = () => {
    {taggedArticles.map(article => { return ( - ) @@ -207,12 +210,12 @@ const Articles = () => { postsPerPage={postsPerPage} totalPosts={mainPosts.length} />
    } -
    +

    Popular Post

    - {mainPosts.map(article => { + {popularPosts.map(article => { return (
    {article.title}

    diff --git a/src/Pages/Auth/register.jsx b/src/Pages/Auth/register.jsx index 53fc0184..cdd5d9e1 100644 --- a/src/Pages/Auth/register.jsx +++ b/src/Pages/Auth/register.jsx @@ -42,7 +42,7 @@ const Register = () => { return (
    - brand-name + brand-name

    Registration