Skip to content

Commit

Permalink
Update Project.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
adpekalski committed Jan 18, 2024
1 parent e9b5202 commit 6c99034
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/components/project/Project.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,36 @@ import React from 'react';
import { second } from '@/app/fonts';
import './project.css';

import { projectsData } from '@/data/ProjectsData';

import { projectsData } from '@/data/WebsiteData';
import Title from '../title/Title';
import Card from '../card/Card';



const Project = (props) => {
const { which, usedHeight, device } = props;
const { which, minHeight } = props;

const [hidden, setHidden] = React.useState(false);
let showMoreOrLess = hidden ? "Go back" : "Read more";

let currentProject = projectsData.description[which];
let choosenCard = <Card picture={which}></Card>;
if (device === "mobile" || usedHeight < 800) {
let choosenCard = <Card whichOne={which}></Card>;
if (!minHeight) {
currentProject = (
<>
{hidden ? projectsData.description[which] + " " : projectsData.shortDescription[which] + " "}

<span className='expand-text'>{showMoreOrLess}</span>
<span className='green-text'>{showMoreOrLess}</span>


</>
);
choosenCard = hidden ? null : <Card picture={which}></Card>;
choosenCard = hidden ? null : <Card whichOne={which}></Card>;

}
return (
<div className='project'>
<h1
className={second.className + ' project--name'}
>
{projectsData.projectName[which]}
</h1>
<Title>{projectsData.projectName[which]}</Title>
{choosenCard}
<p
className='project--desc'
Expand All @@ -43,8 +41,11 @@ const Project = (props) => {
}}
>
{currentProject}

</p>
</div>
{hidden ? <p style={{ textAlign: "center" }} className="green-text">More text icoming </p> : null
}
</div >
);
};

Expand Down

0 comments on commit 6c99034

Please sign in to comment.