Skip to content

Feedback #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8919eec
Setting up GitHub Classroom Feedback
github-classroom[bot] Jul 3, 2022
0c55dec
icon set added to project
yucesoymert Jul 12, 2022
350ebec
card component created
yucesoymert Jul 12, 2022
41b8fd4
date component created
yucesoymert Jul 12, 2022
41d4f4e
header component created
yucesoymert Jul 12, 2022
a66e3a4
icon component created
yucesoymert Jul 12, 2022
c13c77d
info component created
yucesoymert Jul 12, 2022
1601a00
members component created
yucesoymert Jul 12, 2022
a0d688d
progress component created
yucesoymert Jul 12, 2022
4858698
signal component created
yucesoymert Jul 12, 2022
bc4e151
status component created
yucesoymert Jul 12, 2022
dbfe115
App.js updated with CardTable
yucesoymert Jul 12, 2022
dd103a8
font family added
yucesoymert Jul 12, 2022
306cfe3
updated card component
yucesoymert Jul 12, 2022
3b8c298
updated icon component
yucesoymert Jul 12, 2022
c113c2e
updated member component
yucesoymert Jul 12, 2022
12555a5
updated progress component
yucesoymert Jul 12, 2022
f56deeb
updated status component
yucesoymert Jul 12, 2022
54470e2
updated plus svg
yucesoymert Jul 12, 2022
49b6f3d
added: header
gorguluarslan Jul 12, 2022
fe8b803
update: change
gorguluarslan Jul 13, 2022
c62c7d5
Merge branch 'table' into header
gorguluarslan Jul 13, 2022
2bd5a29
Update: Folder name changed
gorguluarslan Jul 13, 2022
d935232
Update: Folder Name Changed
gorguluarslan Jul 13, 2022
d1201a2
Update: Sidebar component
MASPCHINE Jul 13, 2022
ce2e4bc
Update : Sidebar v2
MASPCHINE Jul 13, 2022
bdf6832
Updated :
MASPCHINE Jul 14, 2022
477c0f6
updated: app.scss fixed
guneyeroglu Jul 15, 2022
250a637
updated: icon bar fixed
guneyeroglu Jul 15, 2022
98ab2e4
added: sidebar
guneyeroglu Jul 15, 2022
55697d7
updated: fixed structure
guneyeroglu Jul 15, 2022
cc89c9c
updated: wrapper and scss fixed
guneyeroglu Jul 15, 2022
66ebcc6
updated: folder name fixed
guneyeroglu Jul 15, 2022
b8d7840
updated: axios added
guneyeroglu Jul 15, 2022
ffeb8f8
updated: name changed
guneyeroglu Jul 15, 2022
ae2354a
figma
gorguluarslan Nov 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31,245 changes: 31,245 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "react-dashboard",
"name": "my-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"node-sass": "^7.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
33 changes: 19 additions & 14 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>React Dashboard</title>
</head>

<body>
<div id="root"></div>
</body>

</html>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
41 changes: 39 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
import { useState, useEffect } from "react";
import axios from "axios";

import Header from "./components/Header/Header";
import Card from "./components/Card/Card";
import Sidebar from "./components/Sidebar/Sidebar";

import styles from "./components/Card/card.module.scss";
import "./App.scss";

const App = () => {
const [projectData, setProjectData] = useState([]);
const [search, setSearch] = useState("");
const [selected, setSelected] = useState("");

const value = { search, selected, setSearch, setSelected };

const fetchData = async () => {
const result = await axios(
"https://private-e6514c-projectsinfo.apiary-mock.com/getProjects"
);
setProjectData(result.data);
};

useEffect(() => {
fetchData();
}, []);

return (
<h1>React Dashboard</h1>
<div className="wrapper">
<div className="wrapper__left">
<Sidebar />
</div>
<div className="wrapper__right">
<Header value={value} />
<div className={styles.table}>
<Card styles={styles} value={value} data={projectData} />
</div>
</div>
</div>
);
}
};

export default App;
33 changes: 33 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
* {
box-sizing: border-box;

&::after {
box-sizing: border-box;
}

&::before {
box-sizing: border-box;
}
}

body {
margin: 0;
padding: 0;
}

.wrapper {
display: flex;

&__left {
flex: 0 1 15%;
max-width: 400px;
min-width: 300px;
min-height: 100vh;
height: auto;
}

&__right {
flex: 0 1 85%;
margin: 0 0 16px 0;
}
}
364 changes: 364 additions & 0 deletions src/assets/icons/Icon.js

Large diffs are not rendered by default.

Binary file added src/assets/image/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";

const Button = ({ styles }) => {
return (
<div className={styles.button}>
<button type="submit">
<span>+ </span>
<span>New</span>
</button>
</div>
);
};

export default Button;
59 changes: 59 additions & 0 deletions src/components/Card/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { useState } from "react";

import ProjectTop from "./CardItemTop";
import ProjectMid from "./CardItemMiddle";
import ProjectBottom from "./CardItemBottom";

