Skip to content

Commit

Permalink
Display createdAt column
Browse files Browse the repository at this point in the history
  • Loading branch information
yong-jie committed Jun 3, 2020
1 parent 4ef6bbd commit e2dcabe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/client/actions/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const getUrlsForUser = (): ThunkAction<

if (isOk) {
json.urls.forEach((url: UrlType) => {
url.updatedAt = moment(url.updatedAt) // eslint-disable-line no-param-reassign
url.createdAt = moment(url.createdAt) // eslint-disable-line no-param-reassign
.tz('Singapore')
.format('D MMM YYYY')
// eslint-disable-next-line no-param-reassign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const useStyles = makeStyles((theme) => {
paddingLeft: (props) => props.appMargins,
},
},
updatedAtCell: {
createdAtCell: {
[theme.breakpoints.up('md')]: {
minWidth: '125px',
},
Expand Down Expand Up @@ -130,7 +130,7 @@ const useStyles = makeStyles((theme) => {
longUrl: {
color: '#767676',
},
updatedAt: {
createdAt: {
color: '#767676',
},
clicksIcon: {
Expand Down Expand Up @@ -209,9 +209,9 @@ export default function EnhancedTableBody() {
{row.state.toLowerCase()}
</Typography>
</TableCell>
<TableCell className={classes.updatedAtCell}>
<Typography variant="caption" className={classes.updatedAt}>
{row.updatedAt}
<TableCell className={classes.createdAtCell}>
<Typography variant="caption" className={classes.createdAt}>
{row.createdAt}
</Typography>
</TableCell>
<TableCell className={classes.clicksCell}>
Expand Down
2 changes: 1 addition & 1 deletion src/client/reducers/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const initialState: UserState = {
numberOfRows: 10,
pageNumber: 0,
sortDirection: SortDirection.Descending,
orderBy: 'updatedAt',
orderBy: 'createdAt',
searchText: '',
filter: {},
},
Expand Down
1 change: 1 addition & 0 deletions src/client/reducers/user/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export type UrlType = {
shortUrl: string
longUrl: string
updatedAt: string
createdAt: string
editedLongUrl: string
}

Expand Down

0 comments on commit e2dcabe

Please sign in to comment.