feat: add social link

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-07-24 17:17:23 +08:00
parent 674479610d
commit 123bb48c51
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
8 changed files with 63 additions and 11 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#fff" fill-opacity=".01" d="M24 0v24H0V0z"/><path fill="#10161F" fill-rule="evenodd" d="M9.99 5.147A13.65 13.65 0 0 1 12 5c.692 0 1.366.05 2.014.148A1.012 1.012 0 0 1 15.004 4c.93 0 1.924.406 2.777.763 1.26.528 1.968 1.636 2.517 2.853.89 1.975 1.509 4.608 1.723 6.61.102.95.127 1.906-.056 2.549-.245.858-1.232 1.403-1.995 1.824l-.18.1c-.687.384-1.446.756-1.97 1.013l-.37.182a1 1 0 1 1-.894-1.788l.416-.206.375-.184-.58-.609c-1.39.57-3.028.893-4.767.893-1.739 0-3.376-.322-4.766-.893l-.58.608.339.166.455.225a1 1 0 1 1-.895 1.788l-.544-.27c-.604-.298-1.208-.596-1.796-.925a54.33 54.33 0 0 0-.18-.1c-.762-.42-1.749-.966-1.994-1.824-.184-.643-.158-1.598-.056-2.55.214-2.001.832-4.634 1.723-6.609.549-1.217 1.257-2.325 2.517-2.853C7.06 4.413 8.072 4 9 4c.603 0 1.077.555.99 1.147m.51 7.103a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0M15.25 14a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5" clip-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 998 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#fff" fill-opacity=".01" d="M24 0v24H0V0z"/><path fill="#10161F" d="M19.564 4.494a.75.75 0 1 0-1.128-.988zM4.436 19.506a.75.75 0 0 0 1.128.988zm15.217-.642.579-.477zM18.436 3.506l-5.924 6.77 1.13.987 5.922-6.77zm-8.077 9.23-5.923 6.77 1.128.988 5.924-6.77zM5.119 4.25h.465v-1.5H5.12zm2.202.82L19.074 19.34l1.158-.954L8.479 4.118zm11.56 14.68h-.465v1.5h.465zm-2.202-.82L4.926 4.66l-1.158.953 11.753 14.272zm1.737.82c-.673 0-1.31-.3-1.737-.82l-1.158.954a3.75 3.75 0 0 0 2.895 1.366zm.658-.409a.25.25 0 0 1-.193.409v1.5c1.479 0 2.291-1.72 1.35-2.863zM5.584 4.25c.673 0 1.31.3 1.737.82l1.158-.954A3.75 3.75 0 0 0 5.584 2.75zm-.465-1.5c-1.479 0-2.291 1.72-1.35 2.862l1.157-.953a.25.25 0 0 1 .193-.409z"/></svg>

After

Width:  |  Height:  |  Size: 792 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#fff" fill-opacity=".01" d="M24 0v24H0V0z"/><path fill="#10161F" d="M19.753 4.659a1 1 0 0 0-1.506-1.317zM4.247 19.342a1 1 0 0 0 1.506 1.317zm15.406-.478.772-.635zM18.247 3.342l-5.923 6.769 1.505 1.317 5.924-6.77zm-8.076 9.23-5.924 6.77 1.506 1.317 5.923-6.77zM5.119 4.5h.465v-2H5.12zm2.01.729L18.88 19.5l1.544-1.271L8.672 3.957zM18.88 19.5h-.465v2h.465zm-2.01-.729L5.12 4.5 3.575 5.771l11.753 14.272zm1.545.729a2 2 0 0 1-1.544-.729l-1.544 1.272a4 4 0 0 0 3.088 1.457zm.465 0v2c1.69 0 2.618-1.967 1.544-3.271zM5.584 4.5a2 2 0 0 1 1.544.729l1.544-1.272A4 4 0 0 0 5.584 2.5zm-.465-2c-1.69 0-2.618 1.967-1.544 3.271L5.12 4.5z"/></svg>

