Skip to content

Commit 8201d5e

Browse files
Jing HuangJing Huang
authored andcommitted
Finished to enable add info icon with the Heading
1 parent e7284a6 commit 8201d5e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/components/Table/Table.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Table: React.FC<TableProps> = ({
4545
tableSize = { span: 12, offset: 0 },
4646
renderSubComponent,
4747
getRowCanExpand,
48-
disableGlobalFilter = false, // // Disable the Global Search
48+
disableGlobalFilter = false, // Disable the Global Search
4949
}) => {
5050
const [rowSelection, setRowSelection] = useState({});
5151
const [sorting, setSorting] = useState<SortingState>([]);
@@ -200,6 +200,13 @@ const Table: React.FC<TableProps> = ({
200200
}}
201201
>
202202
{flexRender(header.column.columnDef.header, header.getContext())}
203+
{header.column.columnDef.comment ? (
204+
<img
205+
src="assets/icons/info.png"
206+
alt="Review Grade"
207+
title={header.column.columnDef.comment}
208+
/>
209+
) : null}
203210
{{
204211
asc: " 🔼",
205212
desc: " 🔽",
@@ -255,4 +262,4 @@ const Table: React.FC<TableProps> = ({
255262
);
256263
};
257264

258-
export default Table;
265+
export default Table;

src/pages/StudentTasks/StudentTasks.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ const StudentTasks: React.FC = () => {
115115
),
116116
},
117117
...(showBadges ? [{ accessorKey: "badges", header: "Badges" }] : []),
118-
{ accessorKey: "stageDeadline", header: "Stage Deadline" },
118+
{
119+
accessorKey: "stageDeadline",
120+
header: "Stage Deadline",
121+
comment: "'You can change 'Preferred Time Zone' in 'Profile' in the banner.",
122+
},
119123
{
120124
accessorKey: "publishingRights",
121125
header: "Publishing Rights",
@@ -126,6 +130,7 @@ const StudentTasks: React.FC = () => {
126130
onChange={() => togglePublishingRights(Number(info.row.original.id))}
127131
/>
128132
),
133+
comment: "Grant publishing rights",
129134
},
130135
].map(({ header, ...rest }) => ({
131136
...rest,

0 commit comments

Comments
 (0)