Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: replace MUI Button - 3#17955

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 3 commits intomainfrombq/replace-mui-button-3-main
May 21, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
6 changes: 4 additions & 2 deletionssite/src/components/Filter/Filter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import Divider from "@mui/material/Divider";
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
Expand All@@ -10,6 +9,7 @@ import {
hasError,
isApiValidationError,
} from "api/errors";
import { Button } from "components/Button/Button";
import { InputGroup } from "components/InputGroup/InputGroup";
import { SearchField } from "components/SearchField/SearchField";
import { useDebouncedFunction } from "hooks/debounce";
Expand DownExpand Up@@ -267,9 +267,11 @@ const PresetMenu: FC<PresetMenuProps> = ({
<Button
onClick={() => setIsOpen(true)}
ref={anchorRef}
endIcon={<ChevronDownIcon className="size-4" />}
variant="outline"
className="h-9"
>
Filters
<ChevronDownIcon />
</Button>
<Menu
id="filter-menu"
Expand Down
12 changes: 4 additions & 8 deletionssite/src/pages/ChatPage/ChatLayout.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import ListItemButton from "@mui/material/ListItemButton";
Expand All@@ -9,6 +8,7 @@ import { createChat, getChats } from "api/queries/chats";
import { deploymentLanguageModels } from "api/queries/deployment";
import type { LanguageModelConfig } from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Button } from "components/Button/Button";
import { Loader } from "components/Loader/Loader";
import { Margins } from "components/Margins/Margins";
import { useAgenticChat } from "contexts/useAgenticChat";
Expand DownExpand Up@@ -167,16 +167,12 @@ export const ChatLayout: FC = () => {
Chats
</div>
<Button
variant="outlined"
size="small"
startIcon={<PlusIcon className="size-icon-sm" />}
variant="outline"
size="sm"
onClick={handleNewChat}
disabled={createChatMutation.isLoading}
css={{
lineHeight: 1.5,
padding: theme.spacing(0.5, 1.5),
}}
>
<PlusIcon />
New Chat
</Button>
</div>
Expand Down
27 changes: 11 additions & 16 deletionssite/src/pages/StarterTemplatePage/StarterTemplatePageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import type { TemplateExample } from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Button } from "components/Button/Button";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
import { Loader } from "components/Loader/Loader";
import { Margins } from "components/Margins/Margins";
Expand DownExpand Up@@ -44,22 +44,17 @@ export const StarterTemplatePageView: FC<StarterTemplatePageViewProps> = ({
<PageHeader
actions={
<>
<Button
component="a"
target="_blank"
href={starterTemplate.url}
rel="noreferrer"
startIcon={<ExternalLinkIcon className="size-icon-sm" />}
>
View source code
<Button asChild variant="outline" size="sm">
<a target="_blank" href={starterTemplate.url} rel="noreferrer">
<ExternalLinkIcon />
View source code
</a>
</Button>
<Button
variant="contained"
component={Link}
to={`/templates/new?exampleId=${starterTemplate.id}`}
startIcon={<PlusIcon className="size-icon-sm" />}
>
Use template
<Button asChild size="sm">
<Link to={`/templates/new?exampleId=${starterTemplate.id}`}>
<PlusIcon />
Use template
</Link>
Comment on lines +53 to +57

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nit: I think differentiating these two buttons with outline/default variants is the right call, but theUse template button's left padding with the icon's whitespace is large, so the button contents look unbalanced

main:

image

this branch:

image

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure if I got it.... 🤔

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Screenshot 2025-05-21 at 12 12 48 PM

No big deal haha. Being thatButton has equalpx on the left/right, I feel like adding unequal x-padding like this inButton variants (or case-by-case for each icon?) would be a bit of a pain

</Button>
</>
}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
import "react-date-range/dist/styles.css";
import "react-date-range/dist/theme/default.css";
import type { Interpolation, Theme } from "@emotion/react";
import ArrowRightAltOutlined from "@mui/icons-material/ArrowRightAltOutlined";
import Button from "@mui/material/Button";
import { Button } from "components/Button/Button";
import {
Popover,
PopoverContent,
Expand All@@ -17,6 +16,7 @@ import {
startOfHour,
subDays,
} from "date-fns";
import { MoveRightIcon } from "lucide-react";
import { type ComponentProps, type FC, useRef, useState } from "react";
import { DateRangePicker, createStaticRanges } from "react-date-range";

Expand DownExpand Up@@ -54,11 +54,9 @@ export const DateRange: FC<DateRangeProps> = ({ value, onChange }) => {
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger>
<Button>
<Button variant="outline">
<span>{format(value.startDate, "MMM d, Y")}</span>
<ArrowRightAltOutlined
css={{ width: 16, height: 16, marginLeft: 8, marginRight: 8 }}
/>
<MoveRightIcon />
<span>{format(value.endDate, "MMM d, Y")}</span>
</Button>
</PopoverTrigger>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import Button, { type ButtonProps } from "@mui/material/Button";
import type { AlertProps } from "components/Alert/Alert";
import { Button, type ButtonProps } from "components/Button/Button";
import { Pill } from "components/Pill/Pill";
import {
Popover,
Expand DownExpand Up@@ -89,28 +89,13 @@ const NotificationItem: FC<NotificationItemProps> = ({ notification }) => {
{notification.detail && (
<p css={styles.notificationDetail}>{notification.detail}</p>
)}
<divcss={{ marginTop: 8 }}>{notification.actions}</div>
<divclassName="mt-2 flex items-center gap-1">{notification.actions}</div>
</article>
);
};

export const NotificationActionButton: FC<ButtonProps> = (props) => {
return (
<Button
variant="text"
css={{
textDecoration: "underline",
paddingLeft: 0,
paddingRight: 8,
paddingTop: 0,
paddingBottom: 0,
height: "auto",
minWidth: "auto",
"&:hover": { background: "none", textDecoration: "underline" },
}}
{...props}
/>
);
return <Button variant="outline" size="sm" {...props} />;
};

const styles = {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp