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

chore: use emotion for styling (pt. 5)#10261

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
aslilac merged 37 commits intomainfromemotional-damage-5
Oct 16, 2023
Merged
Changes from1 commit
Commits
Show all changes
37 commits
Select commitHold shift + click to select a range
8ef2a58
emotion: `RuntimeErrorState`
aslilacOct 13, 2023
c455b38
emotion: `FileUpload`
aslilacOct 13, 2023
4e033c6
🧹
aslilacOct 13, 2023
8d7e9a8
emotion: `FullPageForm`
aslilacOct 13, 2023
eeb1b93
emotion: `EnterpriseSnackbar`
aslilacOct 13, 2023
04adebe
emotion: `GlobalSnackbar`
aslilacOct 13, 2023
2b49f62
emotion: `FullWidthPageHeader`
aslilacOct 13, 2023
57b1f68
emotion: `PageButton`
aslilacOct 13, 2023
715282c
emotion: `PaginationWidgetBase`
aslilacOct 13, 2023
8927e23
emotion: `Paywall`
aslilacOct 13, 2023
1857b71
emotion: `AgentLatency`
aslilacOct 13, 2023
5bacdda
emotion: `AgentOutdatedTooltip`
aslilacOct 13, 2023
9924a32
emotion: `PortForwardButton`
aslilacOct 13, 2023
d49898c
emotion: `Section`
aslilacOct 13, 2023
f4373dd
emotion: `AppLink`
aslilacOct 13, 2023
351e310
🧹
aslilacOct 13, 2023
196c7a8
emotion: `SensitiveValue`
aslilacOct 13, 2023
3d14e1b
emotion: `BuildRow`
aslilacOct 13, 2023
58daeaf
emotion: `ResetPasswordDialog`
aslilacOct 13, 2023
8a5e35f
emotion: `UsersTableBody`
aslilacOct 13, 2023
c8a94a5
emotion: `Workspace`
aslilacOct 13, 2023
7058b7f
emotion: `UpdateBuildParametersDialog`
aslilacOct 13, 2023
0972a1c
emotion: `SignInLayout`
aslilacOct 13, 2023
2481674
emotion: `SSHButton`
aslilacOct 13, 2023
f09e627
emotion: `TableLoader`
aslilacOct 13, 2023
7135de3
emotion: `Welcome`
aslilacOct 13, 2023
193c364
emotion: `TimelineDateRow`
aslilacOct 13, 2023
007e048
emotion: `SSHKeysPageView`
aslilacOct 13, 2023
10f041c
emotion: `WorkspaceSettingsLayout`
aslilacOct 13, 2023
ec8cc6e
emotion: `TemplateLayout`
aslilacOct 13, 2023
da1a641
emotion: `EmptyTemplates`
aslilacOct 13, 2023
69fd068
emotion: `TemplateVariablesPageView`
aslilacOct 13, 2023
fcc868b
Merge branch 'main' into emotional-damage-5
aslilacOct 16, 2023
4b92f61
Revert "emotion: `AgentOutdatedTooltip`"
aslilacOct 16, 2023
c2abccb
Revert "emotion: `PortForwardButton`"
aslilacOct 16, 2023
9f73611
Revert "emotion: `Section`"
aslilacOct 16, 2023
e3986d2
Revert "emotion: `AppLink`"
aslilacOct 16, 2023
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
PrevPrevious commit
NextNext commit
emotion:PortForwardButton
  • Loading branch information
@aslilac
aslilac committedOct 13, 2023
commit9924a3296aa6d9491b74ca3da172d66ceee55d86
52 changes: 16 additions & 36 deletionssite/src/components/Resources/PortForwardButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
import Box from "@mui/material/Box";
import Link from "@mui/material/Link";
import Popover from "@mui/material/Popover";
import { makeStyles } from "@mui/styles";
import CircularProgress from "@mui/material/CircularProgress";
import OpenInNewOutlined from "@mui/icons-material/OpenInNewOutlined";
import { css } from "@emotion/css";
import { useTheme } from "@emotion/react";
import { useRef, useState } from "react";
import { useQuery } from "react-query";
import { colors } from "theme/colors";
import {
HelpTooltipLink,
Expand All@@ -11,16 +16,12 @@ import {
} from "components/HelpTooltip/HelpTooltip";
import { SecondaryAgentButton } from "components/Resources/AgentButton";
import { docs } from "utils/docs";
import Box from "@mui/material/Box";
import { useQuery } from "react-query";
import { getAgentListeningPorts } from "api/api";
import {
importtype{
WorkspaceAgent,
WorkspaceAgentListeningPort,
} from "api/typesGenerated";
import CircularProgress from "@mui/material/CircularProgress";
import { portForwardURL } from "utils/portForward";
import OpenInNewOutlined from "@mui/icons-material/OpenInNewOutlined";

export interface PortForwardButtonProps {
host: string;
Expand All@@ -30,10 +31,10 @@ export interface PortForwardButtonProps {
}

export const PortForwardButton: React.FC<PortForwardButtonProps> = (props) => {
const theme = useTheme();
const anchorRef = useRef<HTMLButtonElement>(null);
const [isOpen, setIsOpen] = useState(false);
const id = isOpen ? "schedule-popover" : undefined;
const styles = useStyles();
const portsQuery = useQuery({
queryKey: ["portForward", props.agent.id],
queryFn: () => getAgentListeningPorts(props.agent.id),
Expand DownExpand Up@@ -78,7 +79,14 @@ export const PortForwardButton: React.FC<PortForwardButtonProps> = (props) => {
)}
</SecondaryAgentButton>
<Popover
classes={{ paper: styles.popoverPaper }}
classes={{
paper: css`
padding: 0;
width: ${theme.spacing(38)};
color: ${theme.palette.text.secondary};
margin-top: ${theme.spacing(0.5)};
`,
}}
id={id}
open={isOpen}
anchorEl={anchorRef.current}
Expand DownExpand Up@@ -245,31 +253,3 @@ export const PortForwardPopoverView: React.FC<
</>
);
};

const useStyles = makeStyles((theme) => ({
popoverPaper: {
padding: 0,
width: theme.spacing(38),
color: theme.palette.text.secondary,
marginTop: theme.spacing(0.5),
},

openUrlButton: {
flexShrink: 0,
},

portField: {
// The default border don't contrast well with the popover
"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline": {
borderColor: colors.gray[10],
},
},

code: {
margin: theme.spacing(2, 0),
},

form: {
margin: theme.spacing(2, 0),
},
}));

[8]ページ先頭

©2009-2025 Movatter.jp