mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-30 02:24:42 +08:00
update: rename component
This commit is contained in:
@@ -4,7 +4,7 @@ import { useStep, Step } from '@remake/hooks'
|
|||||||
import Home from '@/containers/Home'
|
import Home from '@/containers/Home'
|
||||||
import Mode from '@/containers/Mode'
|
import Mode from '@/containers/Mode'
|
||||||
import Chara from '@/containers/Chara'
|
import Chara from '@/containers/Chara'
|
||||||
import Pick from '@/containers/TalentPick'
|
import Pick from '@/containers/Pick'
|
||||||
import Alloc from '@/containers/Alloc'
|
import Alloc from '@/containers/Alloc'
|
||||||
import Play from '@/containers/Play'
|
import Play from '@/containers/Play'
|
||||||
import Summary from '@/containers/Summary'
|
import Summary from '@/containers/Summary'
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
import { type Talent, talents } from '@remake/data'
|
import { type Talent as T, talents } from '@remake/data'
|
||||||
import TalentComponent from './Talent'
|
import Talent from './Talent'
|
||||||
import './Replaced.css'
|
import './Replaced.css'
|
||||||
|
|
||||||
export interface TalentProps {
|
export interface TalentProps {
|
||||||
id: Talent['id']
|
id: T['id']
|
||||||
chains?: Talent['id'][]
|
chains?: T['id'][]
|
||||||
}
|
}
|
||||||
export function Replaced({ id, chains }: TalentProps) {
|
export function Replaced({ id, chains }: TalentProps) {
|
||||||
return (
|
return (
|
||||||
<ul className="replaced">
|
<ul className="replaced">
|
||||||
<li>
|
<li>
|
||||||
<TalentComponent id={id} selected={true} />
|
<Talent id={id} selected={true} />
|
||||||
</li>
|
</li>
|
||||||
{chains?.map(id => {
|
{chains?.map(id => {
|
||||||
const talent = talents.get(id)
|
const talent = talents.get(id)
|
||||||
if (!talent) return null
|
if (!talent) return null
|
||||||
return (
|
return (
|
||||||
<li key={id}>
|
<li key={id}>
|
||||||
<TalentComponent id={id} selected={false} />
|
<Talent id={id} selected={false} />
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { type Talent, talents } from '@remake/data'
|
import { type Talent as T, talents } from '@remake/data'
|
||||||
import './Talent.css'
|
import './Talent.css'
|
||||||
|
|
||||||
export interface TalentProps {
|
export interface TalentProps {
|
||||||
id: Talent['id']
|
id: T['id']
|
||||||
selected?: boolean
|
selected?: boolean
|
||||||
}
|
}
|
||||||
export function TalentComponent({ id, selected }: TalentProps) {
|
export function Talent({ id, selected }: TalentProps) {
|
||||||
const talent = talents.get(id)
|
const talent = talents.get(id)
|
||||||
if (!talent) return null
|
if (!talent) return null
|
||||||
const grade = talent?.grade ?? 0
|
const grade = talent?.grade ?? 0
|
||||||
@@ -17,4 +17,4 @@ export function TalentComponent({ id, selected }: TalentProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TalentComponent
|
export default Talent
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
> .chara-list {
|
> .chara-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: calc(0.5rem * var(--ratio));
|
||||||
> .character {
|
> .character {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useCharaPuller, useCharaPicker, useCharaSubmit } from '@remake/hooks'
|
import { useCharaPuller, useCharaPicker, useCharaSubmit } from '@remake/hooks'
|
||||||
import { useUnique, useUniqueGenerator, convertProps } from '@remake/hooks'
|
import { useUnique, useUniqueGenerator, convertProps } from '@remake/hooks'
|
||||||
import type { BaseChara } from '@remake/hooks'
|
import type { BaseChara } from '@remake/hooks'
|
||||||
import { TalentComponent } from '@/components/Talent'
|
|
||||||
import { judgeGradeByValue } from '@/config'
|
import { judgeGradeByValue } from '@/config'
|
||||||
import { characters } from '@remake/data'
|
import { characters } from '@remake/data'
|
||||||
import { properties } from '@/display'
|
import { properties } from '@/display'
|
||||||
import { keys } from '@remake/vitex'
|
import { keys } from '@remake/vitex'
|
||||||
|
import Talent from '@/components/Talent'
|
||||||
import './Chara.css'
|
import './Chara.css'
|
||||||
|
|
||||||
function Details({ detail }: { detail: BaseChara }) {
|
function Details({ detail }: { detail: BaseChara }) {
|
||||||
@@ -26,7 +26,7 @@ function Details({ detail }: { detail: BaseChara }) {
|
|||||||
<ul className="talent-list">
|
<ul className="talent-list">
|
||||||
{detail.talent.map(id => (
|
{detail.talent.map(id => (
|
||||||
<li key={id}>
|
<li key={id}>
|
||||||
<TalentComponent id={id} />
|
<Talent id={id} />
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useRemake, useFeatures, useGoAchv, useGoThanks } from '@remake/hooks'
|
import { useRemake, useFeatures, useGoAchv, useGoThanks } from '@remake/hooks'
|
||||||
import { TextSvg } from '@/components/TextSvg'
|
import { TextSvg } from '@/components/TextSvg'
|
||||||
import { ThemeToggle } from '@/components/ThemeToggle'
|
import ThemeToggle from '@/components/ThemeToggle'
|
||||||
import './Home.css'
|
import './Home.css'
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
// import { useEffect } from 'react'
|
|
||||||
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
|
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
|
||||||
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
|
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
|
||||||
import { PullCount, dev } from '@/config'
|
import { PullCount, dev } from '@/config'
|
||||||
import TalentComponent from '@/components/Talent'
|
import Talent from '@/components/Talent'
|
||||||
import './TalentPick.css'
|
import './Pick.css'
|
||||||
|
|
||||||
export default function TalentPick() {
|
export function Pick() {
|
||||||
const [pulled, puller] = useTalentPuller()
|
const [pulled, puller] = useTalentPuller()
|
||||||
const [talents, picker] = useTalentPicker()
|
const [talents, picker] = useTalentPicker()
|
||||||
const { enabled, min, max } = useSubmitIsEnable()
|
const { enabled, min, max } = useSubmitIsEnable()
|
||||||
@@ -30,7 +29,7 @@ export default function TalentPick() {
|
|||||||
<ul className="talent-list">
|
<ul className="talent-list">
|
||||||
{ps.map(id => (
|
{ps.map(id => (
|
||||||
<li key={id} onClick={() => picker(id)}>
|
<li key={id} onClick={() => picker(id)}>
|
||||||
<TalentComponent id={id} selected={talents.has(id)} />
|
<Talent id={id} selected={talents.has(id)} />
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -46,3 +45,4 @@ export default function TalentPick() {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
export default Pick
|
||||||
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react'
|
|||||||
import { usePicked, useEnd, useProfile, useIsClassic } from '@remake/hooks'
|
import { usePicked, useEnd, useProfile, useIsClassic } from '@remake/hooks'
|
||||||
import { useEndJudge } from '@/hooks/judge'
|
import { useEndJudge } from '@/hooks/judge'
|
||||||
import { properties, judgeDisplay } from '@/display'
|
import { properties, judgeDisplay } from '@/display'
|
||||||
import TalentComponent from '@/components/Talent'
|
import Talent from '@/components/Talent'
|
||||||
import './Summary.css'
|
import './Summary.css'
|
||||||
|
|
||||||
function Judges() {
|
function Judges() {
|
||||||
@@ -44,7 +44,7 @@ function TalentList({ picked, picker }: TalentListProps) {
|
|||||||
<ul className="talent-list">
|
<ul className="talent-list">
|
||||||
{Array.from(talents, id => (
|
{Array.from(talents, id => (
|
||||||
<li key={id} onClick={() => picker(id)}>
|
<li key={id} onClick={() => picker(id)}>
|
||||||
<TalentComponent id={id} selected={picked.has(id)} />
|
<Talent id={id} selected={picked.has(id)} />
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user