-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split up combo editor into the teammate view
- Loading branch information
Showing
12 changed files
with
295 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useCallback, useRef } from 'react' | ||
|
||
export function useScrollRef() { | ||
const scrollRef = useRef<HTMLElement>() | ||
const onScroll = useCallback( | ||
() => scrollRef.current?.scrollIntoView({ behavior: 'smooth' }), | ||
[scrollRef] | ||
) | ||
return [scrollRef, onScroll] as const | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { own } from '@genshin-optimizer/sr/formula' | ||
import { useSrCalcContext } from '@genshin-optimizer/sr/ui' | ||
import type { ReactNode } from 'react' | ||
|
||
export function SuperImposeWrapper({ | ||
children, | ||
}: { | ||
children: (superimpose: number) => ReactNode | ||
}) { | ||
const calc = useSrCalcContext() | ||
const superimpose = calc?.compute(own.lightCone.superimpose).val ?? 1 | ||
// const calc = useSrCalcContext() | ||
|
||
// TODO: FIXME: a character without a lightcone will cause an error | ||
const superimpose = 1 // calc?.compute(own.lightCone.superimpose).val ?? 1 | ||
return children(superimpose) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.