Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 25 additions & 1 deletion src/components/drawer/NavAside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const NavAside = () => {

const [showOperationSetDialog, setShowOperationSetDialog] = useState(false)

const { NAV_LINKS, SOCIAL_LINKS } = useLinks()
const { NAV_LINKS, SOCIAL_LINKS, FRIENDLY_LINKS } = useLinks()

if (!isMD) return null

Expand Down Expand Up @@ -93,6 +93,30 @@ export const NavAside = () => {
</>
))}
</div>
<div className="mt-2 p-2">
<div className="text-sm font-medium text-zinc-600 dark:text-slate-100 mb-2">
{t.links.friendly_links}
</div>
<div className="flex flex-wrap leading-relaxed mb-2 section-social-links">
{FRIENDLY_LINKS.map((link) => (
<a
href={link.href}
target="_blank"
rel="noopener noreferrer"
className="flex items-center text-zinc-600 dark:text-slate-100 no-underline"
>
{link.icon}
<span>{link.label}</span>
</a>
)).reduce((prev, curr) => (
<>
{prev}
<div className="mx-2 opacity-50">·</div>
{curr}
</>
))}
</div>
</div>
</Drawer>

<OperationSetEditorDialog
Expand Down
14 changes: 13 additions & 1 deletion src/components/drawer/OperationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,24 @@ export function OperationDrawer() {
})
}

const handleOuterBackdropClick = (e?: SyntheticEvent) => {
if (e?.nativeEvent instanceof MouseEvent && e.nativeEvent.button !== 0) {
return
}

if (operationId) {
closeOperation(e)
} else {
closeOperationSet(e)
}
}

if (operationSetId) {
return (
<Drawer
size={DrawerSize.LARGE}
isOpen={!!operationSetId}
onClose={closeOperationSet}
onClose={handleOuterBackdropClick}
>
{operationSetId && (
<OperationSetViewer
Expand Down
12 changes: 10 additions & 2 deletions src/hooks/useLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from '../i18n/i18n'
import { NAV_CONFIG, SOCIAL_CONFIG } from '../links'
import { FRIENDLY_LINKS_CONFIG, NAV_CONFIG, SOCIAL_CONFIG } from '../links'

export const useLinks = () => {
useTranslation()
Expand All @@ -16,5 +16,13 @@ export const useLinks = () => {
label: labelKey(),
}))

return { NAV_LINKS, SOCIAL_LINKS }
const FRIENDLY_LINKS = FRIENDLY_LINKS_CONFIG.map(
({ icon, href, labelKey }) => ({
icon,
href,
label: labelKey(),
}),
)

return { NAV_LINKS, SOCIAL_LINKS, FRIENDLY_LINKS }
}
20 changes: 18 additions & 2 deletions src/i18n/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -4113,13 +4113,25 @@
"cn": "MAA 官网",
"en": "MAA Official Site"
},
"map_site": {
"cn": "明日方舟地图站",
"en": "Arknights PRTS.Map"
},
"theresa_site": {
"cn": "特蕾西娅",
"en": "Theresa"
},
"maafw_site": {
"cn": "MaaFramework",
"en": "MaaFramework"
},
"feedback": {
"cn": "意见与反馈",
"en": "Feedback"
},
"maa_repo": {
"cn": "MAA GitHub Repo",
"en": "MAA GitHub Repo"
"cn": "MAA Repo",
"en": "MAA Repo"
},
"frontend_repo": {
"cn": "前端 GitHub Repo",
Expand All @@ -4136,6 +4148,10 @@
"sharing_group": {
"cn": "作业分享群",
"en": "Job Sharing Group"
},
"friendly_links": {
"cn": "友情链接",
"en": "Friendly Links"
}
}
}
46 changes: 32 additions & 14 deletions src/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ export const NAV_CONFIG = [
]

