Skip to content

refactor: Refactor build page #4815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add build avatar better props
  • Loading branch information
BrunoQuaresma committed Oct 31, 2022
commit c78f22c73402e036b481051c511caef62c72a963
15 changes: 9 additions & 6 deletions site/src/components/BuildsTable/BuildAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,27 @@ const StyledBadge = withStyles((theme) => ({
},
}))(Badge)

interface StyledAvatarProps {
size?: number
}

const StyledAvatar = withStyles((theme) => ({
root: {
background: theme.palette.divider,
color: theme.palette.text.primary,
border: `2px solid ${theme.palette.divider}`,
width: ({ size }: { size?: number }) => size,
height: ({ size }: { size?: number }) => size,
width: ({ size }: StyledAvatarProps) => size,
height: ({ size }: StyledAvatarProps) => size,

"& svg": {
width: ({ size }: { size?: number }) => (size ? size / 2 : 18),
height: ({ size }: { size?: number }) => (size ? size / 2 : 18),
width: ({ size }: StyledAvatarProps) => (size ? size / 2 : 18),
height: ({ size }: StyledAvatarProps) => (size ? size / 2 : 18),
},
},
}))(Avatar)

export type BuildAvatarProps = {
export interface BuildAvatarProps extends StyledAvatarProps {
build: WorkspaceBuild
size?: number
}

const iconByTransition: Record<WorkspaceTransition, JSX.Element> = {
Expand Down