chore: remove hover effects in mobile

This commit is contained in:
Tristan Yang
2023-02-20 12:54:45 +08:00
parent 567b3714bc
commit 053c7d9402
27 changed files with 46 additions and 54 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ const GuestBlankPlaceholder = () => {
navigateTo("/login");
};
return (
<section className="flex flex-col items-center">
<h2 className="text-3xl text-gray-600 dark:text-gray-50 font-bold text-center">{t("welcome", { name: serverName })}</h2>
<section className="flex flex-col items-center text-center">
<h2 className="text-3xl text-gray-600 dark:text-gray-50 font-bold">{t("welcome", { name: serverName })}</h2>
<div className="flex flex-col gap-2">
<span className="text-gray-400 dark:text-gray-200 my-3 text-sm">{t("guest_login_tip")}</span>
<div className="w-44 h-44 self-center mb-4">
+1 -1
View File
@@ -39,7 +39,7 @@ const Session: FC<IProps> = ({ id, mid }) => {
return (
<li className="session">
<NavLink className={({ isActive: linkActive }) => clsx(`nav flex gap-2 rounded-lg p-2 w-full hover:bg-gray-500/20`, linkActive && "bg-gray-500/20")} to={`/chat/channel/${id}`}>
<NavLink className={({ isActive: linkActive }) => clsx(`nav flex gap-2 rounded-lg p-2 w-full md:hover:bg-gray-500/20`, linkActive && "bg-gray-500/20")} to={`/chat/channel/${id}`}>
<div className="flex bg-slate-50 rounded-full">
<Avatar width={40} height={40} className="icon" type="channel" name={name} src={icon} />
</div>
+4 -4
View File
@@ -55,17 +55,17 @@ const Operations: FC<Props> = ({ context, id }) => {
});
const canDel = canDelete(mids);
// const
const optClass = `p-2 bg-slate-100 rounded md:hover:bg-slate-300`;
return (
<>
<div className="relative p-4 flex-center gap-8 shadow-md">
<button className="p-2 bg-slate-100 rounded hover:bg-slate-300" onClick={toggleForwardModal}>
<button className={optClass} onClick={toggleForwardModal}>
<IconForward />
</button>
<button className="p-2 bg-slate-100 rounded hover:bg-slate-300" onClick={handleFav}>
<button className={optClass} onClick={handleFav}>
<IconBookmark />
</button>
<button className="p-2 bg-slate-100 rounded hover:bg-slate-300" disabled={!canDel} onClick={toggleDeleteModal.bind(null, false)}>
<button className={optClass} disabled={!canDel} onClick={toggleDeleteModal.bind(null, false)}>
<IconDelete />
</button>
<IconClose className="cursor-pointer absolute right-5 top-1/2 -translate-y-1/2" onClick={handleClose} />
+2 -2
View File
@@ -109,7 +109,7 @@ const Session: FC<IProps> = ({
>
<NavLink
ref={drop}
className={({ isActive: linkActive }) => clsx(`nav flex gap-2 rounded-lg p-2 w-full hover:bg-gray-500/20`, isActive && "shadow-[inset_0_0_0_2px_#52edff]", linkActive && "bg-gray-500/20")}
className={({ isActive: linkActive }) => clsx(`nav flex gap-2 rounded-lg p-2 w-full md:hover:bg-gray-500/20`, isActive && "shadow-[inset_0_0_0_2px_#52edff]", linkActive && "bg-gray-500/20")}
to={type == "user" ? `/chat/dm/${id}` : `/chat/channel/${id}`}
onContextMenu={handleContextMenuEvent}
>
@@ -142,7 +142,7 @@ const Session: FC<IProps> = ({
<div className="flex items-center justify-between">
<span className={clsx("text-xs text-gray-500 dark:text-gray-400 truncate", unreads > 0 ? `w-36` : ``)}>{renderPreviewMessage(previewMsg)}</span>
{unreads > 0 && (
<strong className={clsx(`text-white h-5 min-w-[20px] bg-primary-400 font-bold text-[10px] rounded-[10px] flex-center`, unreads > 99 && 'w-1.5 h-1.5 p-0 min-w-[unset]', muted && "bg-gray-500")}>
<strong className={clsx(`text-white h-5 min-w-[20px] bg-primary-400 font-bold text-[10px] rounded-[10px] flex-center`, unreads > 99 && 'w-1.5 !h-1.5 p-0 min-w-[unset]', muted && "bg-gray-500")}>
{unreads > 99 ? null : unreads}
</strong>
)}
+1 -1
View File
@@ -125,7 +125,7 @@ function FavsPage() {
return (
<li
key={f}
className={clsx(f == filter && 'bg-[rgba(116,_127,_141,_0.2)]', `cursor-pointer flex items-center gap-2 p-2 rounded-lg hover:bg-[rgba(116,_127,_141,_0.2)]`)}
className={clsx(f == filter && 'bg-[rgba(116,_127,_141,_0.2)]', `cursor-pointer flex items-center gap-2 p-2 rounded-lg md:hover:bg-[rgba(116,_127,_141,_0.2)]`)}
onClick={handleFilter.bind(null, f as filter)}
>
{icon}
+5 -5
View File
@@ -48,7 +48,7 @@ function HomePage() {
// 有点绕
const chatNav = isChatHomePath ? "/chat" : chatPath || "/chat";
const userNav = userPath || "/users";
const linkClass = `flex items-center gap-2.5 px-3 py-2 font-semibold text-sm text-gray-600 rounded-lg hover:bg-gray-800/10`;
const linkClass = `flex items-center gap-2.5 px-3 py-2 font-semibold text-sm text-gray-600 rounded-lg md:hover:bg-gray-800/10`;
return (
<>
<Manifest />
@@ -59,7 +59,7 @@ function HomePage() {
{loginUid && <User uid={loginUid} />}
<nav className="flex flex-col gap-1 px-3 py-6">
<NavLink
className={({ isActive }) => `${linkClass} ${(isActive || isChattingPage) ? "bg-primary-400 hover:bg-primary-400" : ""}`}
className={({ isActive }) => `${linkClass} ${(isActive || isChattingPage) ? "bg-primary-400 md:hover:bg-primary-400" : ""}`}
to={chatNav}
>
{({ isActive }) => {
@@ -68,21 +68,21 @@ function HomePage() {
</Tooltip>;
}}
</NavLink>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 hover:bg-primary-400' : ""}`} to={userNav}>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 md:hover:bg-primary-400' : ""}`} to={userNav}>
{({ isActive }) => {
return <Tooltip tip={t("members")}>
<UserIcon className={isActive ? "fill-white" : ""} />
</Tooltip>;
}}
</NavLink>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 hover:bg-primary-400' : ""}`} to={"/favs"}>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 md:hover:bg-primary-400' : ""}`} to={"/favs"}>
{({ isActive }) => {
return <Tooltip tip={t("favs")}>
<FavIcon className={isActive ? "fill-white" : ""} />
</Tooltip>;
}}
</NavLink>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 hover:bg-primary-400' : ""}`} to={"/files"}>
<NavLink className={({ isActive }) => `${linkClass} ${isActive ? 'bg-primary-400 md:hover:bg-primary-400' : ""}`} to={"/files"}>
{({ isActive }) => {
return <Tooltip tip={t("files")}>
<FolderIcon className={isActive ? "fill-white" : ""} />
+1 -1
View File
@@ -22,7 +22,7 @@ const Navigator = () => {
<div className="hidden md:flex absolute top-5 w-full justify-center gap-2 z-10">
{steps.map((stepToRender, indexToRender) => {
const clickable = canJumpTo.includes(stepToRender.name);
const itemClass = clsx(`text-sm text-gray-600`, clickable && "cursor-pointer hover:text-gray-500", indexToRender === activeStep && "font-bold text-black", indexToRender >= activeStep && "text-gray-400");
const itemClass = clsx(`text-sm text-gray-600`, clickable && "cursor-pointer md:hover:text-gray-500", indexToRender === activeStep && "font-bold text-black", indexToRender >= activeStep && "text-gray-400");
const nodeCls = `${itemClass}`;
return (
<React.Fragment key={indexToRender}>
+1 -1
View File
@@ -20,7 +20,7 @@ export default function InviteLink() {
<span className="text-sm text-gray-500 mb-2 font-semibold">{t("last_desc")}</span>
<div className="w-full md:w-[400px] rounded shadow-md flex border border-solid border-gray-100">
<StyledInput className="large !border-none !shadow-none" readOnly placeholder="Generating" value={link} />
<StyledButton onClick={copyLink} className="ghost small border_less !px-2 hover:!text-primary-600">
<StyledButton onClick={copyLink} className="ghost small border_less !px-2 md:hover:!text-primary-600">
{linkCopied ? "Copied" : ct("action.copy")}
</StyledButton>
</div>
@@ -62,7 +62,7 @@ const TestAPIKeyModal = ({ closeModal }: Props) => {
>
{key ? (data ? <ul className="divide-y-2">
{data.map(({ gid, name, is_public }) => {
return <li key={gid} className={clsx("py-1 px-2 text-gray-500 cursor-pointer hover:bg-slate-50", gid == currCid ? 'bg-slate-100' : "")} onClick={handleSetChannel.bind(null, gid)}>
return <li key={gid} className={clsx("py-1 px-2 text-gray-500 cursor-pointer md:hover:bg-slate-50", gid == currCid ? 'bg-slate-100' : "")} onClick={handleSetChannel.bind(null, gid)}>
# {name} {!is_public ? "🔒" : ""}
</li>;
})}
@@ -73,7 +73,7 @@ const TestAPIKeyModal = ({ closeModal }: Props) => {
<Textarea ref={msgInputRef} placeholder='Input Something...' />
<ul className='flex gap-1'>
{Object.entries(MessageTypes).map(([key, value]) => {
return <li onClick={handleSetMsgType.bind(null, key)} className={clsx("py-1 px-2 text-gray-500 cursor-pointer hover:bg-slate-50", msgType == key ? 'bg-slate-100' : "")} key={key}>{value}</li>;
return <li onClick={handleSetMsgType.bind(null, key)} className={clsx("py-1 px-2 text-gray-500 cursor-pointer md:hover:bg-slate-50", msgType == key ? 'bg-slate-100' : "")} key={key}>{value}</li>;
})}
</ul>
<Button className='mini' onClick={handleSend} >Send</Button>
+1 -1
View File
@@ -85,7 +85,7 @@ export default function BotConfig() {
<tbody>
{bots.map(bot => {
const { uid, name, avatar } = bot;
return <tr key={uid} className="bg-white dark:bg-gray-800 border-b dark:border-b-gray-500 transition duration-300 ease-in-out hover:bg-gray-100">
return <tr key={uid} className="bg-white dark:bg-gray-800 border-b dark:border-b-gray-500 transition duration-300 ease-in-out md:hover:bg-gray-100">
<td className="px-4 py-2">
<AvatarUploader uid={uid} url={avatar} uploadImage={updateAvatar} name={name} size={56} />
</td>
@@ -133,7 +133,7 @@ const LicensePriceListModal: FC<Props> = ({ closeModal }) => {
</div>
}
>
<button onClick={togglePopUpVisible} className="text-sm text-white bg-primary-400 break-keep shadow rounded-lg px-3.5 py-2.5 hover:bg-primary-500 active:bg-primary-500 disabled:bg-gray-300"> {t("license.renew")}</button>
<button onClick={togglePopUpVisible} className="text-sm text-white bg-primary-400 break-keep shadow rounded-lg px-3.5 py-2.5 md:hover:bg-primary-500 active:bg-primary-500 disabled:bg-gray-300"> {t("license.renew")}</button>
{/* <Button >
{t("license.renew")}
</Button> */}
+1 -1
View File
@@ -5,7 +5,7 @@ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
const Row = ({ paramKey, paramDefault, remarks }: { paramKey: string, paramDefault: string | number, remarks: string }) => {
return <tr className="bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-50 border-b transition duration-300 ease-in-out hover:bg-gray-100">
return <tr className="bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-50 border-b transition duration-300 ease-in-out md:hover:bg-gray-100">
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium">
{paramKey}
</td>
+1 -1
View File
@@ -36,7 +36,7 @@ function UsersPage() {
<nav className="flex flex-col md:gap-1">
{users.map(({ uid }) => {
return (
<NavLink key={uid} className={({ isActive }) => `rounded-md hover:bg-gray-500/10 ${isActive ? "bg-gray-500/10" : ""}`} to={`/users/${uid}`}>
<NavLink key={uid} className={({ isActive }) => `rounded-md md:hover:bg-gray-500/10 ${isActive ? "bg-gray-500/10" : ""}`} to={`/users/${uid}`}>
<User uid={uid} enableContextMenu={true} />
</NavLink>
);