diff --git a/src/components/assignment-panel/assignment-staged-changes/assignment-staged-changes.tsx b/src/components/assignment-panel/assignment-staged-changes/assignment-staged-changes.tsx index 58edf5f..9d859cb 100644 --- a/src/components/assignment-panel/assignment-staged-changes/assignment-staged-changes.tsx +++ b/src/components/assignment-panel/assignment-staged-changes/assignment-staged-changes.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useMemo, useState } from 'react' import { folderIcon, fileIcon } from '@jupyterlab/ui-components' import { assignmentStagedChangesClass, assignmentStagedChangesFolderIconClass, largeBulletClass, modifiedTypeBadgeClass, showMoreBtnClass, stagedChangeListItemClass, stagedChangesListClass } from './style' import { TextDivider } from '../../text-divider' +import { InfoTooltip } from '../../info-tooltip' import { useAssignment } from '../../../contexts' import { IStagedChange } from '../../../api/staged-change' @@ -89,6 +90,12 @@ export const AssignmentStagedChanges = ({ ...props }: AssignmentStagedChangesPro }}>

No Changes +

Files you've changed since your last submission will appear here. diff --git a/src/components/info-tooltip/index.ts b/src/components/info-tooltip/index.ts new file mode 100644 index 0000000..b060faa --- /dev/null +++ b/src/components/info-tooltip/index.ts @@ -0,0 +1,2 @@ +export * from './info-tooltip' +export * from './info-popover' \ No newline at end of file diff --git a/src/components/info-tooltip/info-icon.tsx b/src/components/info-tooltip/info-icon.tsx new file mode 100644 index 0000000..46cee74 --- /dev/null +++ b/src/components/info-tooltip/info-icon.tsx @@ -0,0 +1,23 @@ +import React, { useMemo, Ref } from 'react' +import { InfoCircleFilled, InfoCircleOutlined } from '@ant-design/icons' +import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon' + +export interface InfoIconProps extends AntdIconProps { + filled?: boolean + ref?: Ref +} + +export const InfoIcon = ({ filled=true, style, ...other }: InfoIconProps) => { + const Icon = useMemo(() => filled ? InfoCircleFilled : InfoCircleOutlined, [filled]) + return ( + + ) +} \ No newline at end of file diff --git a/src/components/info-tooltip/info-popover.tsx b/src/components/info-tooltip/info-popover.tsx new file mode 100644 index 0000000..0621e00 --- /dev/null +++ b/src/components/info-tooltip/info-popover.tsx @@ -0,0 +1,25 @@ +import React from 'react' +import { Popover, PopoverProps } from 'antd' +import { InfoCircleFilled } from '@ant-design/icons' +import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon' +import { ReactNode } from 'react' +import { InfoIcon, InfoIconProps } from './info-icon' + +type InfoPopoverProps = PopoverProps & { + iconProps?: InfoIconProps +} + +export const InfoPopover = ({ + iconProps={}, + ...tooltipProps +}: InfoPopoverProps) => { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/components/info-tooltip/info-tooltip.tsx b/src/components/info-tooltip/info-tooltip.tsx new file mode 100644 index 0000000..9c35362 --- /dev/null +++ b/src/components/info-tooltip/info-tooltip.tsx @@ -0,0 +1,25 @@ +import React from 'react' +import { Tooltip, TooltipProps } from 'antd' +import { InfoCircleFilled } from '@ant-design/icons' +import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon' +import { ReactNode } from 'react' +import { InfoIcon, InfoIconProps } from './info-icon' + +type InfoTooltipProps = TooltipProps & { + iconProps?: InfoIconProps +} + +export const InfoTooltip = ({ + iconProps={}, + ...tooltipProps +}: InfoTooltipProps) => { + return ( + + + + ) +} \ No newline at end of file