Skip to content

Commit

Permalink
Add .idea folder to .gitignore
Browse files Browse the repository at this point in the history
Make Button startIcon and endIcon ssr compatible
  • Loading branch information
BierDav authored and juanrgm committed Mar 5, 2024
1 parent 96534e8 commit db004ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dist
lib
node_modules
temp
vite.config.js.timestamp*
vite.config.js.timestamp*
.idea
4 changes: 2 additions & 2 deletions packages/material/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ const Button = $.component(function Button({
<Show when={props.startIcon}>
{(startIcon) => (
<ButtonStartIcon class={classes.startIcon} ownerState={allProps}>
{startIcon()}
{startIcon()()}
</ButtonStartIcon>
)}
</Show>
{props.children}
<Show when={props.endIcon}>
{(endIcon) => (
<ButtonEndIcon class={classes.endIcon} ownerState={allProps}>
{endIcon()}
{endIcon()()}
</ButtonEndIcon>
)}
</Show>
Expand Down
9 changes: 5 additions & 4 deletions packages/material/src/Button/ButtonProps.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { ButtonBaseTypeMap, ExtendButtonBaseTypeMap } from "../ButtonBase";
import { OverrideProps, OverridableComponent } from "../OverridableComponent";
import { Theme } from "../styles";
import { ButtonClasses } from "./buttonClasses";
import SxProps from "@suid/system/sxProps";
import {
DistributiveOmit,
ElementType,
OverridableComponent,
OverridableStringUnion,
OverridableTypeMap,
OverrideProps,
} from "@suid/types";
import { JSX, JSXElement } from "solid-js";

Expand Down Expand Up @@ -61,14 +62,14 @@ export type ButtonTypeMap<P = {}, D extends ElementType = "button"> = {
*/
disableElevation?: boolean;
/**
* If `true`, the keyboard focus ripple is disabled.
* If `true`, the keyboard focus ripple is disabled.
* @default false
*/
disableFocusRipple?: boolean;
/**
* Element placed after the children.
*/
endIcon?: JSXElement;
endIcon?: () => JSXElement;
/**
* If `true`, the button will take up the full width of its container.
* @default false
Expand All @@ -91,7 +92,7 @@ export type ButtonTypeMap<P = {}, D extends ElementType = "button"> = {
/**
* Element placed before the children.
*/
startIcon?: JSXElement;
startIcon?: () => JSXElement;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down

0 comments on commit db004ad

Please sign in to comment.