-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* inspector: use babel for m1 * feature: panel layout * chore: componentize * feat:error handling, LOC + kb * chore: cleanup * chore: font loading, tweak on debug mode
- Loading branch information
Showing
31 changed files
with
3,846 additions
and
331 deletions.
There are no files selected for viewing
Submodule forge-std
updated
from d76af3 to 0d0485
Submodule solmate
updated
from 1681dc to a90209
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,3 @@ | ||
{ | ||
"presets": ["next/babel"] | ||
} |
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,27 @@ | ||
import { ButtonProps } from "../types"; | ||
import classnames from "classnames"; | ||
|
||
export function Button(props: ButtonProps) { | ||
const cns = classnames({ | ||
"bg-primary": props.primary, | ||
"bg-white/20" : !props.primary, | ||
"shadow-none opacity-50 pointer-events-none": props.disabled, | ||
"shadow-elevation-low": !props.disabled, | ||
}) | ||
return ( | ||
<button | ||
type="button" | ||
className={`transition-opacity user-select-none px-2 py-0.5 border border-white/10 text-white rounded-lg ${cns} ${props.className}`} | ||
onClick={props.onClick} | ||
> | ||
{props.children} | ||
</button> | ||
); | ||
} | ||
|
||
Button.defaultProps = { | ||
primary: false, | ||
className: "", | ||
children: null, | ||
disabled: false, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import Div100vh from "react-div-100vh"; | ||
import { GenericComponentProps } from "../types"; | ||
|
||
export function Container(props: GenericComponentProps) { | ||
return ( | ||
<Div100vh className={`relative w-full flex h-full ${props.className}`}> | ||
{props.children} | ||
</Div100vh> | ||
); | ||
} | ||
|
||
Container.defaultProps = { | ||
className: "", | ||
children: null, | ||
}; |
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,7 @@ | ||
export function HorizontalRule(props: { className?: string }) { | ||
return <div className={`w-full border-t border-t-black ${props.className}`} />; | ||
} | ||
|
||
HorizontalRule.defaultProps = { | ||
className: "", | ||
}; |
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,27 @@ | ||
import { NFTState } from "../types"; | ||
|
||
type ImageViewerProps = { | ||
debug?: boolean; | ||
className?: string; | ||
rawSVG: string; | ||
metadata: NFTState["metadata"]; | ||
}; | ||
|
||
export function ImageViewer(props: ImageViewerProps) { | ||
return ( | ||
<div | ||
className={`rounded-3xl shadow-elevation-medium relative h-full w-auto overflow-hidden ${props.className}`} | ||
> | ||
<img | ||
src={props.metadata.image} | ||
className={`rounded-3xl w-full h-auto ${props.debug ? "debug-svg" : ""}`} | ||
/> | ||
<div className="rounded-3xl z-10 absolute content-none top-0 left-0 right-0 bottom-0 border border-white/10" /> | ||
</div> | ||
); | ||
} | ||
|
||
ImageViewer.defaultProps = { | ||
debug: false, | ||
className: "", | ||
}; |
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,16 @@ | ||
import { GenericComponentProps } from "../types"; | ||
|
||
export function Pane(props: GenericComponentProps) { | ||
return ( | ||
<section | ||
className={`bg-background w-full h-full flex flex-col overflow-y-scroll overflow-x-hidden ${props.className}`} | ||
> | ||
{props.children} | ||
</section> | ||
); | ||
} | ||
|
||
Pane.defaultProps = { | ||
className: "", | ||
children: null, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
type RawSVGViewerProps = { | ||
debug?: boolean; | ||
className?: string; | ||
rawSVG: string; | ||
isLoading?: boolean; | ||
}; | ||
|
||
export function RawSVGViewer(props: RawSVGViewerProps) { | ||
return ( | ||
<div | ||
className={`rounded-3xl shadow-elevation-medium relative h-full w-auto bg-white/5 ${props.className}`} | ||
> | ||
<div | ||
className={`rounded-3xl h-full w-auto overflow-hidden transition-opacity duration-300 ${props.isLoading ? 'opacity-0' : 'opacity-100'} ${props.debug ? "debug-svg" : ""}`} | ||
dangerouslySetInnerHTML={{ __html: props.rawSVG }} | ||
/> | ||
<div className={`rounded-3xl z-90 absolute content-none top-0 left-0 right-0 bottom-0 ${props.debug ? 'inner-shadow-border-debug':"inner-shadow-border"}`} /> | ||
</div> | ||
); | ||
} | ||
|
||
RawSVGViewer.defaultProps = { | ||
debug: false, | ||
className: "", | ||
}; |
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,21 @@ | ||
import { ButtonProps } from "../types"; | ||
|
||
export function ToggleButton(props: ButtonProps & { isOn: boolean }) { | ||
return ( | ||
<button | ||
type="button" | ||
className="px-2 py-0.5 bg-white/20 border border-white/5 text-white rounded-lg flex items-center justify-center gap-x-1.5 shadow-elevation-low " | ||
onClick={props.onClick} | ||
> | ||
<div className={`transition-all user-select-none w-2 h-2 rounded-full ${props.isOn ? "bg-white shadow-glow" : "bg-white/20 shadow-none"}`} /> | ||
{props.children} | ||
</button> | ||
); | ||
} | ||
|
||
ToggleButton.defaultProps = { | ||
primary: false, | ||
className: "", | ||
children: null, | ||
isOn: false, | ||
}; |
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,14 @@ | ||
import { GenericComponentProps } from "../types"; | ||
|
||
export function Toolbar(props: GenericComponentProps) { | ||
return ( | ||
<span className={`w-full bg-white/5 flex h-14 min-h-12 items-center px-3 flex-shrink-0 gap-x-2 ${props.className}`}> | ||
{props.children} | ||
</span> | ||
); | ||
} | ||
|
||
Toolbar.defaultProps = { | ||
className: "", | ||
children: null, | ||
}; |
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,28 @@ | ||
import { trait } from "../types"; | ||
import { isOdd } from "../util"; | ||
|
||
export const TraitsTable = ({ | ||
name, | ||
loading, | ||
tokenId, | ||
attributes, | ||
}: { | ||
name: string; | ||
loading: boolean; | ||
tokenId: number; | ||
attributes: trait[]; | ||
}) => { | ||
const Loading = () => "loading"; | ||
return ( | ||
<div className="flex w-full flex-col"> | ||
<span className="w-full px-8 py-2 text-white font-bold bg-white/5">{name}</span> | ||
|
||
{attributes.map(({ trait_type, value }, i) => ( | ||
<span className={`w-full flex ${isOdd(i) ? "bg-white/5" : "bg-white/10"}`}> | ||
<span className="w-full px-8 py-1 text-white text-sm">{trait_type}</span> | ||
<span className="w-full px-8 py-1 text-primary text-sm font-medium">{value}</span> | ||
</span> | ||
))} | ||
</div> | ||
); | ||
}; |
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,7 @@ | ||
export function VerticalRule(props: { className?: string }) { | ||
return <div className={`border-l border-l-black ${props.className}`} />; | ||
} | ||
|
||
VerticalRule.defaultProps = { | ||
className: "", | ||
}; |
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.