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

Commit82056b9

Browse files
committed
emotion:TemplatesPageView
1 parent21055ee commit82056b9

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import{typeInterpolation,typeTheme}from"@emotion/react";
12
importButtonfrom"@mui/material/Button";
2-
import{makeStyles}from"@mui/styles";
33
importTablefrom"@mui/material/Table";
44
importTableBodyfrom"@mui/material/TableBody";
55
importTableCellfrom"@mui/material/TableCell";
66
importTableContainerfrom"@mui/material/TableContainer";
77
importTableHeadfrom"@mui/material/TableHead";
88
importTableRowfrom"@mui/material/TableRow";
99
importAddIconfrom"@mui/icons-material/AddOutlined";
10-
import{FC}from"react";
10+
import{typeFC}from"react";
1111
import{useNavigate,LinkasRouterLink}from"react-router-dom";
1212
import{createDayString}from"utils/createDayString";
1313
import{
@@ -35,7 +35,7 @@ import {
3535
}from"components/HelpTooltip/HelpTooltip";
3636
import{EmptyTemplates}from"./EmptyTemplates";
3737
import{useClickableTableRow}from"hooks/useClickableTableRow";
38-
import{Template,TemplateExample}from"api/typesGenerated";
38+
importtype{Template,TemplateExample}from"api/typesGenerated";
3939
import{combineClasses}from"utils/combineClasses";
4040
import{colors}from"theme/colors";
4141
importArrowForwardOutlinedfrom"@mui/icons-material/ArrowForwardOutlined";
@@ -80,17 +80,17 @@ const TemplateRow: FC<{ template: Template }> = ({ template }) => {
8080
consttemplatePageLink=`/templates/${template.name}`;
8181
consthasIcon=template.icon&&template.icon!=="";
8282
constnavigate=useNavigate();
83-
conststyles=useStyles();
8483

85-
const{className:clickableClassName, ...clickableRow}=
86-
useClickableTableRow({onClick:()=>navigate(templatePageLink)});
84+
const{css:clickableCss, ...clickableRow}=useClickableTableRow({
85+
onClick:()=>navigate(templatePageLink),
86+
});
8787

8888
return(
8989
<TableRow
9090
key={template.id}
9191
data-testid={`template-${template.id}`}
9292
{...clickableRow}
93-
className={combineClasses([clickableClassName,styles.tableRow])}
93+
css={[clickableCss,styles.tableRow]}
9494
>
9595
<TableCell>
9696
<AvatarData
@@ -106,22 +106,23 @@ const TemplateRow: FC<{ template: Template }> = ({ template }) => {
106106
/>
107107
</TableCell>
108108

109-
<TableCellclassName={styles.secondary}>
109+
<TableCellcss={styles.secondary}>
110110
{Language.developerCount(template.active_user_count)}
111111
</TableCell>
112112

113-
<TableCellclassName={styles.secondary}>
113+
<TableCellcss={styles.secondary}>
114114
{formatTemplateBuildTime(template.build_time_stats.start.P50)}
115115
</TableCell>
116116

117-
<TableCelldata-chromatic="ignore"className={styles.secondary}>
117+
<TableCelldata-chromatic="ignore"css={styles.secondary}>
118118
{createDayString(template.updated_at)}
119119
</TableCell>
120120

121-
<TableCellclassName={styles.actionCell}>
121+
<TableCellcss={styles.actionCell}>
122122
<Button
123123
size="small"
124-
className={styles.actionButton}
124+
css={styles.actionButton}
125+
className="actionButton"
125126
startIcon={<ArrowForwardOutlined/>}
126127
title={`Create a workspace using the${template.display_name} template`}
127128
onClick={(e)=>{
@@ -247,7 +248,7 @@ const TableLoader = () => {
247248
);
248249
};
249250

250-
constuseStyles=makeStyles((theme)=>({
251+
conststyles={
251252
templateIconWrapper:{
252253
// Same size then the avatar component
253254
width:36,
@@ -261,20 +262,20 @@ const useStyles = makeStyles((theme) => ({
261262
actionCell:{
262263
whiteSpace:"nowrap",
263264
},
264-
secondary:{
265+
secondary:(theme)=>({
265266
color:theme.palette.text.secondary,
266-
},
267-
tableRow:{
268-
"&:hover$actionButton":{
267+
}),
268+
tableRow:(theme)=>({
269+
"&:hover.actionButton":{
269270
color:theme.palette.text.primary,
270271
borderColor:colors.gray[11],
271272
"&:hover":{
272273
borderColor:theme.palette.text.primary,
273274
},
274275
},
275-
},
276-
actionButton:{
276+
}),
277+
actionButton:(theme)=>({
277278
color:theme.palette.text.secondary,
278279
transition:"none",
279-
},
280-
}));
280+
}),
281+
}satisfiesRecord<string,Interpolation<Theme>>;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp