Skip to content
This repository has been archived by the owner on Oct 29, 2018. It is now read-only.

Commit

Permalink
Dummy daily Summary Component
Browse files Browse the repository at this point in the history
  • Loading branch information
notdrone committed Apr 13, 2018
1 parent 037e903 commit ac8e2a5
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const Card = styled.div`
padding-bottom: 1rem;
border: 1px solid ${fog};
border-radius: 0.5rem;
max-width: 88em;
&:hover {
box-shadow: 0 2px 4px hsla(0, 0%, 0%, 0.1);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Sidebar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NavBar extends Component {
const Container = styled.div`
background: ${primary};
display: flex;
user-select: none;
`

const active = 'active'
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/date-range-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const getMinMaxDateRange = (
return undefined
}

export const getDateToday = () => moment().format('YYYY-MM-DD')

const getDailyRange = (numbers: number[]) =>
numbers.map((n: number) => {
const date = moment()
Expand Down
34 changes: 34 additions & 0 deletions src/screens/Dashboard/DailySummary/DailySummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import * as React from 'react'
import styled from 'styled-components'
import Card from '../../../components/Card'
import CardTitle from '../../../components/CardTitle'
interface IProps {
customerStats?: any
}
const DailySummary: React.SFC<IProps> = props => (
<Container>
<Card style={{ padding: '1rem' }}>
<CardTitle>Dummy Daily Summary [Please Ignore]</CardTitle>
<p>Customers</p>
<p>Verified: 10/14</p>
<hr />
<p>Mandates:</p>
<p>initiated: 3</p>
<p>success: 4</p>
<p>fail: 1</p>
<hr />
<p>Total Beneficiaries added: 18</p>
<hr />
<p>Transactions</p>
<p>initiated: 3 (rs10000)</p>
<p>success: 4 (rs)</p>
<p>fail: 1</p>
</Card>
</Container>
)

const Container = styled.div`
max-width: 40rem;
margin: 0 auto;
`
export default DailySummary
Empty file.
24 changes: 2 additions & 22 deletions src/screens/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
import { Component, default as React } from 'react'
import { customerStats } from '../../api/statistics-api'
import { rangeEnum } from '../../helpers/date-range-helper'
import DailySummary from './DailySummary/DailySummary'

class Dashboard extends Component {
public state = {
hi: 'bye',
}

public componentDidMount() {
customerStats(rangeEnum.days)
customerStats(rangeEnum.weeks)
customerStats(rangeEnum.months)
}

public render() {
return (
<div>
<p>D</p>
<p>A</p>
<p>S</p>
<p>H</p>
<p>B</p>
<p>o</p>
<p>R</p>
<p>D</p>
<p>.</p>
<p>{this.state.hi}</p>
<DailySummary />
</div>
)
}
Expand Down
19 changes: 10 additions & 9 deletions src/screens/Transactions/AmountCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ interface IProps {
style?: any
}

const
AmountCell: React.SFC<IProps> = props => (
const AmountCell: React.SFC<IProps> = props => (
<Container style={props.style}>
{props.amount.toLocaleString('en-EN', {
currency: 'INR',
maximumFractionDigits: 0,
minimumFractionDigits: 0,
style: 'currency',
})}
<p style={{ fontSize: '0.5rem', paddingBottom: '0.5rem' }}></p>
<p>
{props.amount.toLocaleString('en-EN', {
maximumFractionDigits: 0,
minimumFractionDigits: 0,
})}
</p>
</Container>
)

const Container = styled.p`
const Container = styled.div`
display: flex;
font-size: 1.1rem;
`

Expand Down

0 comments on commit ac8e2a5

Please sign in to comment.