After

Width:  |  Height:  |  Size: 717 B

View File

@ -194,7 +194,7 @@ export const router = {
nativeTheme.themeSource = systemColorMode === input ? "system" : input
}),
setMacOSBadge: t.procedure.input<number>().action(async ({ input }) => {
setDockBadge: t.procedure.input<number>().action(async ({ input }) => {
if (app.dock) {
if (input === 0) {
app.dock.setBadge("")

View File

@ -0,0 +1,19 @@
import { repository } from "@pkg"
export const SocialMediaLinks = [
{
icon: "i-mgc-github-cute-fi",
label: "GitHub",
url: repository.url,
},
{
icon: "i-mgc-discord-cute-fi",
label: "Discord",
url: "https://discord.gg/b7hC2qcE",
},
{
icon: "i-mgc-social-x-cute-re",
label: "X",
url: "https://x.com/follow_app_",
},
]

View File

@ -51,7 +51,7 @@ export function SettingModalLayout(
scale: 0.96,
}}
className={cn(
"relative flex h-[500px] max-h-[80vh] w-[660px] max-w-full flex-col overflow-hidden rounded-xl border border-border",
"relative flex h-[500px] max-h-[80vh] w-[calc(170px+55ch)] max-w-full flex-col overflow-hidden rounded-xl border border-border",
!overlay && "shadow-perfect",
)}
onContextMenu={preventDefault}

View File

@ -1,6 +1,8 @@
import { license, repository } from "@pkg"
import { Logo } from "@renderer/components/icons/logo"
import { StyledButton } from "@renderer/components/ui/button"
import { Button, StyledButton } from "@renderer/components/ui/button"
import { Divider } from "@renderer/components/ui/divider"
import { SocialMediaLinks } from "@renderer/constants/social"
export const SettingAbout = () => (
<div>
@ -33,7 +35,7 @@ export const SettingAbout = () => (
</div>
</div>
<p className="mt-3 text-balance text-sm">
<p className="mt-6 text-balance text-sm">
{APP_NAME}
{" "}
is a free and open-source project. It is licensed under the
@ -48,12 +50,15 @@ export const SettingAbout = () => (
{" "}
(
{GIT_COMMIT_SHA.slice(0, 7).toUpperCase()}
)
) currently early
in development. If you have any feedback or suggestions, please feel
free to
{" "}
currently early in development. If you have any feedback or
suggestions, please feel free to
{" "}
<a className="inline-flex cursor-pointer items-center gap-1 hover:underline" href={`${repository.url}/issues/new`} target="_blank">
<a
className="inline-flex cursor-pointer items-center gap-1 hover:underline"
href={`${repository.url}/issues/new`}
target="_blank"
>
open an issue
{" "}
<i className="i-mgc-external-link-cute-re" />
@ -61,6 +66,31 @@ export const SettingAbout = () => (
{" "}
on the GitHub.
</p>
<Divider className="scale-x-50" />
<h2 className="text-base font-semibold">
{/* 社区与资讯 */}
Social Media
</h2>
<div className="mt-2 flex flex-wrap gap-2">
{SocialMediaLinks.map((link) => (
<Button
as="a"
key={link.url}
variant="outline"
className="flex flex-1 cursor-pointer items-center gap-2"
// @ts-expect-error
href={link.url}
target="_blank"
rel="noreferrer"
>
<i className={link.icon} />
{link.label}
</Button>
))}
</div>
</section>
</div>
)

View File

@ -15,11 +15,11 @@ const useUISettingSync = () => {
useEffect(() => {
if (setting.showDockBadge) {
return feedUnreadActions.subscribeUnreadCount(
(count) => tipcClient?.setMacOSBadge(count),
(count) => tipcClient?.setDockBadge(count),
true,
)
} else {
tipcClient?.setMacOSBadge(0)
tipcClient?.setDockBadge(0)
}
return
}, [setting.showDockBadge])