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

Commit000bc50

Browse files
refactor: Refactor last built by column (#2968)
1 parent0212933 commit000bc50

File tree

5 files changed

+23
-42
lines changed

5 files changed

+23
-42
lines changed

‎site/src/components/AvatarData/AvatarData.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export const AvatarData: FC<AvatarDataProps> = ({ title, subtitle, link }) => {
1717

1818
return(
1919
<divclassName={styles.root}>
20-
<Avatarvariant="square"className={styles.avatar}>
21-
{firstLetter(title)}
22-
</Avatar>
20+
<AvatarclassName={styles.avatar}>{firstLetter(title)}</Avatar>
2321

2422
{link ?(
2523
<Link
@@ -46,11 +44,7 @@ const useStyles = makeStyles((theme) => ({
4644
alignItems:"center",
4745
},
4846
avatar:{
49-
borderRadius:2,
50-
marginRight:theme.spacing(1),
51-
width:24,
52-
height:24,
53-
fontSize:16,
47+
marginRight:theme.spacing(1.5),
5448
},
5549
info:{
5650
display:"flex",
Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
importAvatarfrom"@material-ui/core/Avatar"
2-
import{makeStyles}from"@material-ui/core/styles"
32
import{FC}from"react"
4-
import{combineClasses}from"../../util/combineClasses"
53
import{firstLetter}from"../../util/firstLetter"
64

75
exportinterfaceUserAvatarProps{
@@ -10,17 +8,5 @@ export interface UserAvatarProps {
108
}
119

1210
exportconstUserAvatar:FC<UserAvatarProps>=({ username, className})=>{
13-
conststyles=useStyles()
14-
return(
15-
<Avatarvariant="square"className={combineClasses([styles.avatar,className])}>
16-
{firstLetter(username)}
17-
</Avatar>
18-
)
11+
return<AvatarclassName={className}>{firstLetter(username)}</Avatar>
1912
}
20-
21-
constuseStyles=makeStyles((theme)=>({
22-
avatar:{
23-
borderRadius:2,
24-
border:`1px solid${theme.palette.divider}`,
25-
},
26-
}))

‎site/src/components/WorkspacesTable/WorkspacesRow.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ export const WorkspacesRow: FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ w
4545
<TableCellLinkto={workspacePageLink}>
4646
<AvatarDatatitle={workspace.name}subtitle={workspace.owner_name}/>
4747
</TableCellLink>
48+
<TableCellLinkto={workspacePageLink}>
49+
<AvatarData
50+
title={initiatedBy.initiatedBy}
51+
subtitle={dayjs().to(dayjs(workspace.latest_build.created_at))}
52+
/>
53+
</TableCellLink>
4854
<TableCellLinkto={workspacePageLink}>{workspace.template_name}</TableCellLink>
4955
<TableCellLinkto={workspacePageLink}>
5056
{workspace.outdated ?(
@@ -60,14 +66,7 @@ export const WorkspacesRow: FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ w
6066
<spanstyle={{color:theme.palette.text.secondary}}>{Language.upToDateLabel}</span>
6167
)}
6268
</TableCellLink>
63-
<TableCellLinkto={workspacePageLink}>
64-
<spandata-chromatic="ignore"style={{color:theme.palette.text.secondary}}>
65-
{dayjs().to(dayjs(workspace.latest_build.created_at))}
66-
</span>
67-
</TableCellLink>
68-
<TableCellLinkto={workspacePageLink}>
69-
<spanstyle={{color:initiatedBy.color}}>{initiatedBy.initiatedBy}</span>
70-
</TableCellLink>
69+
7170
<TableCellLinkto={workspacePageLink}>
7271
<spanstyle={{color:status.color}}>{status.status}</span>
7372
</TableCellLink>
@@ -108,4 +107,8 @@ const useStyles = makeStyles((theme) => ({
108107
alignItems:"center",
109108
gap:theme.spacing(0.5),
110109
},
110+
buildTime:{
111+
color:theme.palette.text.secondary,
112+
fontSize:12,
113+
},
111114
}))

‎site/src/components/WorkspacesTable/WorkspacesTable.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ const Language = {
1111
name:"Name",
1212
template:"Template",
1313
version:"Version",
14-
lastBuilt:"Last Built",
1514
status:"Status",
16-
lastBuiltBy:"By",
15+
lastBuiltBy:"Last BuiltBy",
1716
}
1817

1918
exportinterfaceWorkspacesTableProps{
@@ -27,11 +26,10 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({ isLoading, workspace
2726
<Table>
2827
<TableHead>
2928
<TableRow>
30-
<TableCellwidth="30%">{Language.name}</TableCell>
31-
<TableCellwidth="15%">{Language.template}</TableCell>
32-
<TableCellwidth="10%">{Language.version}</TableCell>
33-
<TableCellwidth="15%">{Language.lastBuilt}</TableCell>
34-
<TableCellwidth="15%">{Language.lastBuiltBy}</TableCell>
29+
<TableCellwidth="25%">{Language.name}</TableCell>
30+
<TableCellwidth="20%">{Language.lastBuiltBy}</TableCell>
31+
<TableCellwidth="20%">{Language.template}</TableCell>
32+
<TableCellwidth="20%">{Language.version}</TableCell>
3533
<TableCellwidth="15%">{Language.status}</TableCell>
3634
<TableCellwidth="1%"></TableCell>
3735
</TableRow>

‎site/src/theme/overrides.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export const getOverrides = (palette: PaletteOptions) => {
66
return{
77
MuiAvatar:{
88
root:{
9-
width:32,
10-
height:32,
11-
fontSize:24,
12-
border:`1px solid${palette.divider}`,
9+
borderColor:palette.divider,
10+
width:36,
11+
height:36,
12+
fontSize:20,
1313
},
1414
},
1515
MuiButton:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp