Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Statuses breaking line in the UI #3071

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 2 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion site/src/components/AppLink/AppLink.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WithIcon.args = {
userName: "developer",
workspaceName: MockWorkspace.name,
appName: "code-server",
appIcon: "/code.svg",
appIcon: "/icon/code.svg",
}

export const WithoutIcon = Template.bind({})
Expand Down
5 changes: 5 additions & 0 deletions site/src/components/AppLink/AppLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const AppLink: FC<AppLinkProps> = ({ userName, workspaceName, appName, ap
<Button
size="small"
startIcon={appIcon ? <img alt={`${appName} Icon`} src={appIcon} /> : <ComputerIcon />}
className={styles.button}
>
{appName}
</Button>
Expand All @@ -49,4 +50,8 @@ const useStyles = makeStyles(() => ({
link: {
textDecoration: "none !important",
},

button: {
whiteSpace: "nowrap",
},
}))
7 changes: 6 additions & 1 deletion site/src/components/BuildsTable/BuildsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export const BuildsTable: FC<BuildsTableProps> = ({ builds, className }) => {
</span>
</TableCellLink>
<TableCellLink to={buildPageLink}>
<span style={{ color: status.color }}>{status.status}</span>
<span style={{ color: status.color }} className={styles.status}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this has a class, we can move the inline style into that class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is inline because it is dynamic and passed from the props.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can still pass it i think, but nbd if you want to leave it inline!

{status.status}
</span>
</TableCellLink>
<TableCellLink to={buildPageLink}>
<div className={styles.arrowCell}>
Expand Down Expand Up @@ -126,4 +128,7 @@ const useStyles = makeStyles((theme) => ({
arrowCell: {
display: "flex",
},
status: {
whiteSpace: "nowrap",
},
}))
8 changes: 7 additions & 1 deletion site/src/components/Resources/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export const Resources: FC<ResourcesProps> = ({
{agent.name}
<div className={styles.agentInfo}>
<span className={styles.operatingSystem}>{agent.operating_system}</span>
<span style={{ color: agentStatus.color }}>{agentStatus.status}</span>
<span style={{ color: agentStatus.color }} className={styles.status}>
{agentStatus.status}
</span>
</div>
</TableCell>
<TableCell>
Expand Down Expand Up @@ -182,4 +184,8 @@ const useStyles = makeStyles((theme) => ({
flexWrap: "wrap",
justifyContent: "flex-end",
},

status: {
whiteSpace: "nowrap",
},
}))