Skip to content

refactor: Remove avatar from workspace name #3006

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 15, 2022
Merged
Show file tree
Hide file tree
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
Add PR suggestions
  • Loading branch information
BrunoQuaresma committed Jul 15, 2022
commit 6aa15e268baf75f65194ff0596ff23c08702b8a8
7 changes: 7 additions & 0 deletions site/src/components/AvatarData/AvatarData.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Example.args = {
subtitle: "coder@coder.com",
}

export const WithHighlightTitle = Template.bind({})
WithHighlightTitle.args = {
title: "coder",
subtitle: "coder@coder.com",
highlightTitle: true,
}

export const WithLink = Template.bind({})
WithLink.args = {
title: "coder",
Expand Down
8 changes: 6 additions & 2 deletions site/src/components/TableCellData/TableCellData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { makeStyles } from "@material-ui/core/styles"
import React from "react"
import { Stack } from "../Stack/Stack"

interface StyleProps {
highlight?: boolean
}

export const TableCellData: React.FC = ({ children }) => {
return <Stack spacing={0}>{children}</Stack>
}
Expand All @@ -23,9 +27,9 @@ export const TableCellDataSecondary: React.FC = ({ children }) => {

const useStyles = makeStyles((theme) => ({
Copy link
Member

@Kira-Pilot Kira-Pilot Jul 15, 2022

Choose a reason for hiding this comment

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

If you want, you can type this whole style hook so that you don't have to redeclare the type every time you use the highlight prop below:

import { Theme } from "@material-ui/core/styles/createMuiTheme"

interface StyleProps {
  highlight?: boolean
}

const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
....

primary: {
color: ({ highlight }: { highlight?: boolean }) =>
color: ({ highlight }: StyleProps) =>
highlight ? theme.palette.text.primary : theme.palette.text.secondary,
fontWeight: ({ highlight }: { highlight?: boolean }) => (highlight ? 600 : undefined),
fontWeight: ({ highlight }: StyleProps) => (highlight ? 600 : undefined),
},

secondary: {
Expand Down