Skip to content

Commit

Permalink
without Implement layout id
Browse files Browse the repository at this point in the history
  • Loading branch information
ZainRk committed Apr 9, 2022
1 parent f8acd9c commit 06985f8
Show file tree
Hide file tree
Showing 25 changed files with 351 additions and 121 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@iconscout/react-unicons": "^1.1.6",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"react": "^18.0.0",
"react-circular-progressbar": "^2.0.4",
"react-dom": "^18.0.0",
"react-scripts": "5.0.0",
"web-vitals": "^2.1.0"
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
14 changes: 11 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
<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" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<style>
body {
margin: 0;
}
</style>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

59 changes: 29 additions & 30 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
:root {
--yellow: linear-gradient(180deg, #F8D49A -146.42%, #FAD79D -46.42%);
--orange: #fca61f;
--black: #242d49;
--gray: #788097;
--purple: linear-gradient(180deg, #BB67FF 0%, #C484F3 100%);
--pink: #FF919D;
--boxShadow: 0px 19px 60px rgb(0 0 0 / 8%);
--smboxShadow: -79px 51px 60px rgba(0, 0, 0, 0.08);
--activeItem: #f799a354;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.App {
/* padding: 0.5rem 3.5rem; */
color: var(--black);
background: linear-gradient(
106.37deg,
#ffe1bc 29.63%,
#ffcfd1 51.55%,
#f3c6f1 90.85%
);
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
font-family: 'Inter', sans-serif;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
.AppGlass {
display: grid;
height: 97%;
width: 97%;
background: rgba(255, 255, 255, 0.54);
border-radius: 2rem;
gap: 16px;
grid-template-columns: 11rem auto 20rem;
}
23 changes: 7 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import logo from './logo.svg';
import './App.css';
import './App.css'
import MainDash from './components/MainDash/MainDash';
import Sidebar from './components/Sidebar';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="AppGlass">
<Sidebar/>
<MainDash/>
</div>
</div>
);
}
Expand Down
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

34 changes: 34 additions & 0 deletions src/Data/Data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { UilUsdSquare, UilMoneyWithdrawal, UilClipboardAlt } from "@iconscout/react-unicons";

export const cardsData = [
{
title: "Sales",
color: {
backGround: "linear-gradient(180deg, #bb67ff 0%, #c484f3 100%)",
boxShadow: "0px 10px 20px 0px #e0c6f5",
},
barValue: 70,
value: "25,970",
png: UilUsdSquare,
},
{
title: "Revenue",
color: {
backGround: "linear-gradient(180deg, #FF919D 0%, #FC929D 100%)",
boxShadow: "0px 10px 20px 0px #FDC0C7",
},
barValue: 80,
value: "14,270",
png: UilMoneyWithdrawal,
},
{
title: "Expenses",
color: {
backGround: "linear-gradient(rgb(248, 212, 154) -146.42%, rgb(255 202 113) -46.42%)",
boxShadow: "0px 10px 20px 0px #F9D59B",
},
barValue: 60,
value: "4,270",
png: UilClipboardAlt,
},
];
55 changes: 55 additions & 0 deletions src/components/Card/Card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.card {
display: flex;
flex: 1;
height: 7rem !important;
border-radius: 0.7rem;
color: white;
padding: 1rem;
}

/* radial bar */
.radialBar {
flex: 1 1;
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: 1rem;
}
.CircularProgressbar {
width: 4rem !important;
overflow: visible;
}
.CircularProgressbar-path {
stroke: white !important;
stroke-width: 12px!important;
filter: drop-shadow(2px 4px 6px white);
}
.CircularProgressbar-trail {
display: none;
}
.CircularProgressbar-text {
fill: white !important;
}

.radialBar > span {
font-size: 17px;
font-weight: bold;
}

/* sideDetail*/
.detail {
flex: 1;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
}

.detail > span:nth-child(2) {
font-size: 22px;
font-weight: bold;
}
.detail > span:nth-child(3) {
font-size: 12px;
}

33 changes: 33 additions & 0 deletions src/components/Card/Card.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useState } from "react";
import "./Card.css";
import { CircularProgressbar } from "react-circular-progressbar";
import "react-circular-progressbar/dist/styles.css";
const Card = (props) => {
const Png = props.png;


return (
<div
className="card"
style={{
background: props.color.backGround,
boxShadow: props.color.boxShadow,
}}
>
<div className="radialBar">
<CircularProgressbar
value={props.barValue}
text={`${props.barValue}%`}
/>
<span>{props.title}</span>
</div>
<div className="detail">
<Png />
<span>${props.value}</span>
<span>Last 24 hours</span>
</div>
</div>
);
};

export default Card;
7 changes: 7 additions & 0 deletions src/components/Cards/Cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.Cards {
display: flex;
gap: 10px;
}
.parentContainer{
flex: 1;
}
27 changes: 27 additions & 0 deletions src/components/Cards/Cards.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";
import "./Cards.css";
import { cardsData } from "../../Data/Data";

import Card from "../Card/Card";

const Cards = () => {
return (
<div className="Cards">
{cardsData.map((card, id) => {
return (
<div className="parentContainer" key={id}>
<Card
title={card.title}
color={card.color}
barValue={card.barValue}
value={card.value}
png={card.png}
/>
</div>
);
})}
</div>
);
};

export default Cards;
3 changes: 3 additions & 0 deletions src/components/MainDash/MainDash.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.MainDash{
padding-top: 1rem;
}
13 changes: 13 additions & 0 deletions src/components/MainDash/MainDash.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import Cards from '../Cards/Cards'
import './MainDash.css'
const MainDash = () => {
return (
<div className="MainDash">
<h1>Dashboard</h1>
<Cards/>
</div>
)
}

export default MainDash
Loading

0 comments on commit 06985f8

Please sign in to comment.