export const SOCIAL_CONFIG = [
{
icon: <BlueprintIcon icon="globe" className="mr-2" size={12} />,
href: 'https://maa.plus',
labelKey: i18nDefer.links.official_site,
},
{
icon: <BlueprintIcon icon="edit" className="mr-2" size={12} />,
href: 'https://github.com/MaaAssistantArknights/maa-copilot-frontend/issues/new/choose',
Expand All @@ -43,21 +38,14 @@ export const SOCIAL_CONFIG = [
icon: (
<IconifyIcon icon={simpleIconsGitHub} className="mr-2" fontSize="12px" />
),
href: 'https://github.com/MaaAssistantArknights/MaaAssistantArknights',
labelKey: i18nDefer.links.maa_repo,
},
{
icon: (
<IconifyIcon icon={simpleIconsGitHub} className="mr-2" fontSize="12px" />
),
href: 'https://github.com/MaaAssistantArknights/maa-copilot-frontend',
href: 'https://github.com/ZOOT-Plus/zoot-plus-frontend',
labelKey: i18nDefer.links.frontend_repo,
},
{
icon: (
<IconifyIcon icon={simpleIconsGitHub} className="mr-2" fontSize="12px" />
),
href: 'https://github.com/MaaAssistantArknights/MaaBackendCenter',
href: 'https://github.com/ZOOT-Plus/ZootPlusBackend',
labelKey: i18nDefer.links.backend_repo,
},
{
Expand All @@ -71,3 +59,33 @@ export const SOCIAL_CONFIG = [
labelKey: i18nDefer.links.sharing_group,
},
]

export const FRIENDLY_LINKS_CONFIG = [
{
icon: <BlueprintIcon icon="globe" className="mr-2" size={12} />,
href: 'https://maa.plus',
labelKey: i18nDefer.links.official_site,
},
{
icon: (
<IconifyIcon icon={simpleIconsGitHub} className="mr-2" fontSize="12px" />
),
href: 'https://github.com/MaaAssistantArknights/MaaAssistantArknights',
labelKey: i18nDefer.links.maa_repo,
},
{
icon: <BlueprintIcon icon="globe" className="mr-2" size={12} />,
href: 'https://map.ark-nights.com/',
labelKey: i18nDefer.links.map_site,
},
{
icon: <BlueprintIcon icon="globe" className="mr-2" size={12} />,
href: 'https://theresa.wiki/',
labelKey: i18nDefer.links.theresa_site,
},
{
icon: <BlueprintIcon icon="globe" className="mr-2" size={12} />,
href: 'https://maafw.xyz/',
labelKey: i18nDefer.links.maafw_site,
},
]
26 changes: 24 additions & 2 deletions src/models/generated/operators.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
"id": "token_10054_phatm2_encdool",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "Blood's whisper",
"name_en": "Blood's Whisper",
"name": "本能的召唤",
"alias": "bennengdezhaohuan bennengdeshaohuan bennengdizhaohuan bennengdishaohuan bennaidezhaohuan bennaideshaohuan bennaidizhaohuan bennaidishaohuan bndzh bndsh 本能的召喚",
"rarity": 0,
Expand Down Expand Up @@ -2376,6 +2376,17 @@
"alt_name": "Gnosis",
"modules": ["", "X", "Y", "A"]
},
{
"id": "char_617_sharp2",
"prof": "WARRIOR",
"subProf": "lord",
"name_en": "Lord/Sharp",
"name": "领主·Sharp",
"alias": "lingzhu·Sharp lz·Sharp 領主·Sharp",
"rarity": 6,
"alt_name": "Lord/Sharp",
"modules": ["", "X"]
},
{
"id": "char_4042_lumen",
"prof": "MEDIC",
Expand Down Expand Up @@ -2624,6 +2635,17 @@
"rarity": 3,
"alt_name": "Melantha"
},
{
"id": "char_616_pithst",
"prof": "SUPPORT",
"subProf": "ritualist",
"name_en": "Alliance/Supportive Opertator",
"name": "盟约·辅助干员",
"alias": "mengyue·fuzhuganyuan mengyue·fuzhuganyun mengyue·fuchuganyuan mengyue·fuchuganyun mengyao·fuzhuganyuan mengyao·fuzhuganyun mengyao·fuchuganyuan mengyao·fuchuganyun my·fzgy my·fcgy 盟約·輔助幹員",
"rarity": 4,
"alt_name": "Alliance/Supportive Opertator",
"modules": ["", "X"]
},
{
"id": "char_391_rosmon",
"prof": "SNIPER",
Expand All @@ -2649,7 +2671,7 @@
"id": "token_10055_phatm2_mndclv",
"prof": "TOKEN",
"subProf": "notchar1",
"name_en": "Cage of chaos",
"name_en": "Cage of Chaos",
"name": "迷狂牢笼",
"alias": "mikuanglaolong mkll 迷狂牢籠",
"rarity": 0,
Expand Down
28 changes: 27 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useCurrentSize } from '../utils/useCurrenSize'
export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
const { isMD } = useCurrentSize()
const t = useTranslation()
const { SOCIAL_LINKS } = useLinks()
const { SOCIAL_LINKS, FRIENDLY_LINKS } = useLinks()
return (
<div className="flex flex-col md:flex-row px-4 pb-16 mt-4 md:px-8 md:mt-8 max-w-[96rem] mx-auto">
{isMD && <Ad />}
Expand Down Expand Up @@ -63,6 +63,32 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
))}
</div>

<div className="mb-4">
<div className="text-sm font-medium text-zinc-600 dark:text-slate-100 mb-2">
{t.links.friendly_links}
</div>
<div className="flex flex-wrap leading-relaxed mb-2 section-social-links">
{FRIENDLY_LINKS.map((link) => (
<a
key={link.href}
href={link.href}
target="_blank"
rel="noopener noreferrer"
className="flex items-center text-zinc-600 dark:text-slate-100 no-underline"
>
{link.icon}
<span>{link.label}</span>
</a>
)).reduce((prev, curr) => (
<>
{prev}
<div className="mx-2 opacity-50">·</div>
{curr}
</>
))}
</div>
</div>

<Ad />
</div>
</div>
Expand Down