Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding the view on unilective on the context menu #1140

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/src/pages/TermPlanner/ContextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
EditFilled,
InfoCircleFilled,
PieChartFilled,
PieChartOutlined
PieChartOutlined,
StarOutlined
} from '@ant-design/icons';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { removeCourse, toggleIgnoreFromProgression, unscheduleCourse } from 'utils/api/plannerApi';
Expand Down Expand Up @@ -58,6 +59,10 @@ const ContextMenu = ({ code, plannedFor, ignoreFromProgression }: Props) => {
ignoreFromProgressionMutation.mutate(code);
};

const handleUnilective = () => {
window.open(`https://unilectives.devsoc.app/course/${code}`, '_blank');
};

const iconStyle = {
fontSize: '14px',
marginRight: '5px'
Expand Down Expand Up @@ -95,6 +100,9 @@ const ContextMenu = ({ code, plannedFor, ignoreFromProgression }: Props) => {
<Item onClick={handleInfo}>
<InfoCircleFilled style={iconStyle} /> View Info
</Item>
<Item onClick={handleUnilective}>
<StarOutlined style={iconStyle} /> View on unilectives
</Item>
</Menu>
<EditMarkModal code={code} open={openModal} onCancel={() => setOpenModal(false)} />
</>
Expand Down
Loading