const Card = ({ styles, data, value }) => {
const { search, selected } = value;

const projectData = data
.filter(
(project) =>
project.name.toLowerCase().includes(search.toLowerCase()) ||
project.name.toLocaleLowerCase().includes(search.toLocaleLowerCase())
)
.filter(
(project) =>
project.status?.includes(selected) || project.activity === selected
);

const hasProject = projectData.length ? (
projectData.map((project) => {
return (
<div key={project.id} className={styles.table__item}>
<div className={styles.card}>
<ProjectTop
styles={styles}
title={project.name}
activity={project.activity}
/>
<ProjectMid
styles={styles}
date={project.startDate}
status={project.status}
number={{ one: 15, two: project.members.length }}
/>
<ProjectBottom
styles={styles}
members={project.members}
progress={project.progress}
/>
</div>
</div>
);
})
) : (
<div className={styles.loading}>NO PROJECTS FOUND</div>
);

const Wrapper = data.length ? (
hasProject
) : (
<div className={styles.loading}>LOADING...</div>
);

return Wrapper;
};

export default Card;
59 changes: 59 additions & 0 deletions src/components/Card/CardItemBottom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { PlusIcon } from "../../assets/icons/Icon";

export const Member = ({ picture }) => {
return <img src={picture.src} alt={picture.alt} />;
};

export const MembersBar = ({ styles, members }) => {
return (
<div className={styles.container}>
<div className={styles.title}>Members</div>
<div className={styles.images}>
<div className={styles.profiles}>
{members.map((member, index) => (
<Member
key={member.url + member.alt + index}
picture={{ src: member.src, alt: member.alt }}
/>
))}
</div>
<div className={styles.plus}>
<PlusIcon />
</div>
</div>
</div>
);
};

export const Progress = ({ styles, progress }) => {
return (
<div className={styles.progress__bar}>
<div className={styles.color} style={{ width: `${progress}%` }}></div>
</div>
);
};

export const ProgressBar = ({ styles, progress }) => {
return (
<div className={styles.progress}>
<div className={styles.progress__title}>
<span>Progress</span>
</div>
<div className={styles.progress__percent}>
<span>{progress}%</span>
</div>
<Progress styles={styles} progress={progress} />
</div>
);
};

const CardItemBottom = ({ styles, members, progress }) => {
return (
<div className={styles.card__bottom}>
<MembersBar styles={styles} members={members} />
<ProgressBar styles={styles} progress={progress} />
</div>
);
};

export default CardItemBottom;
62 changes: 62 additions & 0 deletions src/components/Card/CardItemMiddle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from "react";
import { DotIcon, LineIcon } from "../../assets/icons/Icon";

export const Date = ({ styles, date }) => {
return (
<div className={styles.date}>
<span>Start Date</span>
<span>{date}</span>
</div>
);
};

export const Status = (props) => {
const styles = props.styles;
let color;
let status;
switch (props.status) {
case "Completed":
color = "#45DB99";
status = "Completed";
break;

case "On Hold":
color = "#F0BB00";
status = "On hold";
break;
default:
break;
}

return (
<div className={styles.status}>
<DotIcon fill={color} />
<span style={{ color: `${color}` }}>{status}</span>
</div>
);
};

const Signal = ({ styles, number, name }) => {
return (
<div className={styles.container}>
<div className={styles.number}>{number}</div>
<div className={styles.name}>{name}</div>
</div>
);
};

const CardItemMiddle = ({ styles, status, date, number }) => {
return (
<div className={styles.card__mid}>
<Date styles={styles} date={date} />
<Status styles={styles} status={status} />
<div className={styles.buttons}>
<Signal styles={styles} number={number.one} name={"Tasks"} />
<LineIcon />
<Signal styles={styles} number={number.two} name={"Users"} />
</div>
</div>
);
};

export default CardItemMiddle;
54 changes: 54 additions & 0 deletions src/components/Card/CardItemTop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { DotIcon, EditIcon, PencilIcon } from "../../assets/icons/Icon";

export const Title = ({ title, styles }) => {
return (
<div className={styles.title}>
<h2>{title}</h2>
</div>
);
};

export const Icons = ({ styles }) => {
return (
<div className={styles.icons}>
<PencilIcon />
<EditIcon />
</div>
);
};

export const Activity = ({ styles, activity }) => {
let color;
let status;
switch (activity) {
case true:
color = "#00DB99";
status = "Active";
break;
case false:
color = "#FF285C";
status = "Inactive";
break;
default:
break;
}

return (
<div className={styles.activity}>
<DotIcon fill={color} />
<span style={{ color: `${color}` }}>{status}</span>
</div>
);
};

const CardItemTop = ({ title, styles, activity }) => {
return (
<div className={styles.card__header}>
<Title title={title} styles={styles} />
<Icons styles={styles} />
<Activity styles={styles} activity={activity} />
</div>
);
};

export default CardItemTop;
Loading