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

Commit0fa8717

Browse files
committed
emotion:StarterTemplatesPageView
1 parent69dbe8d commit0fa8717

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

‎site/src/pages/StarterTemplatesPage/StarterTemplatesPageView.tsx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{makeStyles}from"@mui/styles";
1+
import{typeInterpolation,typeTheme}from"@emotion/react";
22
import{ErrorAlert}from"components/Alert/ErrorAlert";
33
import{Loader}from"components/Loader/Loader";
44
import{Margins}from"components/Margins/Margins";
@@ -9,10 +9,9 @@ import {
99
}from"components/PageHeader/PageHeader";
1010
import{Stack}from"components/Stack/Stack";
1111
import{TemplateExampleCard}from"components/TemplateExampleCard/TemplateExampleCard";
12-
import{FC}from"react";
12+
import{typeFC}from"react";
1313
import{Link,useSearchParams}from"react-router-dom";
14-
import{combineClasses}from"utils/combineClasses";
15-
import{StarterTemplatesByTag}from"utils/starterTemplates";
14+
importtype{StarterTemplatesByTag}from"utils/starterTemplates";
1615

1716
constgetTagLabel=(tag:string)=>{
1817
constlabelByTag:Record<string,string>={
@@ -40,7 +39,6 @@ export const StarterTemplatesPageView: FC<StarterTemplatesPageViewProps> = ({
4039
error,
4140
})=>{
4241
const[urlParams]=useSearchParams();
43-
conststyles=useStyles();
4442
consttags=starterTemplatesByTag
4543
?selectTags(starterTemplatesByTag)
4644
:undefined;
@@ -64,24 +62,24 @@ export const StarterTemplatesPageView: FC<StarterTemplatesPageViewProps> = ({
6462

6563
<Stackdirection="row"spacing={4}>
6664
{starterTemplatesByTag&&tags&&(
67-
<StackclassName={styles.filter}>
68-
<spanclassName={styles.filterCaption}>Filter</span>
65+
<Stackcss={styles.filter}>
66+
<spancss={styles.filterCaption}>Filter</span>
6967
{tags.map((tag)=>(
7068
<Link
7169
key={tag}
7270
to={`?tag=${tag}`}
73-
className={combineClasses({
74-
[styles.tagLink]:true,
75-
[styles.tagLinkActive]:tag===activeTag,
76-
})}
71+
css={[
72+
styles.tagLink,
73+
tag===activeTag&&styles.tagLinkActive,
74+
]}
7775
>
7876
{getTagLabel(tag)} ({starterTemplatesByTag[tag].length})
7977
</Link>
8078
))}
8179
</Stack>
8280
)}
8381

84-
<divclassName={styles.templates}>
82+
<divcss={styles.templates}>
8583
{visibleTemplates&&
8684
visibleTemplates.map((example)=>(
8785
<TemplateExampleCardexample={example}key={example.id}/>
@@ -92,21 +90,21 @@ export const StarterTemplatesPageView: FC<StarterTemplatesPageViewProps> = ({
9290
);
9391
};
9492

95-
constuseStyles=makeStyles((theme)=>({
96-
filter:{
93+
conststyles={
94+
filter:(theme)=>({
9795
width:theme.spacing(26),
9896
flexShrink:0,
99-
},
97+
}),
10098

101-
filterCaption:{
99+
filterCaption:(theme)=>({
102100
textTransform:"uppercase",
103101
fontWeight:600,
104102
fontSize:12,
105103
color:theme.palette.text.secondary,
106104
letterSpacing:"0.1em",
107-
},
105+
}),
108106

109-
tagLink:{
107+
tagLink:(theme)=>({
110108
color:theme.palette.text.secondary,
111109
textDecoration:"none",
112110
fontSize:14,
@@ -115,18 +113,18 @@ const useStyles = makeStyles((theme) => ({
115113
"&:hover":{
116114
color:theme.palette.text.primary,
117115
},
118-
},
116+
}),
119117

120-
tagLinkActive:{
118+
tagLinkActive:(theme)=>({
121119
color:theme.palette.text.primary,
122120
fontWeight:600,
123-
},
121+
}),
124122

125-
templates:{
123+
templates:(theme)=>({
126124
flex:"1",
127125
display:"grid",
128126
gridTemplateColumns:"repeat(2, minmax(0, 1fr))",
129127
gap:theme.spacing(2),
130128
gridAutoRows:"min-content",
131-
},
132-
}));
129+
}),
130+
}satisfiesRecord<string,Interpolation<Theme>>;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp