Skip to content

Commit c16ea07

Browse files
Merge pull request #590 from Aeledfyr/button-style
chore: rename Button 'styles' prop to 'style' for consistency
2 parents 6e03078 + a32c6cb commit c16ea07

File tree

16 files changed

+28
-28
lines changed

16 files changed

+28
-28
lines changed

src/components/InviteBotPopup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const InviteBotPopup = (props: {
122122
iconName="add"
123123
primary
124124
margin={0}
125-
styles={{ "align-self": "stretch" }}
125+
style={{ "align-self": "stretch" }}
126126
onClick={addBot}
127127
/>
128128
</FlexColumn>

src/components/message-pane/MessagePane.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ const MicButton = (props: { onBlob?: (blob: Blob) => void }) => {
931931
</Show>
932932
<Button
933933
type="hover_border"
934-
styles={{ "touch-action": "none", "user-select": "none" }}
934+
style={{ "touch-action": "none", "user-select": "none" }}
935935
class={classNames(styles.inputButtons, "voice-recorder-button")}
936936
onPointerDown={onMicHold}
937937
onTouchMove={onTouchMove}
@@ -1375,7 +1375,7 @@ function FloatingAttachment(props: {}) {
13751375
padding={6}
13761376
iconSize={18}
13771377
primary
1378-
styles={{ "margin-left": "auto" }}
1378+
style={{ "margin-left": "auto" }}
13791379
iconName="brush"
13801380
/>
13811381
</div>
@@ -2324,14 +2324,14 @@ const GoogleDriveLinkModal = (props: { close: () => void }) => {
23242324
const actionButtons = (
23252325
<FlexRow style={{ width: "100%" }}>
23262326
<Button
2327-
styles={{ flex: 1 }}
2327+
style={{ flex: 1 }}
23282328
iconName="close"
23292329
label={t("messageArea.linkToGoogleDrive.cancelButton")}
23302330
color="var(--alert-color)"
23312331
onClick={props.close}
23322332
/>
23332333
<Button
2334-
styles={{ flex: 1 }}
2334+
style={{ flex: 1 }}
23352335
label={t("messageArea.linkToGoogleDrive.linkButton")}
23362336
iconName="link"
23372337
primary
@@ -2441,7 +2441,7 @@ function BeforeYouChatNotice(props: {
24412441
<Markup inline text={notice()!.content} />
24422442
</div>
24432443
<Button
2444-
styles={{ opacity: buttonClickable() ? 1 : 0.5 }}
2444+
style={{ opacity: buttonClickable() ? 1 : 0.5 }}
24452445
label={t("settings.account.understoodButton")}
24462446
iconName="check"
24472447
onClick={understoodClick}

src/components/message-pane/message-item/AudioEmbed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export const AudioEmbed = (props: {
178178
onClick={onPlayClick}
179179
iconName={statusIcon()}
180180
color="var(--primary-color)"
181-
styles={{ "border-radius": "50%" }}
181+
style={{ "border-radius": "50%" }}
182182
/>
183183
<div class={styles.fileEmbedDetails}>
184184
<div class={styles.fileEmbedName}>{props.file?.name}</div>

src/components/message-pane/message-item/Reactions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function AddNewReactionButton(props: {
142142
margin={0}
143143
padding={6}
144144
class={style.reactionItem}
145-
styles={{ visibility: show() ? "visible" : "hidden" }}
145+
style={{ visibility: show() ? "visible" : "hidden" }}
146146
iconName="add"
147147
iconSize={15}
148148
/>

src/components/moderation-pane/ModerationPane.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ function AuditLogItem(props: { auditLog: AuditLog }) {
13721372
<Button
13731373
padding={4}
13741374
margin={[0, 6, 0, 0]}
1375-
styles={{ "margin-left": "auto", "align-self": "start" }}
1375+
style={{ "margin-left": "auto", "align-self": "start" }}
13761376
iconName="arrow_drop_down"
13771377
onClick={() => setExpanded(!expanded())}
13781378
/>

src/components/servers/settings/ExternalEmbedSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default function ExternalEmbedSettings() {
135135
children={
136136
<Button
137137
label={t("servers.settings.externalEmbed.noInvites.createButton")}
138-
styles={{ "margin-left": "auto" }}
138+
style={{ "margin-left": "auto" }}
139139
margin={0}
140140
primary
141141
onclick={() =>

src/components/servers/settings/ServerVerifySettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function ServerSettingsBans() {
8282
<Button
8383
onClick={verifyClick}
8484
label={t("servers.settings.verify.verifyButton")}
85-
styles={{ "margin-left": "auto" }}
85+
style={{ "margin-left": "auto" }}
8686
margin={0}
8787
color="var(--success-color)"
8888
/>

src/components/settings/AccountSettings.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ function DeleteAccountNoticeModal(props: { close(): void }) {
665665
actionButtons={
666666
<Button
667667
iconName="check"
668-
styles={{ "margin-left": "auto" }}
668+
style={{ "margin-left": "auto" }}
669669
label={t("settings.account.understoodButton")}
670670
onClick={props.close}
671671
/>
@@ -897,13 +897,13 @@ const ConfirmEmailModal = (props: { close(): void; message: string }) => {
897897
<FlexRow style={{ flex: 1 }}>
898898
<Button
899899
onClick={props.close}
900-
styles={{ flex: 1 }}
900+
style={{ flex: 1 }}
901901
iconName="close"
902902
label={t("general.cancelButton")}
903903
color="var(--alert-color)"
904904
/>
905905
<Button
906-
styles={{ flex: 1 }}
906+
style={{ flex: 1 }}
907907
iconName="check"
908908
label={t("general.confirmButton")}
909909
onClick={confirmClicked}
@@ -957,13 +957,13 @@ const ConfirmPasswordModal = (props: {
957957
<FlexRow style={{ flex: 1 }}>
958958
<Button
959959
onClick={props.close}
960-
styles={{ flex: 1 }}
960+
style={{ flex: 1 }}
961961
iconName="close"
962962
label={t("general.cancelButton")}
963963
color="var(--alert-color)"
964964
/>
965965
<Button
966-
styles={{ flex: 1 }}
966+
style={{ flex: 1 }}
967967
iconName="check"
968968
label={t("general.confirmButton")}
969969
onClick={() => props.onConfirm(password())}

src/components/settings/NotificationsSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function NotificationSoundDropDown(props: {
234234
<div style={{ "margin-left": "auto", "flex-shrink": 0 }}>
235235
<Button
236236
onClick={(e) => testSound(e, sound)}
237-
styles={{ "margin-left": "6px", "flex-shrink": 0 }}
237+
style={{ "margin-left": "6px", "flex-shrink": 0 }}
238238
iconName="play_circle"
239239
margin={0}
240240
padding={4}

src/components/ui/Button.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { A } from "solid-navigator";
88

99
export type ButtonProps = Omit<
1010
JSX.ButtonHTMLAttributes<HTMLButtonElement>,
11-
"color" | "type"
11+
"color" | "type" | "style"
1212
> & {
1313
color?: string | null;
1414
label?: string;
@@ -23,7 +23,7 @@ export type ButtonProps = Omit<
2323
href?: string;
2424
target?: string;
2525
rel?: string;
26-
styles?: JSX.CSSProperties;
26+
style?: JSX.CSSProperties;
2727
tabIndex?: string;
2828
hoverText?: string;
2929
iconClass?: string;
@@ -44,7 +44,7 @@ export default function Button(props: ButtonProps) {
4444
"customChildren",
4545
"href",
4646
"customChildrenLeft",
47-
"styles",
47+
"style",
4848
"tabIndex",
4949
"hoverText",
5050
"iconClass",
@@ -70,7 +70,7 @@ export default function Button(props: ButtonProps) {
7070
? props.padding.join("px ") + "px"
7171
: props.padding + "px"
7272
: undefined,
73-
...customProps.styles,
73+
...customProps.style,
7474
});
7575

7676
return (

0 commit comments

Comments
 (0)