diff --git a/apps/web/src/containers/Alloc.tsx b/apps/web/src/containers/Alloc.tsx
index e8649d9..75b3872 100644
--- a/apps/web/src/containers/Alloc.tsx
+++ b/apps/web/src/containers/Alloc.tsx
@@ -6,6 +6,7 @@ import { properties } from '@/display'
import { keys } from '@remake/vitex'
import { judgeGradeByValue } from '@/config'
import { talents } from '@remake/data'
+import { toastAchvs, toastMsg } from '@/toast'
import Replaced from '@/components/Replaced'
import './Alloc.css'
@@ -65,12 +66,9 @@ export function Alloc() {
const start = useStart()
const [showDetail, setShowDetail] = useState(false)
const handleNext = () => {
- if (left != 0) {
- // TODO: Show a warning that there are still points left
- return
- }
+ if (left != 0) return toastMsg('还有剩余点数未分配', 'alloc-toast')
const achievements = start()
- // TODO: Show achievements
+ toastAchvs(achievements)
console.log('Achievements', achievements)
}
return (
diff --git a/apps/web/src/containers/Chara.tsx b/apps/web/src/containers/Chara.tsx
index 64dde0e..0a10230 100644
--- a/apps/web/src/containers/Chara.tsx
+++ b/apps/web/src/containers/Chara.tsx
@@ -5,6 +5,7 @@ import { judgeGradeByValue } from '@/config'
import { characters } from '@remake/data'
import { properties } from '@/display'
import { keys } from '@remake/vitex'
+import { toastMsg } from '@/toast'
import Talent from '@/components/Talent'
import './Chara.css'
@@ -89,6 +90,11 @@ export function Chara() {
const [{ unique, characters }, puller] = useCharaPuller()
const [picked, picker] = useCharaPicker()
const submit = useCharaSubmit()
+ const handleSubmit = () => {
+ if (ready) return submit(picked)
+ if (!picked) toastMsg('请先选择角色', 'chara-toast-pick')
+ else toastMsg('请先生成唯一角色', 'chara-toast-unique')
+ }
const ready = picked && (picked.type === 'unique' ? !!u : true)
return (
@@ -114,7 +120,7 @@ export function Chara() {
diff --git a/apps/web/src/containers/Home.css b/apps/web/src/containers/Home.css
index d6c2e4a..eb133b4 100644
--- a/apps/web/src/containers/Home.css
+++ b/apps/web/src/containers/Home.css
@@ -14,8 +14,7 @@
width: auto;
display: flex;
gap: 1rem;
- >.github-btn,
- >.theme-toggle-btn {
+ >button {
width: 2.5rem;
height: 2.5rem;
padding: 0.25rem;
diff --git a/apps/web/src/containers/Pick.tsx b/apps/web/src/containers/Pick.tsx
index 51e4fee..0f38702 100644
--- a/apps/web/src/containers/Pick.tsx
+++ b/apps/web/src/containers/Pick.tsx
@@ -1,6 +1,7 @@
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
import { PullCount, dev } from '@/config'
+import { toastMsg } from '@/toast'
import Talent from '@/components/Talent'
import './Pick.css'
@@ -9,7 +10,13 @@ export function Pick() {
const [talents, picker] = useTalentPicker()
const { enabled, min, max } = useSubmitIsEnable()
const submit = useTalentSubmit()
- // useEffect(puller, [])
+ const msg = enabled
+ ? '下一步'
+ : `请选取 ${min == max ? min : `${min}~${max}`} 个天赋`
+ const handleSubmit = () => {
+ if (enabled) return submit()
+ toastMsg(msg, 'pick-toast')
+ }
if (!pulled)
return (
@@ -33,15 +40,12 @@ export function Pick() {
))}
- {enabled ? (
-
- ) : (
-
- )}
+
)
}
diff --git a/apps/web/src/containers/Play.tsx b/apps/web/src/containers/Play.tsx
index 2b4d3bd..d037e64 100644
--- a/apps/web/src/containers/Play.tsx
+++ b/apps/web/src/containers/Play.tsx
@@ -6,6 +6,7 @@ import { achievements, events, talents } from '@remake/data'
import { properties } from '@/display'
import { AutoInterval } from '@/config'
import { format } from '@remake/vitex'
+import { toastAchvs } from '@/toast/Achv'
import './Play.css'
function LogTalent({ id }: { id: number }) {
@@ -153,13 +154,13 @@ export function Play() {
const handleNext = useCallback(() => {
if (ended) return
const achievements = next()
- // TODO: Show achievements
+ toastAchvs(achievements)
console.debug('Achievements:', achievements)
}, [ended, next])
const handleGotoSummary = useCallback(() => {
if (!ended) return
const achievements = gotoSummary()
- // TODO: Show achievements
+ toastAchvs(achievements)
console.debug('Achievements:', achievements)
}, [ended, gotoSummary])
useLayoutEffect(() => {
diff --git a/apps/web/src/containers/Summary.tsx b/apps/web/src/containers/Summary.tsx
index d2f402d..9bdab04 100644
--- a/apps/web/src/containers/Summary.tsx
+++ b/apps/web/src/containers/Summary.tsx
@@ -2,6 +2,7 @@ import { useEffect, useRef } from 'react'
import { usePicked, useEnd, useProfile, useIsClassic } from '@remake/hooks'
import { useEndJudge } from '@/hooks/judge'
import { properties, judgeDisplay } from '@/display'
+import { toastAchvs, toastMsg } from '@/toast'
import Talent from '@/components/Talent'
import './Summary.css'
@@ -54,9 +55,13 @@ function TalentList({ picked, picker }: TalentListProps) {
export default function Summary() {
const isClassic = useIsClassic()
const [locked, picker, end] = useEnd()
+ const handlePicker = (id: number) => {
+ if (isClassic) picker(id)
+ else toastMsg('名人天赋不可锁定', 'summary-toast')
+ }
const handleEnd = () => {
const achievements = end()
- // TODO: Show achievements
+ toastAchvs(achievements)
console.log('Achievements', achievements)
}
return (
@@ -68,7 +73,7 @@ export default function Summary() {
? '你可以锁定一个天赋,下辈子还能抽到'
: '名人天赋不可锁定'}