diff --git a/.env b/.env index 3e4b531..56afd7f 100644 --- a/.env +++ b/.env @@ -5,12 +5,14 @@ REACT_APP_YEAR=2023 REACT_APP_ANDROID_URL="https://play.google.com/store/apps/details?id=com.mermsemr.myfit" REACT_APP_IOS_URL="https://play.google.com/store/apps/details?id=com.mermsemr.myfit" -REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246" -REACT_APP_TWITTER="https://twitter.com/fluxtra" REACT_APP_APPSITE=" https://myfitapp.mermsemr.com" #REACT_APP_APPSITE="http://localhost:7012" +# Social Media Links +REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246" +REACT_APP_TWITTER="https://twitter.com/fluxtra" + REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit" REACT_APP_FORM_TIMEOUT = 10000 diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 1b8caf4..bea1a8b 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -3008,11 +3008,17 @@ header.fix_style.white_header { margin-bottom: 15px; } -.blog_detail_section .blog_inner_pannel .review span { +.blog_detail_section .blog_inner_pannel span.blog_date { line-height: 1; + color: var(--purple); + display: flex; + font-weight: 700; + text-align: center; + justify-content: center; + align-items: center; } -.blog_detail_section .blog_inner_pannel .review span:first-child { +/* .blog_detail_section .blog_inner_pannel .review span:first-child { color: var(--purple); display: inline-block; font-weight: 700; @@ -3024,7 +3030,7 @@ header.fix_style.white_header { margin-left: 15px; padding-left: 15px; border-left: 1px solid var(--dark-purple); -} +} */ .blog_detail_section .blog_inner_pannel .section_title { margin-bottom: 40px; @@ -3043,29 +3049,29 @@ header.fix_style.white_header { } .blog_detail_section .blog_inner_pannel .info h3 { - font-weight: 700; - color: var(--dark-purple); - margin-top: 30px; - font-size: 25px; - margin-bottom: 15px; + font-weight: 700; + color: var(--dark-purple); + margin-top: 30px; + font-size: 25px; + margin-bottom: 15px; } /* To highlight the link in the terms section */ -.blog_detail_section .blog_inner_pannel .info p span a{ - color: var(--dark-purple); - text-decoration: underline; +.blog_detail_section .blog_inner_pannel .info p span a { + color: var(--dark-purple); + text-decoration: underline; } /* To reduce the fonts for sub-headers */ .blog_detail_section .blog_inner_pannel .info h4 { - font-weight: 700; - color: var(--dark-purple); - margin-top: 30px; - font-size: 20px; - margin-bottom: 15px; - } + font-weight: 700; + color: var(--dark-purple); + margin-top: 30px; + font-size: 20px; + margin-bottom: 15px; +} - /* To align the text for proper readability */ +/* To align the text for proper readability */ .blog_detail_section .blog_inner_pannel .info p { text-align: justify; } @@ -3526,39 +3532,71 @@ header.fix_style.white_header { } /* Textarea scrollbar */ -.contact_page_section .contact_inner .contact_form form .form-group textarea::-webkit-scrollbar { +.contact_page_section + .contact_inner + .contact_form + form + .form-group + textarea::-webkit-scrollbar { width: 12px; cursor: pointer; } -.contact_page_section .contact_inner .contact_form form .form-group textarea::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); +.contact_page_section + .contact_inner + .contact_form + form + .form-group + textarea::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); border-radius: 10px; background-color: var(--light-bg); } -.contact_page_section .contact_inner .contact_form form .form-group textarea::-webkit-scrollbar-thumb { +.contact_page_section + .contact_inner + .contact_form + form + .form-group + textarea::-webkit-scrollbar-thumb { border-radius: 10px; - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5); background-color: var(--body-text-purple); } -.contact_page_section .contact_inner .contact_form form .form-group .contact_btn{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + .contact_btn { display: flex !important; align-items: center; justify-content: center; } -.contact_page_section .contact_inner .contact_form form .form-group .contact_btn p{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + .contact_btn + p { margin: 0 !important; } -.contact_page_section .contact_inner .contact_form form .form-group .contact_btn > span{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + .contact_btn + > span { width: 24px; height: 24px; } -#contact_body{ +#contact_body { min-height: 48rem; display: flex; flex-direction: column; @@ -3567,7 +3605,7 @@ header.fix_style.white_header { gap: 10px; } -.contact_body{ +.contact_body { display: flex; flex-direction: column; align-content: center; @@ -3598,28 +3636,44 @@ header.fix_style.white_header { } /* For the err msg */ -#errText{ +#errText { text-align: center; color: tomato; font-weight: 600; } -.contact_page_section .contact_inner .contact_form form .form-group span{ +.contact_page_section .contact_inner .contact_form form .form-group span { font-size: 12px; color: tomato; padding: 3px; display: none; } -.contact_page_section .contact_inner .contact_form form .form-group input:valid[focused="true"]{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + input:valid[focused="true"] { border: 1px solid var(--dark-purple); } -.contact_page_section .contact_inner .contact_form form .form-group input:invalid[focused="true"]{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + input:invalid[focused="true"] { border: 1px solid tomato; } -.contact_page_section .contact_inner .contact_form form .form-group input:invalid[focused="true"] ~ span{ +.contact_page_section + .contact_inner + .contact_form + form + .form-group + input:invalid[focused="true"] + ~ span { display: block; } @@ -4689,19 +4743,20 @@ header.fix_style.white_header { /* Loader */ -.loader{ +.loader { border-radius: 100%; position: relative; } -.loader-sm{ +.loader-sm { width: 24px; height: 24px; } /* LOADER 1 */ -#loader-1:before, #loader-1:after{ +#loader-1:before, +#loader-1:after { content: ""; position: absolute; width: 100%; @@ -4711,24 +4766,24 @@ header.fix_style.white_header { border-top-color: var(--body-text-purple); } -#loader-1:before{ +#loader-1:before { z-index: 100; animation: spin 1.5s infinite; } -#loader-1:after{ +#loader-1:after { border: 3.5px solid #ccc; } -@keyframes spin{ - 0%{ +@keyframes spin { + 0% { -webkit-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); } - 100%{ + 100% { -webkit-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); diff --git a/src/component/Blog/Blog/Main.js b/src/component/Blog/Blog/Main.js index ad83a2f..43a4623 100644 --- a/src/component/Blog/Blog/Main.js +++ b/src/component/Blog/Blog/Main.js @@ -1,47 +1,74 @@ +/** @format */ + import React, { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import BGImg from "../../../assets/images/bread_crumb_bg.png"; -import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"; -import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"; import SiteService from "../../../vendors/service/siteService"; + const Main = ({ brdcum, bgimg }) => { const [blogData, setBlogData] = useState([]); - console.log(blogData); - const api = new SiteService(); + let api = new SiteService(); useEffect(() => { getBlogData(); }, []); const getBlogData = async () => { - try { - const res = await api.blogData(); + /* + The reason for this, is because of the breaking I had when building the blog + I decided to save to the local storage for an hour so that it won't need to be going to the server again but I can change this + */ + // Saving it locally to avoid interfering with server + if (localStorage.getItem("myFit--blogData") == null) { + try { + let res = await api.blogData(); - setBlogData(res.data); - - // console.log(res.data); - - - } catch (error) { - console.log("Error from blog data ", error); + // Set the blog data to local storage + localStorage.setItem("myFit--blogData", JSON.stringify(res.data)); + setBlogData(res.data); + // Set a time out for the blog data to be deleted from local storage + setTimeout(() => { + localStorage.removeItem("myFit--blogData"); + }, 3600); + } catch (error) { + console.log("Error from blog data ", error); + } + } else { + try { + let data = JSON.parse(localStorage.getItem("myFit--blogData")); + setBlogData(data); + } catch (error) { + console.error("Error parsing JSON data: ", error); + } } }; - + return ( <> -
+
{" "} - image{" "} + image{" "} {" "} - image{" "} + image{" "} {" "} - image{" "} + image{" "}
@@ -54,93 +81,122 @@ const Main = ({ brdcum, bgimg }) => { ยป
  • - Blog + + {blogData.map((item, idx) => { + if (idx === 0) { + return {item.post_title}; + } + })} +
  • - {/*
    -
    -
    - - -
    -
    -
    */}
    - {blogData.map((data,index) => { - if (index == 0){ + {blogData.length < 1 && ( +
    + )} + {blogData.map((data, index) => { + if (index == 0) { return ( -
    -
    -
    -
    - image - {/* 20 min ago */} - - {new Date (data.post_date).toDateString()} +
    +
    +
    +
    + image + + {new Date(data.post_date).toDateString()} +
    -
    -
    -
    -
    -

    {data.post_title}

    -
    - +
    +
    +
    +

    {data.post_title}

    +
    + {/* Change the route name */} + READ MORE +
    -
    - - ) - } + ); + } })} - -
    -
    + +
    {blogData.map((data, index) => { - if (index > 0){ + if (index > 0) { return ( -
    -
    -
    - image - {new Date (data && data.post_date).toDateString()} +
    +
    +
    + image + + {new Date(data && data.post_date).toDateString()} + +
    +
    +

    {data.post_title}

    +
    + {/* Change the route name */} + + READ MORE + +
    +
    -
    -

    {data.post_title}

    -
    - - READ MORE - -
    -
    -
    - - )} - - - })} + ); + } + })}
    +
    • - + {" "} Visit our blog diff --git a/src/component/Blog/BlogSingle/Main.js b/src/component/Blog/BlogSingle/Main.js index b538e19..0d1503f 100644 --- a/src/component/Blog/BlogSingle/Main.js +++ b/src/component/Blog/BlogSingle/Main.js @@ -1,332 +1,200 @@ +/** @format */ + import React, { useEffect, useState } from "react"; -import { Link, useLocation } from 'react-router-dom' -import Bredcrumb from '../../Bredcrumb/Main' -import BGImg from "../../../assets/images/bread_crumb_bg.png" -import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png" -import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png" -import { useParams } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; +import Bredcrumb from "../../Bredcrumb/Main"; +import BGImg from "../../../assets/images/bread_crumb_bg.png"; +import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"; +import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"; import SiteService from "../../../vendors/service/siteService"; +const Main = ({ brdcum }) => { + const location = useLocation(); + let data = location.state?.data; + const [blogData, setBlogData] = useState([]); -const Main = ({brdcum}) => { - const { id } = useParams(); - const location = useLocation(); - const [blogData, setBlogData] = useState([]); - const [newAllData, setNewAllData] = useState([]); - - + let api_call = new SiteService(); useEffect(() => { getBlogData(); - getLatestBlog(); - }, [location.state?.data]); - - const api = new SiteService(); - const data = location.state?.data; - const allData = location.state?.allData; - - - const getLatestBlog = () =>{ - const arrData = [ ...allData ]; - const itemIndex = arrData.findIndex(x => x.id === data.id) - arrData.splice(itemIndex, 1); - const newAllData = arrData.splice(0, 3); - setNewAllData(newAllData); - - console.log('All data ', arrData, newAllData); -} + }, [blogData]); const getBlogData = async () => { - try { - const res = await api.blogData(); - setBlogData(res.data); - - } catch (error) { - console.log("Error from blog data ", error); + /* + The reason for this, is because of the breaking I had when building the blog + I decided to save to the local storage for an hour so that it won't need to be going to the server again but I can change this + */ + // Saving it locally to avoid interfering with server + if (localStorage.getItem("myFit--blogData") == null) { + try { + let res = await api_call.blogData(); + + // Set the blog data to local storage + localStorage.setItem("myFit--blogData", JSON.stringify(res.data)); + setBlogData(res.data); + // Set a time out for the blog data to be deleted from local storage + setTimeout(() => { + localStorage.removeItem("myFit--blogData"); + }, 3600); + } catch (error) { + console.log("Error from blog data ", error); + } + } else { + try { + let data = JSON.parse(localStorage.getItem("myFit--blogData")); + setBlogData(data); + } catch (error) { + console.error("Error parsing JSON data: ", error); + } } }; - + return ( <> - - {brdcum.b1 && - } + {brdcum.b1 && ( + + )} - {brdcum.b2 && - } + {brdcum.b2 && ( + + )} - {brdcum.b5 && - } + {brdcum.b5 && ( + + )} - {brdcum.b3 && - } + {brdcum.b3 && ( + + )} - {brdcum.b4 && - } + {brdcum.b4 && ( + + )} -
      -
      -
      -
      - Review - {/* 45 min ago */} - {new Date (data && data.post_modified).toDateString()} +
      +
      +
      + + {new Date(data && data.post_modified).toDateString()} + -
      -
      -

      {data && data.post_title}

      -
      -
      - image -
      -
      -

      {data && data.post_name}

      -
      -
      - {/*
      -

      Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived.

      -

      Printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unnown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys centuries, but also the leap into electronic.

      -

      Why we are best

      -

      Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic.

      -
        -
      • Lorem Ipsum is simply dummy text of the printing and typesetting in

      • -
      • Dustry lorem Ipsum has been the industrys standard dummy text ev er since the when

      • -
      • Unknown printer took a galley of type and scrambled it to make.

      • -
      • Type specimen book. It has survived not only five centuries, but also the leap into electronic.

      • -
      • Lorem Ipsum is simply dummy text of the printing.

      • -
      • Dustry lorem Ipsum has been the industrys standard dummy text ev er since.

      • -
      • Unknown printer took a galley of type and scrambled it to make.

      • -
      • Type specimen book. It has survived not only.

      • -
      -
      -
      -
      -
      - image -
      -
      - image -
      -
      -
      -
      -

      Why we are best

      -

      Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived.

      -
      -
      - image -

      Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy.

      -

      Mr. John Doe, Apper Inc

      -
      */} - {/*

      Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic industry.

      */} -
      -
      - {/*
      - image -
      */} -
      -

      {data && data.post_author}

      - {new Date (data && data.post_date).toDateString()} -
      -
      -
      -
        -
      • -
      • -
      • -
      • -
      -
      -
      -
      -
        -
      • Tags:

      • -
      • app,
      • -
      • rating,
      • -
      • development
      • -
      -
      -
      +
      +

      {data && data.post_title}

      -
      -
      -
      -
      -

      3 Comments

      +
      + image +
      +
      +

      {data && data.post_name}

      +
      +
      + +
      +
      +
      + {/*

      {data && data.post_author}

      */} + {new Date(data && data.post_date).toDateString()}
      +
      +
        -
      • -
        -
        - image -
        -
        - 30 min ago -

        Dolly Shell

        -
        -
        -
        -

        Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the in - dustrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.

        -
        -
      • -
      • -
        -
        - image -
        -
        - 15 min ago -

        Devil Joe

        -
        -
        -
        -

        Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the when.

        -
        -
      • -
      • -
        -
        - image -
        -
        - 2 days ago -

        Sherly Shie

        -
        -
        -
        -

        Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the in - dustrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.

        -
        -
      • +
      • + + + +
      • +
      • + + + +
      +
      -
      - -
      -
      -
      -

      Leave a comment

      -

      Your email address will not be published. Required fields are marked *

      -
      -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      + -
      +
      +
      +
      -
      -
      -
      -

      Read latest story

      -

      Lorem Ipsum is simply dummy text of the printing and typese tting
      indus orem Ipsum has beenthe standard dummy.

      +
      +
      + {/* Latest Title */} +
      +

      + Read latest story +

      +
      +
      + {/* Body */} +
      + {blogData.slice(-4, -1).map((item, index) => ( +
      +
      +
      + image + {new Date(item.post_date).toDateString()} +
      +
      +

      {item.post_title}

      +
      + READ MORE +
      -
      - - {newAllData.map((data) => { - - return ( - -
      -
      -
      - image - 45 min ago -
      -
      -

      {data.post_title}

      -
      - - READ MORE - -
      -
      -
      - - )})} - - - - - - {/*
      -
      -
      - image - 45 min ago -
      -
      -

      Top rated app! Yupp.

      -

      Simply dummy text of the printing and typesetting industry lorem Ipsum has Lorem Ipsum is.

      - READ MORE -
      -
      -
      -
      -
      -
      - image - 45 min ago -
      -
      -

      Creative ideas on app.

      -

      Printing and typesetting industry lorem Ipsum has Lorem simply dummy text of the.

      - READ MORE -
      -
      -
      */} -
      -
      -
      +
      + ))} +
      +
    +
    - ) -} + ); +}; -export default Main \ No newline at end of file +export default Main; diff --git a/src/component/Contact/Main.js b/src/component/Contact/Main.js index 5ab1a9f..bc16627 100644 --- a/src/component/Contact/Main.js +++ b/src/component/Contact/Main.js @@ -78,7 +78,6 @@ const Main = ({ brdcum }) => { const onChange = (e) => { setValues((prev) => ({ ...prev, [e.target.name]: e.target.value })); }; - console.log(values); // Submitting form const handleSubmit = async (e) => { @@ -121,7 +120,7 @@ const Main = ({ brdcum }) => { }, []); useEffect(() => { - console.log(myData); + myData }, [myData]); return ( diff --git a/src/routes/index.js b/src/routes/index.js index d9326da..228d301 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -86,7 +86,7 @@ const Routing = () => { } /> } /> } /> - } /> + } /> } /> } /> } />