mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
refactor: remove onclick on pencil and condense indicator
This commit is contained in:
parent
60373ad002
commit
9c2b147582
1 changed files with 27 additions and 45 deletions
|
|
@ -145,7 +145,6 @@ function ActivityElement(props: ActivitiyElementProps) {
|
||||||
>
|
>
|
||||||
<Save
|
<Save
|
||||||
size={12}
|
size={12}
|
||||||
onClick={() => updateActivityName(props.activity.id)}
|
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -224,53 +223,36 @@ function ActivityElement(props: ActivitiyElementProps) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const ActivityTypeIndicator = (props: { activityType: string }) => {
|
const ACTIVITIES = {
|
||||||
|
'TYPE_VIDEO': {
|
||||||
|
displayName: 'Video',
|
||||||
|
Icon: Video
|
||||||
|
},
|
||||||
|
'TYPE_DOCUMENT': {
|
||||||
|
displayName: 'Document',
|
||||||
|
Icon: File
|
||||||
|
},
|
||||||
|
'TYPE_ASSIGNMENT': {
|
||||||
|
displayName: 'Assignment',
|
||||||
|
Icon: Backpack
|
||||||
|
},
|
||||||
|
'TYPE_DYNAMIC': {
|
||||||
|
displayName: 'Dynamic',
|
||||||
|
Icon: Sparkles
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const ActivityTypeIndicator = ({activityType} : { activityType: keyof typeof ACTIVITIES}) => {
|
||||||
|
const {displayName, Icon} = ACTIVITIES[activityType]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="px-3 text-gray-300 space-x-1 w-28">
|
<div className="px-3 text-gray-300 space-x-1 w-28 flex">
|
||||||
{props.activityType === 'TYPE_VIDEO' && (
|
<div className="flex space-x-2 items-center">
|
||||||
<>
|
<Icon className="size-4" />{' '}
|
||||||
<div className="flex space-x-2 items-center">
|
|
||||||
<Video size={16} />{' '}
|
|
||||||
<div className="text-xs bg-gray-200 text-gray-400 font-bold px-2 py-1 rounded-full mx-auto justify-center align-middle">
|
<div className="text-xs bg-gray-200 text-gray-400 font-bold px-2 py-1 rounded-full mx-auto justify-center align-middle">
|
||||||
Video
|
{displayName}
|
||||||
</div>{' '}
|
</div>{' '}
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{props.activityType === 'TYPE_DOCUMENT' && (
|
|
||||||
<>
|
|
||||||
<div className="flex space-x-2 items-center">
|
|
||||||
<div className="w-[30px]">
|
|
||||||
<File size={16} />{' '}
|
|
||||||
</div>
|
|
||||||
<div className="text-xs bg-gray-200 text-gray-400 font-bold px-2 py-1 rounded-full">
|
|
||||||
Document
|
|
||||||
</div>{' '}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{props.activityType === 'TYPE_ASSIGNMENT' && (
|
|
||||||
<>
|
|
||||||
<div className="flex space-x-2 items-center">
|
|
||||||
<div className="w-[30px]">
|
|
||||||
<Backpack size={16} />{' '}
|
|
||||||
</div>
|
|
||||||
<div className="text-xs bg-gray-200 text-gray-400 font-bold px-2 py-1 rounded-full">
|
|
||||||
Assignment
|
|
||||||
</div>{' '}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{props.activityType === 'TYPE_DYNAMIC' && (
|
|
||||||
<>
|
|
||||||
<div className="flex space-x-2 items-center">
|
|
||||||
<Sparkles size={16} />{' '}
|
|
||||||
<div className="text-xs bg-gray-200 text-gray-400 font-bold px-2 py-1 rounded-full">
|
|
||||||
Dynamic
|
|
||||||
</div>{' '}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -342,7 +324,7 @@ const ActivityElementOptions = ({ activity }: any) => {
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue