added continue retro button icon

This commit is contained in:
Nate Sesti 2023-06-22 17:02:50 -07:00
parent 589fd45fb1
commit cfee19c8fa
5 changed files with 32 additions and 4 deletions

View file

@ -1,6 +1,8 @@
import styled, { keyframes } from "styled-components";
import { Button } from ".";
import { Play } from "@styled-icons/heroicons-outline";
import { useSelector } from "react-redux";
import { RootStore } from "../redux/store";
let StyledButton = styled(Button)`
margin: auto;
@ -25,14 +27,21 @@ let StyledButton = styled(Button)`
`;
function ContinueButton(props: { onClick?: () => void; hidden?: boolean }) {
const vscMediaUrl = useSelector(
(state: RootStore) => state.config.vscMediaUrl
);
return (
<StyledButton
hidden={props.hidden}
className="m-auto"
onClick={props.onClick}
>
<Play />
{/* <img src={"/continue_arrow.png"} width="16px"></img> */}
{vscMediaUrl ? (
<img src={`${vscMediaUrl}/play_button.png`} width="22px" />
) : (
<Play />
)}
Continue
</StyledButton>
);

View file

@ -6,6 +6,7 @@ import {
setApiUrl,
setVscMachineId,
setSessionId,
setVscMediaUrl,
} from "../redux/slices/configSlice";
import { setHighlightedCode } from "../redux/slices/miscSlice";
import { updateFileSystem } from "../redux/slices/debugContexSlice";
@ -37,6 +38,7 @@ function DebugPanel(props: DebugPanelProps) {
dispatch(setApiUrl(event.data.apiUrl));
dispatch(setVscMachineId(event.data.vscMachineId));
dispatch(setSessionId(event.data.sessionId));
dispatch(setVscMediaUrl(event.data.vscMediaUrl));
break;
case "highlightedCode":
dispatch(setHighlightedCode(event.data.rangeInFile));

View file

@ -37,9 +37,21 @@ export const configSlice = createSlice({
...state,
sessionId: action.payload,
}),
setVscMediaUrl: (
state: RootStore["config"],
action: { type: string; payload: string }
) => ({
...state,
vscMediaUrl: action.payload,
}),
},
});
export const { setVscMachineId, setApiUrl, setWorkspacePath, setSessionId } =
configSlice.actions;
export const {
setVscMachineId,
setApiUrl,
setWorkspacePath,
setSessionId,
setVscMediaUrl,
} = configSlice.actions;
export default configSlice.reducer;

View file

@ -21,6 +21,7 @@ export interface RootStore {
vscMachineId: string | undefined;
sessionId: string | undefined;
sessionStarted: number | undefined;
vscMediaUrl: string | undefined;
};
chat: {
messages: ChatMessage[];

View file

@ -136,6 +136,9 @@ export function setupDebugPanel(
let extensionUri = getExtensionUri();
let scriptUri: string;
let styleMainUri: string;
let vscMediaUrl: string = debugPanelWebview
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "react-app/dist"))
.toString();
const isProduction = true; // context?.extensionMode === vscode.ExtensionMode.Development;
if (!isProduction) {
@ -226,6 +229,7 @@ export function setupDebugPanel(
vscMachineId: vscode.env.machineId,
apiUrl: getContinueServerUrl(),
sessionId,
vscMediaUrl,
});
// // Listen for changes to server URL in settings