Skip to content

Commit

Permalink
feat: enrich manage user list data
Browse files Browse the repository at this point in the history
  • Loading branch information
marianzburlea committed Sep 18, 2019
1 parent a61102f commit 1da2500
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/component/manage-user/manage-user.style.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components'

export const StyledUserList = styled.div`
export const StyledUserList = styled.div `
display: grid;
grid-template-columns: auto 1fr 1fr;
grid-template-columns: auto 1fr 1fr 1fr 1fr 1fr;
grid-gap: 0.5rem;
`
`
11 changes: 10 additions & 1 deletion src/component/user-item/user-item.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import React from 'react'
import Avatar from '../avatar'

const UserItem = ({ user }) => {
const { displayName, photoUrl, email, id } = user
const { displayName, photoUrl, email, id, subscription: {
next_billing_at,
plan_id
} = {} } = user

const getNiceDate = time => time ? new Date(next_billing_at * 1000).toDateString() : ''

return (
<>
<Avatar user={user} />
<div>{email}</div>
<div>{plan_id}</div>
<div>{plan_id}</div>
<div>{getNiceDate(next_billing_at)}</div>
<div id={id}><a href={`#${id}`} title={id}>#{id.slice(0, 6)}</a></div>
</>
)
Expand Down

0 comments on commit 1da2500

Please sign in to comment.