mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-21 13:39:30 -07:00
refactor: reduce amount of createEffect and improve imports (#284)
* refactor: update import syntax * feat: add GalleryImage component for simplicity * refactor: replace createEffect in GalleryNav with createMemo * refactor: refactor Gallery component logic and improve imports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createSignal, onCleanup, onMount, type Accessor, type JSX } from 'solid-js'
|
||||
|
||||
export function CustomCursor(props: {
|
||||
export default function CustomCursor(props: {
|
||||
children?: JSX.Element
|
||||
active: Accessor<boolean>
|
||||
cursorText: Accessor<string>
|
||||
|
||||
@@ -4,10 +4,10 @@ import { Show, createMemo, createSignal, type JSX } from 'solid-js'
|
||||
import type { ImageJSON } from '../resources'
|
||||
import type { Vector } from '../utils'
|
||||
|
||||
import { CustomCursor } from './customCursor'
|
||||
import { Nav } from './nav'
|
||||
import { Stage } from './stage'
|
||||
import { StageNav } from './stageNav'
|
||||
import CustomCursor from './customCursor'
|
||||
import Nav from './nav'
|
||||
import Stage from './stage'
|
||||
import StageNav from './stageNav'
|
||||
|
||||
/**
|
||||
* interfaces and types
|
||||
|
||||
@@ -51,7 +51,7 @@ function updateIndexText(indexValue: string, indexLength: string): void {
|
||||
* Nav component
|
||||
*/
|
||||
|
||||
export function Nav(): null {
|
||||
export default function Nav(): null {
|
||||
const [state, { incThreshold, decThreshold }] = useState()
|
||||
|
||||
createEffect(() => {
|
||||
|
||||
@@ -90,7 +90,7 @@ function onMutation<T extends HTMLElement>(
|
||||
* Stage component
|
||||
*/
|
||||
|
||||
export function Stage(props: {
|
||||
export default function Stage(props: {
|
||||
ijs: ImageJSON[]
|
||||
setIsLoading: Setter<boolean>
|
||||
isOpen: Accessor<boolean>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { decrement, increment, type Vector } from '../utils'
|
||||
|
||||
import type { HistoryItem } from './layout'
|
||||
|
||||
export function StageNav(props: {
|
||||
export default function StageNav(props: {
|
||||
children?: JSX.Element
|
||||
prevText: string
|
||||
closeText: string
|
||||
|
||||
Reference in New Issue
Block a user