Skip to content

Commit 9c95795

Browse files
committed
Improve mobile display of activity log
1 parent 4d30cc9 commit 9c95795

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@heroicons/react": "^1.0.6",
1010
"@hot-loader/react-dom": "^16.14.0",
1111
"@tailwindcss/forms": "^0.5.2",
12+
"@tailwindcss/line-clamp": "^0.4.0",
1213
"axios": "^0.21.1",
1314
"chart.js": "^2.8.0",
1415
"classnames": "^2.3.1",

resources/scripts/components/dashboard/activity/ActivityLogContainer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default () => {
5151
<div className={'flex justify-end mb-2'}>
5252
<Link
5353
to={'#'}
54-
className={classNames(btnStyles.button, btnStyles.text)}
54+
className={classNames(btnStyles.button, btnStyles.text, 'w-full sm:w-auto')}
5555
onClick={() => setFilters(value => ({ ...value, filters: {} }))}
5656
>
5757
Clear Filters <XCircleIcon className={'w-4 h-4 ml-2'}/>
@@ -67,7 +67,7 @@ export default () => {
6767
key={`${activity.event}|${activity.timestamp.toString()}`}
6868
className={'grid grid-cols-10 py-4 border-b-2 border-gray-800 last:rounded-b last:border-0'}
6969
>
70-
<div className={'col-span-1 flex items-center justify-center select-none'}>
70+
<div className={'col-span-2 sm:col-span-1 flex items-center justify-center select-none'}>
7171
<div className={'flex items-center w-8 h-8 rounded-full bg-gray-600 overflow-hidden'}>
7272
{activity.relationships.actor ?
7373
<img src={activity.relationships.actor.image} alt={'User avatar'}/>
@@ -76,13 +76,13 @@ export default () => {
7676
}
7777
</div>
7878
</div>
79-
<div className={'col-span-9'}>
79+
<div className={'col-span-8 sm:col-span-9'}>
8080
<div className={'flex items-center text-gray-50'}>
8181
{activity.relationships.actor?.username || 'system'}
8282
<span className={'text-gray-400'}>&nbsp;&mdash;&nbsp;</span>
8383
<Link
8484
to={`?${queryTo({ event: activity.event })}`}
85-
className={'transition-colors duration-75 hover:text-cyan-400'}
85+
className={'transition-colors duration-75 active:text-cyan-400 hover:text-cyan-400'}
8686
>
8787
{activity.event}
8888
</Link>
@@ -92,15 +92,15 @@ export default () => {
9292
</Tooltip>
9393
}
9494
</div>
95-
<p className={'mt-1 text-sm'}>
95+
<p className={'mt-1 text-sm break-words line-clamp-2 pr-4'}>
9696
<Translate ns={'activity'} values={activity.properties}>
9797
{activity.event.replace(':', '.')}
9898
</Translate>
9999
</p>
100100
<div className={'mt-1 flex items-center text-sm'}>
101101
<Link
102102
to={`?${queryTo({ ip: activity.ip })}`}
103-
className={'transition-colors duration-75 hover:text-cyan-400'}
103+
className={'transition-colors duration-75 active:text-cyan-400 hover:text-cyan-400'}
104104
>
105105
{activity.ip}
106106
</Link>

resources/scripts/components/elements/tooltip/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default ({ content, children, disabled = false, ...props }: Props) => {
7373
transition={{ type: 'easeIn', damping: 20, stiffness: 300, duration: 0.1 }}
7474
{...getFloatingProps({
7575
ref: floating,
76-
className: 'absolute top-0 left-0 bg-gray-900 text-sm text-gray-200 px-3 py-2 rounded pointer-events-none',
76+
className: 'absolute top-0 left-0 bg-gray-900 text-sm text-gray-200 px-3 py-2 rounded pointer-events-none max-w-[90vw]',
7777
style: {
7878
position: strategy,
7979
top: `${y || 0}px`,

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = {
4343
},
4444
},
4545
plugins: [
46+
require('@tailwindcss/line-clamp'),
4647
require('@tailwindcss/forms')({
4748
strategy: 'class',
4849
}),

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,11 @@
14121412
dependencies:
14131413
mini-svg-data-uri "^1.2.3"
14141414

1415+
"@tailwindcss/line-clamp@^0.4.0":
1416+
version "0.4.0"
1417+
resolved "https://registry.yarnpkg.com/@tailwindcss/line-clamp/-/line-clamp-0.4.0.tgz#03353e31e77636b785f2336e8c978502cec1de81"
1418+
integrity sha512-HQZo6gfx1D0+DU3nWlNLD5iA6Ef4JAXh0LeD8lOGrJwEDBwwJNKQza6WoXhhY1uQrxOuU8ROxV7CqiQV4CoiLw==
1419+
14151420
"@types/chart.js@^2.8.5":
14161421
version "2.8.5"
14171422
resolved "https://registry.yarnpkg.com/@types/chart.js/-/chart.js-2.8.5.tgz#7d47cfd36f0a1c2c4ad6a585749bc68e8659492a"

0 commit comments

Comments
 (0)