-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic activity log page loading activity log from api
- Loading branch information
1 parent
aaf27e6
commit f106558
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
import { logError } from '@lib/log'; | ||
|
||
import { getActivityLog } from '../../lib/api/activityLogs'; | ||
|
||
export default function ActivityLogPage() { | ||
const [activityLog, setActivityLog] = useState([]); | ||
// const [isLoading, setIsLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
getActivityLog() | ||
.then((response) => { | ||
setActivityLog(response.data); | ||
// setIsLoading(false); | ||
}) | ||
.catch((e) => logError(e)); | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
{activityLog.map(({ id, occurred_on, type }) => ( | ||
<div key={id}> | ||
<div> | ||
{occurred_on} - {type} | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ActivityLogPage from './ActivityLogPage'; | ||
|
||
export default ActivityLogPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters