Skip to content

Commit

Permalink
Move Panel outside of api package
Browse files Browse the repository at this point in the history
  • Loading branch information
JD557 committed May 18, 2024
1 parent 0795b22 commit 4d65cc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 13 additions & 0 deletions core/shared/src/main/scala/eu/joaocosta/interim/Panel.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package eu.joaocosta.interim

trait Panel[I, F[_]]:
def render[T](area: Ref[PanelState[Rect]], body: I => T): Component[F[T]]

def apply[T](area: Ref[PanelState[Rect]])(body: I => T): Component[F[T]] =
render(area, body)

def apply[T](area: PanelState[Rect])(body: I => T): Component[F[T]] =
render(Ref(area), body)

def apply[T](area: Rect)(body: I => T): Component[F[T]] =
render(Ref(PanelState.open(area)), body)
12 changes: 0 additions & 12 deletions core/shared/src/main/scala/eu/joaocosta/interim/api/Panels.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ object Panels extends Panels

trait Panels:

trait Panel[I, F[_]]:
def render[T](area: Ref[PanelState[Rect]], body: I => T): Component[F[T]]

def apply[T](area: Ref[PanelState[Rect]])(body: I => T): Component[F[T]] =
render(area, body)

def apply[T](area: PanelState[Rect])(body: I => T): Component[F[T]] =
render(Ref(area), body)

def apply[T](area: Rect)(body: I => T): Component[F[T]] =
render(Ref(PanelState.open(area)), body)

/** Window with a title.
*
* @param title of this window
Expand Down

0 comments on commit 4d65cc5

Please sign in to comment.