mirror of
https://github.com/ente-io/ente.git
synced 2025-08-06 06:33:15 +00:00
Improve
This commit is contained in:
parent
6fe6233664
commit
c5ab6e7c66
@ -1,5 +1,6 @@
|
|||||||
import { isDesktop } from "@/base/app";
|
import { isDesktop } from "@/base/app";
|
||||||
import { EnteSwitch } from "@/base/components/EnteSwitch";
|
import { EnteSwitch } from "@/base/components/EnteSwitch";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import {
|
import {
|
||||||
OverflowMenu,
|
OverflowMenu,
|
||||||
OverflowMenuOption,
|
OverflowMenuOption,
|
||||||
@ -15,7 +16,6 @@ import {
|
|||||||
SpaceBetweenFlex,
|
SpaceBetweenFlex,
|
||||||
VerticallyCenteredFlex,
|
VerticallyCenteredFlex,
|
||||||
} from "@ente/shared/components/Container";
|
} from "@ente/shared/components/Container";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { CustomError } from "@ente/shared/error";
|
import { CustomError } from "@ente/shared/error";
|
||||||
import FolderIcon from "@mui/icons-material/Folder";
|
import FolderIcon from "@mui/icons-material/Folder";
|
||||||
import {
|
import {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
|
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
|
||||||
import { formattedNumber } from "@/base/i18n";
|
import { formattedNumber } from "@/base/i18n";
|
||||||
import { EnteFile } from "@/media/file";
|
import { EnteFile } from "@/media/file";
|
||||||
import { SpaceBetweenFlex } from "@ente/shared/components/Container";
|
import { SpaceBetweenFlex } from "@ente/shared/components/Container";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { formatDateTime } from "@ente/shared/time/format";
|
import { formatDateTime } from "@ente/shared/time/format";
|
||||||
import { DialogActions, DialogContent, Stack, Typography } from "@mui/material";
|
import { DialogActions, DialogContent, Stack, Typography } from "@mui/material";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { LinkButtonUndecorated } from "@/base/components/LinkButton";
|
||||||
import { TitledMiniDialog } from "@/base/components/MiniDialog";
|
import { TitledMiniDialog } from "@/base/components/MiniDialog";
|
||||||
import { type ButtonishProps } from "@/base/components/mui";
|
import { type ButtonishProps } from "@/base/components/mui";
|
||||||
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
||||||
@ -68,7 +69,6 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import type { DisplayFile } from "components/PhotoFrame";
|
import type { DisplayFile } from "components/PhotoFrame";
|
||||||
import { Formik } from "formik";
|
import { Formik } from "formik";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
@ -254,18 +254,13 @@ export const FileInfo: React.FC<FileInfoProps> = ({
|
|||||||
{t("view_on_map")}
|
{t("view_on_map")}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<LinkButton
|
<LinkButtonUndecorated
|
||||||
onClick={
|
onClick={
|
||||||
openDisableMapConfirmationDialog
|
openDisableMapConfirmationDialog
|
||||||
}
|
}
|
||||||
sx={{
|
|
||||||
textDecoration: "none",
|
|
||||||
color: "text.muted",
|
|
||||||
fontWeight: "medium",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{t("disable_map")}
|
{t("disable_map")}
|
||||||
</LinkButton>
|
</LinkButtonUndecorated>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
trailingButton={
|
trailingButton={
|
||||||
@ -296,16 +291,9 @@ export const FileInfo: React.FC<FileInfoProps> = ({
|
|||||||
) : !exif.tags ? (
|
) : !exif.tags ? (
|
||||||
t("no_exif")
|
t("no_exif")
|
||||||
) : (
|
) : (
|
||||||
<LinkButton
|
<LinkButtonUndecorated onClick={showRawExif}>
|
||||||
onClick={showRawExif}
|
|
||||||
sx={{
|
|
||||||
textDecoration: "none",
|
|
||||||
color: "text.muted",
|
|
||||||
fontWeight: "medium",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("view_exif")}
|
{t("view_exif")}
|
||||||
</LinkButton>
|
</LinkButtonUndecorated>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -2,6 +2,7 @@ import { RecoveryKey } from "@/accounts/components/RecoveryKey";
|
|||||||
import { openAccountsManagePasskeysPage } from "@/accounts/services/passkey";
|
import { openAccountsManagePasskeysPage } from "@/accounts/services/passkey";
|
||||||
import { isDesktop } from "@/base/app";
|
import { isDesktop } from "@/base/app";
|
||||||
import { EnteLogo } from "@/base/components/EnteLogo";
|
import { EnteLogo } from "@/base/components/EnteLogo";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { SpaceBetweenFlex } from "@/base/components/containers";
|
import { SpaceBetweenFlex } from "@/base/components/containers";
|
||||||
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
||||||
import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer";
|
import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer";
|
||||||
@ -67,7 +68,6 @@ import {
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import DeleteAccountModal from "components/DeleteAccountModal";
|
import DeleteAccountModal from "components/DeleteAccountModal";
|
||||||
import { WatchFolder } from "components/WatchFolder";
|
import { WatchFolder } from "components/WatchFolder";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { GalleryContext } from "pages/gallery";
|
import { GalleryContext } from "pages/gallery";
|
||||||
|
@ -4,12 +4,12 @@ import {
|
|||||||
passkeySessionExpiredErrorMessage,
|
passkeySessionExpiredErrorMessage,
|
||||||
saveCredentialsAndNavigateTo,
|
saveCredentialsAndNavigateTo,
|
||||||
} from "@/accounts/services/passkey";
|
} from "@/accounts/services/passkey";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import type { MiniDialogAttributes } from "@/base/components/MiniDialog";
|
import type { MiniDialogAttributes } from "@/base/components/MiniDialog";
|
||||||
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
|
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
|
||||||
import { genericErrorDialogAttributes } from "@/base/components/utils/dialog";
|
import { genericErrorDialogAttributes } from "@/base/components/utils/dialog";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import { customAPIHost } from "@/base/origins";
|
import { customAPIHost } from "@/base/origins";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { CircularProgress, Stack, Typography, styled } from "@mui/material";
|
import { CircularProgress, Stack, Typography, styled } from "@mui/material";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
@ -5,9 +5,9 @@ import {
|
|||||||
import { PAGES } from "@/accounts/constants/pages";
|
import { PAGES } from "@/accounts/constants/pages";
|
||||||
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
||||||
import { sendOTT } from "@/accounts/services/user";
|
import { sendOTT } from "@/accounts/services/user";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { isMuseumHTTPError } from "@/base/http";
|
import { isMuseumHTTPError } from "@/base/http";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import SingleInputForm, {
|
import SingleInputForm, {
|
||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
} from "@ente/shared/components/SingleInputForm";
|
} from "@ente/shared/components/SingleInputForm";
|
||||||
|
@ -2,13 +2,13 @@ import { PAGES } from "@/accounts/constants/pages";
|
|||||||
import { generateKeyAndSRPAttributes } from "@/accounts/services/srp";
|
import { generateKeyAndSRPAttributes } from "@/accounts/services/srp";
|
||||||
import { sendOTT } from "@/accounts/services/user";
|
import { sendOTT } from "@/accounts/services/user";
|
||||||
import { isWeakPassword } from "@/accounts/utils/password";
|
import { isWeakPassword } from "@/accounts/utils/password";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { LoadingButton } from "@/base/components/mui/LoadingButton";
|
import { LoadingButton } from "@/base/components/mui/LoadingButton";
|
||||||
import { isMuseumHTTPError } from "@/base/http";
|
import { isMuseumHTTPError } from "@/base/http";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import { LS_KEYS, setLSUser } from "@ente/shared//storage/localStorage";
|
import { LS_KEYS, setLSUser } from "@ente/shared//storage/localStorage";
|
||||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||||
import ShowHidePassword from "@ente/shared/components/Form/ShowHidePassword";
|
import ShowHidePassword from "@ente/shared/components/Form/ShowHidePassword";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import {
|
import {
|
||||||
generateAndSaveIntermediateKeyAttributes,
|
generateAndSaveIntermediateKeyAttributes,
|
||||||
saveKeyInSessionStore,
|
saveKeyInSessionStore,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { CodeBlock } from "@/accounts/components/CodeBlock";
|
import { CodeBlock } from "@/accounts/components/CodeBlock";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
|
||||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { Stack, styled, Typography } from "@mui/material";
|
import { Stack, styled, Typography } from "@mui/material";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
@ -5,11 +5,11 @@ import {
|
|||||||
} from "@/accounts/components/layouts/centered-paper";
|
} from "@/accounts/components/layouts/centered-paper";
|
||||||
import { appHomeRoute } from "@/accounts/services/redirect";
|
import { appHomeRoute } from "@/accounts/services/redirect";
|
||||||
import { changeEmail, sendOTT } from "@/accounts/services/user";
|
import { changeEmail, sendOTT } from "@/accounts/services/user";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { LoadingButton } from "@/base/components/mui/LoadingButton";
|
import { LoadingButton } from "@/base/components/mui/LoadingButton";
|
||||||
import { isHTTPErrorWithStatus } from "@/base/http";
|
import { isHTTPErrorWithStatus } from "@/base/http";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import { LS_KEYS, getData, setLSUser } from "@ente/shared/storage/localStorage";
|
import { LS_KEYS, getData, setLSUser } from "@ente/shared/storage/localStorage";
|
||||||
import { Alert, Box, TextField } from "@mui/material";
|
import { Alert, Box, TextField } from "@mui/material";
|
||||||
import { Formik, type FormikHelpers } from "formik";
|
import { Formik, type FormikHelpers } from "formik";
|
||||||
|
@ -20,8 +20,8 @@ import {
|
|||||||
updateSRPAndKeys,
|
updateSRPAndKeys,
|
||||||
} from "@/accounts/services/srp-remote";
|
} from "@/accounts/services/srp-remote";
|
||||||
import type { UpdatedKey } from "@/accounts/services/user";
|
import type { UpdatedKey } from "@/accounts/services/user";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { sharedCryptoWorker } from "@/base/crypto";
|
import { sharedCryptoWorker } from "@/base/crypto";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import {
|
import {
|
||||||
generateAndSaveIntermediateKeyAttributes,
|
generateAndSaveIntermediateKeyAttributes,
|
||||||
generateLoginSubKey,
|
generateLoginSubKey,
|
||||||
|
@ -26,12 +26,12 @@ import {
|
|||||||
import type { SRPAttributes } from "@/accounts/services/srp-remote";
|
import type { SRPAttributes } from "@/accounts/services/srp-remote";
|
||||||
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
||||||
import type { PageProps } from "@/accounts/types/page";
|
import type { PageProps } from "@/accounts/types/page";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { LoadingIndicator } from "@/base/components/loaders";
|
import { LoadingIndicator } from "@/base/components/loaders";
|
||||||
import { sharedCryptoWorker } from "@/base/crypto";
|
import { sharedCryptoWorker } from "@/base/crypto";
|
||||||
import type { B64EncryptionResult } from "@/base/crypto/libsodium";
|
import type { B64EncryptionResult } from "@/base/crypto/libsodium";
|
||||||
import { clearLocalStorage } from "@/base/local-storage";
|
import { clearLocalStorage } from "@/base/local-storage";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import VerifyMasterPasswordForm, {
|
import VerifyMasterPasswordForm, {
|
||||||
type VerifyMasterPasswordFormProps,
|
type VerifyMasterPasswordFormProps,
|
||||||
} from "@ente/shared/components/VerifyMasterPasswordForm";
|
} from "@ente/shared/components/VerifyMasterPasswordForm";
|
||||||
|
@ -15,9 +15,9 @@ import {
|
|||||||
} from "@/accounts/services/srp";
|
} from "@/accounts/services/srp";
|
||||||
import { putAttributes } from "@/accounts/services/user";
|
import { putAttributes } from "@/accounts/services/user";
|
||||||
import type { PageProps } from "@/accounts/types/page";
|
import type { PageProps } from "@/accounts/types/page";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { LoadingIndicator } from "@/base/components/loaders";
|
import { LoadingIndicator } from "@/base/components/loaders";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import {
|
import {
|
||||||
generateAndSaveIntermediateKeyAttributes,
|
generateAndSaveIntermediateKeyAttributes,
|
||||||
saveKeyInSessionStore,
|
saveKeyInSessionStore,
|
||||||
|
@ -7,9 +7,9 @@ import { PAGES } from "@/accounts/constants/pages";
|
|||||||
import { appHomeRoute, stashRedirect } from "@/accounts/services/redirect";
|
import { appHomeRoute, stashRedirect } from "@/accounts/services/redirect";
|
||||||
import { sendOTT } from "@/accounts/services/user";
|
import { sendOTT } from "@/accounts/services/user";
|
||||||
import type { PageProps } from "@/accounts/types/page";
|
import type { PageProps } from "@/accounts/types/page";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { sharedCryptoWorker } from "@/base/crypto";
|
import { sharedCryptoWorker } from "@/base/crypto";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import SingleInputForm, {
|
import SingleInputForm, {
|
||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
} from "@ente/shared/components/SingleInputForm";
|
} from "@ente/shared/components/SingleInputForm";
|
||||||
|
@ -10,11 +10,11 @@ import {
|
|||||||
type TwoFactorType,
|
type TwoFactorType,
|
||||||
} from "@/accounts/services/user";
|
} from "@/accounts/services/user";
|
||||||
import type { AccountsContextT } from "@/accounts/types/context";
|
import type { AccountsContextT } from "@/accounts/types/context";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import type { MiniDialogAttributes } from "@/base/components/MiniDialog";
|
import type { MiniDialogAttributes } from "@/base/components/MiniDialog";
|
||||||
import { sharedCryptoWorker } from "@/base/crypto";
|
import { sharedCryptoWorker } from "@/base/crypto";
|
||||||
import type { B64EncryptionResult } from "@/base/crypto/libsodium";
|
import type { B64EncryptionResult } from "@/base/crypto/libsodium";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import SingleInputForm, {
|
import SingleInputForm, {
|
||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
} from "@ente/shared/components/SingleInputForm";
|
} from "@ente/shared/components/SingleInputForm";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { PAGES } from "@/accounts/constants/pages";
|
import { PAGES } from "@/accounts/constants/pages";
|
||||||
import { verifyTwoFactor } from "@/accounts/services/user";
|
import { verifyTwoFactor } from "@/accounts/services/user";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { ApiError } from "@ente/shared/error";
|
import { ApiError } from "@ente/shared/error";
|
||||||
import {
|
import {
|
||||||
LS_KEYS,
|
LS_KEYS,
|
||||||
|
@ -20,9 +20,9 @@ import type {
|
|||||||
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
import { getSRPAttributes } from "@/accounts/services/srp-remote";
|
||||||
import { putAttributes, sendOTT, verifyEmail } from "@/accounts/services/user";
|
import { putAttributes, sendOTT, verifyEmail } from "@/accounts/services/user";
|
||||||
import type { PageProps } from "@/accounts/types/page";
|
import type { PageProps } from "@/accounts/types/page";
|
||||||
|
import { LinkButton } from "@/base/components/LinkButton";
|
||||||
import { LoadingIndicator } from "@/base/components/loaders";
|
import { LoadingIndicator } from "@/base/components/loaders";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
|
||||||
import SingleInputForm, {
|
import SingleInputForm, {
|
||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
} from "@ente/shared/components/SingleInputForm";
|
} from "@ente/shared/components/SingleInputForm";
|
||||||
|
58
web/packages/base/components/LinkButton.tsx
Normal file
58
web/packages/base/components/LinkButton.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { Link } from "@mui/material";
|
||||||
|
import React from "react";
|
||||||
|
import { type ButtonishProps } from "./mui";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A button that looks like a link.
|
||||||
|
*
|
||||||
|
* The use of this component is not encouraged. It is only useful in uncommon
|
||||||
|
* cases where we do not have sufficient space to include a proper button.
|
||||||
|
*/
|
||||||
|
export const LinkButton: React.FC<React.PropsWithChildren<ButtonishProps>> = ({
|
||||||
|
onClick,
|
||||||
|
children,
|
||||||
|
}) => (
|
||||||
|
<Link
|
||||||
|
component="button"
|
||||||
|
sx={(theme) => ({
|
||||||
|
color: "text.base",
|
||||||
|
textDecoration: "underline",
|
||||||
|
// The shortcut "text.faint" does not work with textDecorationColor
|
||||||
|
// (as of MUI v6).
|
||||||
|
textDecorationColor: theme.vars.palette.text.faint,
|
||||||
|
"&:hover": {
|
||||||
|
color: "accent.main",
|
||||||
|
textDecoration: "underline",
|
||||||
|
textDecorationColor: "accent.main",
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
{...{ onClick }}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A variant of {@link LinkButton} that does not show an underline, and instead
|
||||||
|
* uses a bolder font weight to indicate clickability.
|
||||||
|
*
|
||||||
|
* Similar caveats as {@link LinkButton} apply.
|
||||||
|
*/
|
||||||
|
export const LinkButtonUndecorated: React.FC<
|
||||||
|
React.PropsWithChildren<ButtonishProps>
|
||||||
|
> = ({ onClick, children }) => (
|
||||||
|
<Link
|
||||||
|
component="button"
|
||||||
|
sx={{
|
||||||
|
textDecoration: "none",
|
||||||
|
color: "text.muted",
|
||||||
|
fontWeight: "medium",
|
||||||
|
"&:hover": {
|
||||||
|
color: "accent.main",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
{...{ onClick }}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
);
|
@ -1,27 +0,0 @@
|
|||||||
import { Link, type ButtonProps, type LinkProps } from "@mui/material";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const LinkButton: React.FC<
|
|
||||||
LinkProps<"button", { color?: ButtonProps["color"] }>
|
|
||||||
> = ({ children, sx, color, ...props }) => {
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
component="button"
|
|
||||||
sx={{
|
|
||||||
color: "text.base",
|
|
||||||
textDecoration: "underline rgba(255, 255, 255, 0.4)",
|
|
||||||
"&:hover": {
|
|
||||||
color: `${color}.main`,
|
|
||||||
textDecoration: `underline `,
|
|
||||||
textDecorationColor: `${color}.main`,
|
|
||||||
},
|
|
||||||
...sx,
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LinkButton;
|
|
Loading…
x
Reference in New Issue
Block a user