11import { faEllipsis } from '@fortawesome/free-solid-svg-icons'
22import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
33import { ActivityType } from '@klicker-uzh/graphql/dist/ops'
4- import { Dropdown } from '@uzh-bf/design-system'
4+ import { Button , Dropdown } from '@uzh-bf/design-system'
55import { ActivityAction } from '../actions/useAvailableActions'
6- import ActivityActionButton from './ActivityActionButton'
76
87function ActivityActions ( {
98 availableActions,
@@ -17,27 +16,31 @@ function ActivityActions({
1716 activityType : ActivityType
1817} ) {
1918 return (
20- < div className = "flex flex-row items-center gap-2 " >
21- { availableActions . slice ( 0 , 3 ) . map ( ( action ) => {
19+ < div className = "-mr-1 -mt-1 flex flex-row items-end gap-1 " >
20+ { availableActions . slice ( 0 , 1 ) . map ( ( action ) => {
2221 return (
23- < ActivityActionButton
22+ < Button
23+ basic
2424 key = { `activity-${ activityType } -${ activityId } -${ action . id } ` }
25- icon = { action . icon }
26- tooltip = { action . label }
27- onClick = { action . onClick }
2825 disabled = { action . disabled }
26+ onClick = { action . onClick }
27+ className = { {
28+ root : 'text-primary-100 hover:text-primary-100 h-8 text-sm' ,
29+ } }
2930 data = { action . data }
30- className = { action . className }
31- />
31+ >
32+ < Button . Icon icon = { action . icon } />
33+ < Button . Label > { action . label } </ Button . Label >
34+ </ Button >
3235 )
3336 } ) }
3437
35- { availableActions . length > 3 && (
38+ { availableActions . length > 1 && (
3639 < Dropdown
37- items = { availableActions . slice ( 3 ) . map ( ( action ) => ( {
40+ items = { availableActions . slice ( 1 ) . map ( ( action ) => ( {
3841 label : (
3942 < div
40- className = { `flex cursor-pointer items-center rounded px-1.5 py-0.5 hover:bg-gray-100 ${
43+ className = { `flex cursor-pointer items-center rounded px-1.5 py-0.5 ${
4144 action . className ?? ''
4245 } `}
4346 >
@@ -51,16 +54,12 @@ function ActivityActions({
5154 onClick : action . onClick ,
5255 data : action . data ,
5356 } ) ) }
54- trigger = {
55- < ActivityActionButton
56- icon = { faEllipsis }
57- onClick = { ( ) => { } }
58- data = { { cy : `actions-${ activityType } -${ activityName } ` } }
59- />
60- }
57+ trigger = { < FontAwesomeIcon icon = { faEllipsis } /> }
58+ data = { { cy : `actions-${ activityType } -${ activityName } ` } }
6159 className = { {
6260 viewport : 'z-20' , // ensure that dropdown is shown above other elements on course overview
6361 item : 'py-0.5 text-sm' ,
62+ trigger : 'h-8 w-8 border-none text-sm' ,
6463 } }
6564 />
6665 ) }
0 commit comments