Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35a04c7

Browse files
refactor: use the new Table component for the Templates table (#17838)
<img width="1624" alt="Screenshot 2025-05-14 at 15 11 56"src="https://github.com/user-attachments/assets/01fd5fe2-35d4-4fae-a668-68af2b9f9bd6"/>
1 parent73251cf commit35a04c7

File tree

1 file changed

+41
-39
lines changed

1 file changed

+41
-39
lines changed

‎site/src/pages/TemplatesPage/TemplatesPageView.tsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ import type { Interpolation, Theme } from "@emotion/react";
22
importArrowForwardOutlinedfrom"@mui/icons-material/ArrowForwardOutlined";
33
importMuiButtonfrom"@mui/material/Button";
44
importSkeletonfrom"@mui/material/Skeleton";
5-
importTablefrom"@mui/material/Table";
6-
importTableBodyfrom"@mui/material/TableBody";
7-
importTableCellfrom"@mui/material/TableCell";
8-
importTableContainerfrom"@mui/material/TableContainer";
9-
importTableHeadfrom"@mui/material/TableHead";
10-
importTableRowfrom"@mui/material/TableRow";
115
import{hasError,isApiValidationError}from"api/errors";
126
importtype{Template,TemplateExample}from"api/typesGenerated";
137
import{ErrorAlert}from"components/Alert/ErrorAlert";
@@ -33,6 +27,14 @@ import {
3327
PageHeaderTitle,
3428
}from"components/PageHeader/PageHeader";
3529
import{Stack}from"components/Stack/Stack";
30+
import{
31+
Table,
32+
TableBody,
33+
TableCell,
34+
TableHead,
35+
TableHeader,
36+
TableRow,
37+
}from"components/Table/Table";
3638
import{
3739
TableLoaderSkeleton,
3840
TableRowSkeleton,
@@ -231,41 +233,41 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = ({
231233
<ErrorAlerterror={error}/>
232234
)}
233235

234-
<TableContainer>
235-
<Table>
236-
<TableHead>
237-
<TableRow>
238-
<TableCellwidth="35%">{Language.nameLabel}</TableCell>
239-
<TableCellwidth="15%">
240-
{showOrganizations ?"Organization" :Language.usedByLabel}
241-
</TableCell>
242-
<TableCellwidth="10%">{Language.buildTimeLabel}</TableCell>
243-
<TableCellwidth="15%">{Language.lastUpdatedLabel}</TableCell>
244-
<TableCellwidth="1%"/>
245-
</TableRow>
246-
</TableHead>
247-
<TableBody>
248-
{isLoading&&<TableLoader/>}
236+
<Table>
237+
<TableHeader>
238+
<TableRow>
239+
<TableHeadclassName="w-[35%]">{Language.nameLabel}</TableHead>
240+
<TableHeadclassName="w-[15%]">
241+
{showOrganizations ?"Organization" :Language.usedByLabel}
242+
</TableHead>
243+
<TableHeadclassName="w-[10%]">{Language.buildTimeLabel}</TableHead>
244+
<TableHeadclassName="w-[15%]">
245+
{Language.lastUpdatedLabel}
246+
</TableHead>
247+
<TableHeadclassName="w-[1%]"/>
248+
</TableRow>
249+
</TableHeader>
250+
<TableBody>
251+
{isLoading&&<TableLoader/>}
249252

250-
{isEmpty ?(
251-
<EmptyTemplates
252-
canCreateTemplates={canCreateTemplates}
253-
examples={examples??[]}
254-
isUsingFilter={filter.used}
253+
{isEmpty ?(
254+
<EmptyTemplates
255+
canCreateTemplates={canCreateTemplates}
256+
examples={examples??[]}
257+
isUsingFilter={filter.used}
258+
/>
259+
) :(
260+
templates?.map((template)=>(
261+
<TemplateRow
262+
key={template.id}
263+
showOrganizations={showOrganizations}
264+
template={template}
265+
workspacePermissions={workspacePermissions}
255266
/>
256-
) :(
257-
templates?.map((template)=>(
258-
<TemplateRow
259-
key={template.id}
260-
showOrganizations={showOrganizations}
261-
template={template}
262-
workspacePermissions={workspacePermissions}
263-
/>
264-
))
265-
)}
266-
</TableBody>
267-
</Table>
268-
</TableContainer>
267+
))
268+
)}
269+
</TableBody>
270+
</Table>
269271
</Margins>
270272
);
271273
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp