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

refactor(site): Group app and agent actions together#7267

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 4 commits intomainfrombq/refactor-design
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
25 changes: 3 additions & 22 deletionssite/src/components/AppLink/AppLink.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
import Button from "@material-ui/core/Button"
import CircularProgress from "@material-ui/core/CircularProgress"
import Link from "@material-ui/core/Link"
import { makeStyles } from "@material-ui/core/styles"
import Tooltip from "@material-ui/core/Tooltip"
import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"
import { PrimaryAgentButton } from "components/Resources/AgentButton"
import { FC } from "react"
import { combineClasses } from "utils/combineClasses"
import * as TypesGen from "../../api/typesGenerated"
Expand DownExpand Up@@ -83,16 +83,15 @@ export const AppLink: FC<AppLinkProps> = ({
const isPrivateApp = app.sharing_level === "owner"

const button = (
<Button
<PrimaryAgentButton
startIcon={icon}
endIcon={isPrivateApp ? undefined : <ShareIcon app={app} />}
className={styles.button}
disabled={!canClick}
>
<span className={combineClasses({ [styles.appName]: !isPrivateApp })}>
{appDisplayName}
</span>
</Button>
</PrimaryAgentButton>
)

return (
Expand DownExpand Up@@ -132,24 +131,6 @@ const useStyles = makeStyles((theme) => ({
textDecoration: "none !important",
},

button: {
whiteSpace: "nowrap",
backgroundColor: theme.palette.background.default,
padding: theme.spacing(0, 3),
height: 44,
borderRadius: 6,

"&:hover": {
backgroundColor: `${theme.palette.background.paper} !important`,
},

"& .MuiButton-startIcon": {
width: 16,
height: 16,
marginRight: theme.spacing(1.5),
},
},

unhealthyIcon: {
color: theme.palette.warning.light,
},
Expand Down
16 changes: 3 additions & 13 deletionssite/src/components/PortForwardButton/PortForwardButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ import {
import { Maybe } from "components/Conditionals/Maybe"
import { useMachine } from "@xstate/react"
import { portForwardMachine } from "xServices/portForward/portForwardXService"
import { SecondaryAgentButton } from "components/Resources/AgentButton"

export interface PortForwardButtonProps {
host: string
Expand DownExpand Up@@ -147,17 +148,14 @@ export const PortForwardButton: React.FC<PortForwardButtonProps> = (props) => {

return (
<>
<Button
variant="outlined"
className={styles.button}
size="small"
<SecondaryAgentButton
ref={anchorRef}
onClick={() => {
setIsOpen(true)
}}
>
Port forward
</Button>
</SecondaryAgentButton>
<Popover
classes={{ paper: styles.popoverPaper }}
id={id}
Expand DownExpand Up@@ -208,12 +206,4 @@ const useStyles = makeStyles((theme) => ({
form: {
margin: theme.spacing(1.5, 0, 0),
},

button: {
fontSize: 12,
fontWeight: 500,
height: theme.spacing(4),
minHeight: theme.spacing(4),
borderRadius: 4,
},
}))
68 changes: 68 additions & 0 deletionssite/src/components/Resources/AgentButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
import { makeStyles } from "@material-ui/core/styles"
import Button, { ButtonProps } from "@material-ui/core/Button"
import { FC } from "react"
import { combineClasses } from "utils/combineClasses"

export const PrimaryAgentButton: FC<ButtonProps> = ({
className,
...props
}) => {
const styles = useStyles()

return (
<Button
className={combineClasses([styles.primaryButton, className])}
{...props}
/>
)
}

export const SecondaryAgentButton: FC<ButtonProps> = ({
className,
...props
}) => {
const styles = useStyles()

return (
<Button
variant="outlined"
className={combineClasses([styles.secondaryButton, className])}
{...props}
/>
)
}

const useStyles = makeStyles((theme) => ({
primaryButton: {
whiteSpace: "nowrap",
backgroundColor: theme.palette.background.default,
height: 36,
minHeight: 36,
borderRadius: 4,
fontWeight: 500,
fontSize: 14,

"&:hover": {
backgroundColor: `${theme.palette.background.paper} !important`,
},

"& .MuiButton-startIcon": {
width: 12,
height: 12,
marginRight: theme.spacing(1.5),

"& svg": {
width: "100%",
height: "100%",
},
},
},

secondaryButton: {
fontSize: 14,
fontWeight: 500,
height: 36,
minHeight: 36,
borderRadius: 4,
},
}))
8 changes: 8 additions & 0 deletionssite/src/components/Resources/AgentMetadata.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -181,14 +181,22 @@ const useStyles = makeStyles((theme) => ({
padding: theme.spacing(2.5, 4),
borderTop: `1px solid ${theme.palette.divider}`,
background: theme.palette.background.paper,
overflowX: "auto",
scrollPadding: theme.spacing(0, 4),
},

metadata: {
fontSize: 12,
lineHeight: "normal",
display: "flex",
flexDirection: "column",
gap: theme.spacing(0.5),
overflow: "visible",

// Because of scrolling
"&:last-child": {
paddingRight: theme.spacing(4),
},
},

metadataLabel: {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp