Skip to content

Commit

Permalink
PR 827 fixes
Browse files Browse the repository at this point in the history
refs #827 TS-1858
  • Loading branch information
Oksamies committed Nov 6, 2023
1 parent 4802b8f commit 5c5c3b2
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 34 deletions.
6 changes: 3 additions & 3 deletions packages/cyberstorm/src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@
font-size: var(--font-size);
}

.ButtonIcon__IconSize__tslogo_install_button {
width: 1.655rem;
height: 1.463rem;
.ButtonIcon__IconSize__big {
width: 1.655em;
height: 1.463em;
}

.ButtonIcon__IconColor__default {
Expand Down
3 changes: 1 addition & 2 deletions packages/cyberstorm/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,4 @@ const getIconAlignment = (scheme: string) => {
}[scheme];
};

const Root = Button;
export { Root };
export { Button as Root };
4 changes: 2 additions & 2 deletions packages/cyberstorm/src/components/Button/ButtonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { classnames } from "../../utils/utils";

export interface ButtonIconProps {
children: JSX.Element | JSX.Element[];
iconSize?: "default" | "tslogo_install_button";
iconSize?: "default" | "big";
iconColor?: "default" | "darker";
iconClasses?: string;
}
Expand Down Expand Up @@ -32,7 +32,7 @@ export function ButtonIcon(props: ButtonIconProps) {
const getIconSize = (scheme: string) => {
return {
default: styles.ButtonIcon__IconSize__default,
tslogo_install_button: styles.ButtonIcon__IconSize__tslogo_install_button,
big: styles.ButtonIcon__IconSize__big,
}[scheme];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
display: flex;
align-items: center;
justify-content: center;
width: 2.38rem;
width: 30%;
aspect-ratio: 1;
transition: 0.2s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ export function FilterItem(props: FilterItemProps) {
style={value !== undefined ? filterColor : {}}
>
<Checkbox.Indicator forceMount>
{value === undefined && <></>}
{value === true && (
{value === undefined ? (
<></>
) : (
<Icon inline>
<FontAwesomeIcon className={styles.icon} icon={faCheck} />
</Icon>
)}
{value === false && (
<Icon inline>
<FontAwesomeIcon className={styles.icon} icon={faXmark} />
<FontAwesomeIcon
className={styles.icon}
icon={value ? faCheck : faXmark}
/>
</Icon>
)}
</Checkbox.Indicator>
Expand Down
1 change: 0 additions & 1 deletion packages/cyberstorm/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
import { Children, cloneElement } from "react";
import styles from "./Icon.module.css";
import { classnames } from "../../utils/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
faCodeBranch,
faFileLines,
faFilePlus,
faArrowUpRight,
} from "@fortawesome/pro-regular-svg-icons";
import { PageHeader } from "../BaseLayout/PageHeader/PageHeader";
import { useDapper } from "@thunderstore/dapper";
Expand Down Expand Up @@ -90,23 +91,29 @@ export function PackageDetailLayout(props: PackageDetailLayoutProps) {
if (packageData.gitHubLink) {
packageDetailsMeta.push(
<a key="github" href={packageData.gitHubLink}>
<Button.Root>
<Button.ButtonLabel>GitHub</Button.ButtonLabel>
<Button.Root plain colorScheme="transparentPrimary" paddingSize="small">
<Button.ButtonIcon>
<FontAwesomeIcon icon={faGithub} />
</Button.ButtonIcon>
<Button.ButtonLabel>GitHub</Button.ButtonLabel>
<Button.ButtonIcon>
<FontAwesomeIcon icon={faArrowUpRight} />
</Button.ButtonIcon>
</Button.Root>
</a>
);
}
if (packageData.discordLink) {
packageDetailsMeta.push(
<a key="discord" href={packageData.discordLink}>
<Button.Root>
<Button.ButtonLabel>Discord</Button.ButtonLabel>
<Button.Root plain colorScheme="transparentPrimary" paddingSize="small">
<Button.ButtonIcon>
<FontAwesomeIcon icon={faDiscord} />
</Button.ButtonIcon>
<Button.ButtonLabel>Discord</Button.ButtonLabel>
<Button.ButtonIcon>
<FontAwesomeIcon icon={faArrowUpRight} />
</Button.ButtonIcon>
</Button.Root>
</a>
);
Expand Down Expand Up @@ -178,7 +185,7 @@ export function PackageDetailLayout(props: PackageDetailLayoutProps) {
/>
<a className={styles.installButton} href="/">
<Button.Root plain paddingSize="huge" colorScheme="fancyAccent">
<Button.ButtonIcon iconSize="tslogo_install_button">
<Button.ButtonIcon iconSize="big">
<ThunderstoreLogo />
</Button.ButtonIcon>
<Button.ButtonLabel fontSize="huge" fontWeight="800">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@

.connectionTypeInfo {
display: flex;
gap: var(--space--16);
gap: var(--space--24);
align-items: center;
justify-content: center;
}

.connectionTypeInfoIcon {
width: 2.5rem;
width: 2.5em;
aspect-ratio: 1;
}

.connectionTypeInfoName {
Expand Down
5 changes: 2 additions & 3 deletions packages/cyberstorm/src/components/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { ReactNode, useRef } from "react";
import styles from "./MenuItem.module.css";
import { classnames } from "../../utils/utils";

export interface MenuItemProps {
interface MenuItemProps {
children?: ReactNode | ReactNode[];
fontSize?: "medium" | "small";
}
Expand Down Expand Up @@ -40,5 +40,4 @@ const getFontSize = (scheme: string) => {

MenuItem.displayName = "MenuItem";

const Root = MenuItem;
export { Root };
export { MenuItem as Root };
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styles from "./MenuItem.module.css";
import { Icon } from "../Icon/Icon";

export interface MenuItemIconProps {
interface MenuItemIconProps {
children: JSX.Element | JSX.Element[];
iconClasses?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactNode } from "react";
import styles from "./MenuItem.module.css";
import { classnames } from "../../utils/utils";

export interface MenuItemLabelProps {
interface MenuItemLabelProps {
children?: ReactNode | ReactNode[];
fontSize?: "medium" | "small";
}
Expand Down
5 changes: 0 additions & 5 deletions packages/cyberstorm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ export {
export { ValidationBar } from "./components/ValidationBar/ValidationBar";
export { Markdown } from "./components/Markdown/Markdown";
export * as MenuItem from "./components/MenuItem/";
export type {
MenuItemProps,
MenuItemIconProps,
MenuItemLabelProps,
} from "./components/MenuItem/";
export { MetaItem, type MetaItemProps } from "./components/MetaItem/MetaItem";
export {
MetaInfoItem,
Expand Down

0 comments on commit 5c5c3b2

Please sign in to comment.