Skip to content

Commit

Permalink
chore: CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
k0stik committed Feb 21, 2024
1 parent 43b9c9d commit 256ff34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 34 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/docker-build-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,28 @@ runs:
with:
key: docker-${{ runner.os }}-${{ hashFiles('package.json') }}

- name: Pull base image
uses: ./actions/docker/ecr
id: login-ecr
# - name: Pull base image
# uses: ./actions/docker/ecr
# id: login-ecr
# with:
# ecr-repository: centos-7.9-base
# aws-access-key-id: ${{ inputs.aws-access-key-id }}
# aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
# image-tag: latest
# action: pull

- name: Build base image
uses: ./actions/docker/build
with:
ecr-repository: centos-7.9-base
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
image-tag: latest
action: pull
image-name: centos-base
dockerfile: ./dockerfiles/centos/Dockerfile

- name: Build container
uses: ./actions/docker/build
with:
image-name: wave-test
dockerfile: ./dockerfiles/app/Dockerfile
# cli-args: --build-arg BASE_IMAGE=${{ steps.login-ecr.outputs.registry }}/centos-7.9-base
cli-args: --build-arg BASE_IMAGE=centos-base

- name: Run tests
shell: bash -l {0}
Expand Down
28 changes: 3 additions & 25 deletions src/components/SquareIconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IconButton, { IconButtonProps } from "@mui/material/IconButton";
import Tooltip, { TooltipProps } from "@mui/material/Tooltip";
import React, { useEffect, useState } from "react";
import React, { useState } from "react";

Check warning on line 3 in src/components/SquareIconButton.tsx

View workflow job for this annotation

GitHub Actions / run-tests

'useState' is defined but never used
import _ from "underscore";

interface SquareIconButtonProps extends IconButtonProps {
Expand All @@ -10,49 +10,27 @@ interface SquareIconButtonProps extends IconButtonProps {
onClick: (...args: React.MouseEvent[]) => void;
tooltipPlacement?: TooltipProps["placement"];
isToggleable?: boolean;
isToggled?: boolean;
}

/**
* Square icon button with toggle logic
*/
function SquareIconButton(props: SquareIconButtonProps) {
const {
title,
id,
label,
onClick,
tooltipPlacement = "top",
isToggleable = true,
isToggled = false,
} = props;
const [stateIsToggled, setStateIsToggled] = useState(isToggled);
const { title, id, label, onClick, tooltipPlacement = "top" } = props;

const defaultIconButtonStyle = {
borderRadius: 0,
};

useEffect(() => {
setStateIsToggled(isToggled);
}, [isToggled]);

const handleToggle = () => {
setStateIsToggled((prevState) => !prevState);
};

return (
<Tooltip id={id} title={title} placement={tooltipPlacement} disableInteractive>
<IconButton
disableFocusRipple
disableTouchRipple
size="large"
key={id}
aria-checked={isToggleable && stateIsToggled}
aria-label={label || title.toLowerCase()}
onClick={(...args) => {
onClick(...args);
handleToggle();
}}
onClick={onClick}
sx={defaultIconButtonStyle}
// eslint-disable-next-line react/jsx-props-no-spreading
{..._.omit(
Expand Down

0 comments on commit 256ff34

Please sign in to comment.