Skip to content

Commit

Permalink
updating activity log pages
Browse files Browse the repository at this point in the history
  • Loading branch information
naterfute committed Nov 23, 2024
1 parent 6dbb6db commit 46c9374
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';

import FlashMessageRender from '@/components/FlashMessageRender';
import ContentBox from '@/components/elements/ContentBox';
import PageContentBlock from '@/components/elements/PageContentBlock';
// FIXME: add icons back
import Spinner from '@/components/elements/Spinner';
Expand Down Expand Up @@ -34,35 +35,37 @@ export default () => {

return (
<PageContentBlock title={'Account Activity Log'}>
<FlashMessageRender byKey={'account'} />
{(filters.filters?.event || filters.filters?.ip) && (
<div className={'flex justify-end mb-2'}>
<Link
to={'#'}
className={clsx(btnStyles.button, btnStyles.text, 'w-full sm:w-auto')}
onClick={() => setFilters((value) => ({ ...value, filters: {} }))}
>
Clear Filters
</Link>
</div>
)}
{!data && isValidating ? (
<Spinner centered />
) : (
<div className={'bg-zinc-700'}>
{data?.items.map((activity) => (
<ActivityLogEntry key={activity.id} activity={activity}>
{typeof activity.properties.useragent === 'string' && <span></span>}
</ActivityLogEntry>
))}
</div>
)}
{data && (
<PaginationFooter
pagination={data.pagination}
onPageSelect={(page) => setFilters((value) => ({ ...value, page }))}
/>
)}
<ContentBox title='Account Activity Log'>
<FlashMessageRender byKey={'account'} />
{(filters.filters?.event || filters.filters?.ip) && (
<div className={'flex justify-end mb-2'}>
<Link
to={'#'}
className={clsx(btnStyles.button, btnStyles.text, 'w-full sm:w-auto')}
onClick={() => setFilters((value) => ({ ...value, filters: {} }))}
>
Clear Filters
</Link>
</div>
)}
{!data && isValidating ? (
<Spinner centered />
) : (
<div>
{data?.items.map((activity) => (
<ActivityLogEntry key={activity.id} activity={activity}>
{typeof activity.properties.useragent === 'string' && <span></span>}
</ActivityLogEntry>
))}
</div>
)}
{data && (
<PaginationFooter
pagination={data.pagination}
onPageSelect={(page) => setFilters((value) => ({ ...value, page }))}
/>
)}
</ContentBox>
</PageContentBlock>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default ({ activity, children }: Props) => {
<div className={'grid grid-cols-10 py-4 border-b-2 border-zinc-800 last:rounded-b last:border-0 group'}>
<div className={'hidden sm:flex sm:col-span-1 items-center justify-center select-none'}>
<div className={'flex items-center w-10 h-10 rounded-full bg-zinc-600 overflow-hidden'}>
{/* <Avatar name={actor?.uuid || 'system'} /> */}
<img src={actor?.image} />
</div>
</div>
<div className={'col-span-10 sm:col-span-9 flex'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default ({ meta }: { meta: Record<string, unknown> }) => {
}
onClick={() => setOpen(true)}
>
<MetaDataIcon className={'w-5 h-5'} />
<MetaDataIcon fill='currentColor' className={'w-5 h-5'} />
</button>
</div>
);
Expand Down

0 comments on commit 46c9374

Please sign in to comment.