Kaynağa Gözat

about

blog-new
Pavle Golubovic 3 yıl önce
ebeveyn
işleme
b4a8074aac

+ 31
- 20
frontend/src/pages/About.jsx Dosyayı Görüntüle

import PageLayout from '../layout/PageLayout'; import PageLayout from '../layout/PageLayout';
import useAnalytics from '../hooks/useAnalytics'; import useAnalytics from '../hooks/useAnalytics';
import ReactHelmet from '../components/shared/ReactHelmet'; import ReactHelmet from '../components/shared/ReactHelmet';
import { strapiApiBuilder } from './../utils/strapiApiBuilder';
import useDataApi from './../hooks/useDataApi';





const _data = { const _data = {
heading: { heading: {


const api_url = process.env.REACT_APP_API_URL; const api_url = process.env.REACT_APP_API_URL;


const strapiPopulate = [
'AboutUs',
'AboutUsCard',
'AboutUsCard.Image',
'Values',
'Values.Items',
'Values.Items.Image',
'Partners',
'Partners.images',
'Indrustries',
'Industries.Items',
'Industries.Items.Image',
'Timeline',
'Timeline.Steps'
];

export default function About() { export default function About() {
const [cnt, setCnt] = useState('');
const [isLoaded, setIsLoaded] = useState('');


useEffect(async () => {
const strapi = strapiApiBuilder('aboutpage', strapiPopulate);

const [{ data, isLoading, isError }, doFetch] = useDataApi(strapi);

useAnalytics('Home page');

useEffect(() => {
document.title = 'About Us'; document.title = 'About Us';
var vid = document.getElementById('animation');
vid.playbackRate = 2;
await axios
.get(
`${api_url}/api/aboutpage?populate[0]=SEO&populate[1]=SEO.metaSocial&populate[2]=SEO.metaImage&populate[3]=SEO.metaSocial.image`,
)
.then(res => {
setCnt(res.data.data.attributes);
setIsLoaded(true);
})
.catch(err => {
console.log(err);
setIsLoaded(false);
});
}, []); }, []);


useAnalytics('About Us');


if (!isLoaded) {

if (isLoading) {
return ( return (
<div className="z-50 w-full h-screen bg-white dark:bg-dg-primary-1700 dark:text-white flex items-center justify-center text-3xl font-semibold"> <div className="z-50 w-full h-screen bg-white dark:bg-dg-primary-1700 dark:text-white flex items-center justify-center text-3xl font-semibold">
<video id="animation" width="540" height="540" autoPlay muted loop> <video id="animation" width="540" height="540" autoPlay muted loop>


return ( return (
<PageLayout> <PageLayout>
{cnt.SEO && <ReactHelmet seo={cnt.SEO} />}
{data.SEO && <ReactHelmet seo={data.SEO} />}
<div className="bg-white dark:bg-dg-primary-1700 w-full pt-32"> <div className="bg-white dark:bg-dg-primary-1700 w-full pt-32">
{/* Heading Section */} {/* Heading Section */}
<section <section

+ 1
- 0
frontend/src/pages/Careers.jsx Dosyayı Görüntüle

<p className="paragraph"> <p className="paragraph">
{cntCareers.diligent_life.heading_section.paragraph} {cntCareers.diligent_life.heading_section.paragraph}
</p> </p>

{/* Video Frame */} {/* Video Frame */}
{cntCareers && cntCareers.Video != undefined ? ( {cntCareers && cntCareers.Video != undefined ? (
<VideoComponent source={cntCareers.Video.data.attributes.url} /> <VideoComponent source={cntCareers.Video.data.attributes.url} />

+ 0
- 4
frontend/src/pages/DiligentLife.jsx Dosyayı Görüntüle

}); });
}, []); }, []);


useEffect(() => {
console.log(cntCareers)
},[cntCareers])

if (!isLoaded) { if (!isLoaded) {
return ( return (
<div className="z-50 w-full h-screen bg-white dark:bg-dg-primary-1700 dark:text-white flex items-center justify-center text-3xl font-semibold"> <div className="z-50 w-full h-screen bg-white dark:bg-dg-primary-1700 dark:text-white flex items-center justify-center text-3xl font-semibold">

+ 0
- 8
frontend/src/pages/Home.jsx Dosyayı Görüntüle

]; ];


export default function Home({ forwardedRef }) { export default function Home({ forwardedRef }) {
const [cnt, setCnt] = useState('');

const [contactRef, setRef] = useState(forwardedRef);


const strapi = strapiApiBuilder('w-home-page', strapiPopulate); const strapi = strapiApiBuilder('w-home-page', strapiPopulate);


const [{ data, isLoading, isError }, doFetch] = useDataApi(strapi); const [{ data, isLoading, isError }, doFetch] = useDataApi(strapi);


const [contactElement, setContactElement] = useState(0);


useAnalytics('Home page'); useAnalytics('Home page');


document.title = 'Diligent Software'; document.title = 'Diligent Software';
}, []); }, []);


useEffect(() => {
const url = window.location.pathname;
const h = window.document.body.offsetHeight;
}, [contactRef, cnt]);


if (isLoading) { if (isLoading) {
return ( return (

Loading…
İptal
Kaydet