Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | f687cf07c0 | |
Derrick Hammer | c2b0bd2813 | |
Derrick Hammer | 02fd3e558f |
|
@ -1,3 +1,5 @@
|
|||
# [0.1.0-develop.26](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.25...v0.1.0-develop.26) (2023-10-12)
|
||||
|
||||
# [0.1.0-develop.25](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.24...v0.1.0-develop.25) (2023-10-12)
|
||||
|
||||
# [0.1.0-develop.24](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.23...v0.1.0-develop.24) (2023-10-12)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.25",
|
||||
"version": "0.1.0-develop.26",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.25",
|
||||
"version": "0.1.0-develop.26",
|
||||
"dependencies": {
|
||||
"@lumeweb/kernel-network-registry-client": "0.1.0-develop.10",
|
||||
"@lumeweb/libkernel": "0.1.0-develop.65",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.25",
|
||||
"version": "0.1.0-develop.26",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
|
|
|
@ -15,8 +15,10 @@ const SYNCSTATE_TO_TEXT: Record<Network["syncState"], string> = {
|
|||
export const LumeDashboardTrigger = Dialog.Trigger;
|
||||
LumeDashboardTrigger.displayName = "LumeDashboardTrigger";
|
||||
|
||||
const LumeDashboard = ({children}: React.PropsWithChildren) => {
|
||||
const { lume: { networks } } = useLume();
|
||||
const LumeDashboard = ({ children }: React.PropsWithChildren) => {
|
||||
const {
|
||||
lume: { networks },
|
||||
} = useLume();
|
||||
|
||||
const [uniqueNetworkTypes, setUniqueNetworkTypes] = useState<string[]>([]);
|
||||
|
||||
|
@ -26,22 +28,24 @@ const LumeDashboard = ({children}: React.PropsWithChildren) => {
|
|||
setUniqueNetworkTypes(uniqueTypes);
|
||||
}, [networks]);
|
||||
|
||||
const DefaultTrigger = () => (
|
||||
const DefaultTrigger = (props: any) => (
|
||||
<LumeDashboardTrigger asChild>
|
||||
<button className="bg-primary text-primary-foreground p-2 px-4 text-sm font-semibold font-mono rounded-md">
|
||||
<button
|
||||
className="bg-primary text-primary-foreground p-2 px-4 text-sm font-semibold font-mono rounded-md"
|
||||
{...props}>
|
||||
Open Dashboard
|
||||
</button>
|
||||
</LumeDashboardTrigger>
|
||||
);
|
||||
const GivenTrigger = React.Children.toArray(children)
|
||||
.filter((c) => {
|
||||
console.log({component: c})
|
||||
if(typeof c === 'object'){
|
||||
console.log({ component: c });
|
||||
if (typeof c === "object") {
|
||||
//@ts-expect-error -- I dont know what the type of this should be, i just know that this works
|
||||
return c.type?.displayName === "LumeDashboardTrigger"
|
||||
return c.type?.displayName === "LumeDashboardTrigger";
|
||||
}
|
||||
|
||||
return false
|
||||
return false;
|
||||
})
|
||||
.at(0);
|
||||
const Trigger = GivenTrigger ? () => GivenTrigger : DefaultTrigger;
|
||||
|
|
Loading…
Reference in New Issue