Skip to content
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

Refactor TrashIcon ArrowIcon and LoaderIcon #876

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion gui/src/components/ClearDriftCompensationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ClearDriftCompensationButton() {
return (
<BigButton
text={l10n.getString('widget-drift_compensation-clear')}
icon={<TrashIcon width={20} />}
icon={<TrashIcon size={20} />}
onClick={clearDriftCompensation}
>
{}
Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/ClearMountingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function ClearMountingButton() {
return (
<BigButton
text={l10n.getString('widget-clear_mounting')}
icon={<TrashIcon width={20} />}
icon={<TrashIcon size={20} />}
onClick={clearMounting}
disabled={!trackerWithMounting}
/>
Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/commons/icon/ArrowIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function ArrowDownIcon({ size = 24 }: { size?: number }) {
);
}

export function ArrowUpIcon({ size = 24 }: { size: number }) {
export function ArrowUpIcon({ size = 24 }: { size?: number }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
10 changes: 6 additions & 4 deletions gui/src/components/commons/icon/LoaderIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,39 @@ export enum SlimeState {

export function LoaderIcon({
slimeState = SlimeState.HAPPY,
size = 85,
}: {
slimeState: SlimeState;
size?: number | string;
}) {
return (
<>
<img
hidden={slimeState !== SlimeState.JUMPY}
src="/images/jumping-slime.gif"
alt="Slime jumping"
width="85"
width={size}
// className="crisp-edges"
></img>
<img
hidden={slimeState !== SlimeState.HAPPY}
src="/images/happy-slime.gif"
alt="Happy slime"
width="85"
width={size}
// className="crisp-edges"
></img>
<img
hidden={slimeState !== SlimeState.SAD}
src="/images/sad-slime.gif"
alt="Sad slime"
width="85"
width={size}
// className="crisp-edges"
></img>
<img
hidden={slimeState !== SlimeState.CURIOUS}
src="/images/curious-slime.gif"
alt="Slime looking for something"
width="85"
width={size}
// className="crisp-edges"
></img>
</>
Expand Down
6 changes: 3 additions & 3 deletions gui/src/components/commons/icon/TrashIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export function TrashIcon({ width = 33 }: { width: number }) {
export function TrashIcon({ size = 33 }: { size?: number }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width={width}
height="29"
width={size}
height={size}
>
<path
fillRule="evenodd"
Expand Down