From 6416e00bb4095c7d57535978d2ea3cfc3cda106b Mon Sep 17 00:00:00 2001 From: jtan381 Date: Sun, 11 Oct 2020 15:32:51 +0800 Subject: [PATCH] moblie reponsive --- src/components/PieChartBalancev2.js | 140 +++++++++++++++------------- src/views/Home.js | 27 ++++-- 2 files changed, 92 insertions(+), 75 deletions(-) diff --git a/src/components/PieChartBalancev2.js b/src/components/PieChartBalancev2.js index 8ecec2f..f66b21d 100644 --- a/src/components/PieChartBalancev2.js +++ b/src/components/PieChartBalancev2.js @@ -2,10 +2,14 @@ import React, { useState } from "react"; import { PieChart } from "react-minimal-pie-chart"; import styled from "styled-components"; +const MainWrapper = styled.div` + display: grid; + grid-template-columns: auto auto; + align-items: center; +`; + const Wrapper = styled.div` display: grid; - // justify-items: center; - // align-items: center; grid-template-rows: auto auto auto; `; @@ -60,78 +64,84 @@ export default function PieChartBalancev2(props) { // }); return ( -
-

- Account Summary -

- (index === selected ? 6 : 1)} - animate - label={({ dataEntry }) => - "$" + - dataEntry.value.toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }) - } - labelPosition={112} - labelStyle={{ - fill: "#fff", - }} - viewBoxSize={[180, 180]} - center={[90, 90]} - > + +
+

+ Account Summary +

(index === selected ? 6 : 1)} + animate label={({ dataEntry }) => "$" + - dataEntry.total.toLocaleString(undefined, { + dataEntry.value.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2, }) } - labelPosition={100} - viewBoxSize={[150, 150]} - center={[75, 75]} - /> - - - {data.map((data) => { - return ( - -
-
{data.title}
-
- ); - })} -
-
+ labelPosition={112} + labelStyle={{ + fill: "#fff", + }} + viewBoxSize={[180, 180]} + center={[90, 90]} + > + + "$" + + dataEntry.total.toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }) + } + labelPosition={100} + viewBoxSize={[150, 150]} + center={[75, 75]} + /> + +
+
+ + {data.map((data) => { + return ( + +
+
+ {data.title} +
+
+ ); + })} +
+
+ ); } diff --git a/src/views/Home.js b/src/views/Home.js index 08c417a..002c61b 100644 --- a/src/views/Home.js +++ b/src/views/Home.js @@ -31,6 +31,20 @@ const Wrapper = styled.div` justify-items: center; align-items: center; grid-template-columns: 50% 50%; + @media (max-width: 991px) { + grid-template-columns: auto; + } +`; + +const SummaryWrapper = styled.div` + background: #51605d; + border-bottom-right-radius: 40px; + border-bottom-left-radius: 40px; + padding: 35px; + @media (max-width: 991px) { + grid-template-columns: auto; + border-radius: 40px; + } `; export default (props) => { @@ -43,7 +57,7 @@ export default (props) => {
-
+
Hello there {

What would you like to do today?

-
+ {/* */} -
+