Skip to content

Commit

Permalink
Tag, and change every.near with config_account
Browse files Browse the repository at this point in the history
  • Loading branch information
itexpert120 committed Apr 30, 2024
1 parent 237e8fa commit 527e04d
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 54 deletions.
17 changes: 9 additions & 8 deletions apps/every.near/widget/components.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { Avatar } = VM.require("every.near/widget/components.ui.avatar");
const { AvatarGroup } = VM.require("every.near/widget/components.ui.avatar-group");
const { Badge } = VM.require("every.near/widget/components.ui.badge");
const { Button } = VM.require("every.near/widget/components.ui.button");
const { Chip } = VM.require("every.near/widget/components.ui.chip");
const { Container } = VM.require("every.near/widget/components.ui.container");
const { Logo } = VM.require("every.near/widget/components.ui.logo");

const { Avatar } = VM.require("${config_account}/widget/components.ui.avatar");
const { AvatarGroup } = VM.require("${config_account}/widget/components.ui.avatar-group");
const { Badge } = VM.require("${config_account}/widget/components.ui.badge");
const { Button } = VM.require("${config_account}/widget/components.ui.button");
const { Chip } = VM.require("${config_account}/widget/components.ui.chip");
const { Container } = VM.require("${config_account}/widget/components.ui.container");
const { Logo } = VM.require("${config_account}/widget/components.ui.logo");
const { Tag } = VM.require("${config_account}/widget/components.ui.tag");
return {
Avatar,
AvatarGroup,
Expand All @@ -14,4 +14,5 @@ return {
Chip,
Container,
Logo,
Tag,
};
2 changes: 1 addition & 1 deletion apps/every.near/widget/components/chips.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Chip } = VM.require("every.near/widget/components") || {
const { Chip } = VM.require("${config_account}/widget/components") || {
Chip: () => <></>,
};

Expand Down
8 changes: 4 additions & 4 deletions apps/every.near/widget/components/navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { Avatar, Button, Badge, Logo } = VM.require("every.near/widget/components") || {
const { Avatar, Button, Badge, Logo } = VM.require("${config_account}/widget/components") || {
Avatar: () => <></>,
Button: () => <></>,
Badge: () => <></>,
Logo: () => <></>,
};

const { MobileRight } = VM.require("every.near/widget/components.navbar.mobile-right") || {
const { MobileRight } = VM.require("${config_account}/widget/components.navbar.mobile-right") || {
MobileRight: () => <></>,
};
const { MobileLeft } = VM.require("every.near/widget/components.navbar.mobile-left") || {
const { MobileLeft } = VM.require("${config_account}/widget/components.navbar.mobile-left") || {
MobileLeft: () => <></>,
};

Expand All @@ -35,7 +35,7 @@ const {
Sun,
UserCircle,
Video,
} = VM.require("every.near/widget/icons") || {
} = VM.require("${config_account}/widget/icons") || {
Bell: () => <></>,
Check: () => <></>,
ChevronDown: () => <></>,
Expand Down
4 changes: 2 additions & 2 deletions apps/every.near/widget/components/navbar/mobile-left.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { Badge, Button, Logo } = VM.require("every.near/widget/components") || {
const { Badge, Button, Logo } = VM.require("${config_account}/widget/components") || {
Badge: () => <></>,
Button: () => <></>,
Logo: () => <></>,
};

const { Code, Everything, LayoutTemplate, PaintRoller, PartyPopper, ShoppingCart, X, Video } =
VM.require("every.near/widget/icons") || {
VM.require("${config_account}/widget/icons") || {
Code: () => <></>,
Everything: () => <></>,
LayoutTemplate: () => <></>,
Expand Down
4 changes: 2 additions & 2 deletions apps/every.near/widget/components/navbar/mobile-right.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Avatar, Button, Logo } = VM.require("every.near/widget/components") || {
const { Avatar, Button, Logo } = VM.require("${config_account}/widget/components") || {
Avatar: () => <></>,
Button: () => <></>,
Logo: () => <></>,
Expand All @@ -17,7 +17,7 @@ const {
QRCode,
Download,
LogOut,
} = VM.require("every.near/widget/icons") || {
} = VM.require("${config_account}/widget/icons") || {
Everything: () => <></>,
X: () => <></>,
GitFork: () => <></>,
Expand Down
2 changes: 1 addition & 1 deletion apps/every.near/widget/components/ui/avatar-group.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Avatar } = VM.require("every.near/widget/components.ui.avatar") || {
const { Avatar } = VM.require("${config_account}/widget/components.ui.avatar") || {
Avatar: () => <></>,
};

Expand Down
2 changes: 1 addition & 1 deletion apps/every.near/widget/components/ui/avatar.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { User } = VM.require("every.near/widget/icons") || {
const { User } = VM.require("${config_account}/widget/icons") || {
User: () => <></>,
};

Expand Down
64 changes: 64 additions & 0 deletions apps/every.near/widget/components/ui/badge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const StyledBadge = styled.div`
background: rgba(0, 0, 0, 0.05);
color: #171717;
background: ${(props) => {
if (props.variant === "outline") {
return "white";
}
if (props.color === "black") {
return props.variant === "alpha" ? "rgba(0, 0, 0, 0.05)" : "#171717";
} else if (props.color === "blue") {
Expand All @@ -27,6 +31,19 @@ const StyledBadge = styled.div`
}};
color: ${(props) => {
if (props.variant === "outline") {
if (props.color === "black") {
return "var(--badge-alpha-black-color, #171717)";
} else if (props.color === "blue") {
return "#006ADC";
} else if (props.color === "green") {
return "#18794E";
} else if (props.color === "yellow") {
return "#35290F";
} else if (props.color === "red") {
return "#CD2B31";
}
}
if (props.color === "black") {
return props.variant === "alpha" ? "var(--badge-alpha-black-color, #171717)" : "#fff";
} else if (props.color === "blue") {
Expand All @@ -40,6 +57,53 @@ const StyledBadge = styled.div`
}
}};
border: 1px solid
${(props) => {
if (props.variant === "outline") {
if (props.color === "black") {
return "var(--badge-alpha-black-color, #171717)";
} else if (props.color === "blue") {
return "#006ADC";
} else if (props.color === "green") {
return "#18794E";
} else if (props.color === "yellow") {
return "#35290F";
} else if (props.color === "red") {
return "#CD2B31";
}
}
}};
svg,
path {
fill: ${(props) => {
if (props.variant === "outline") {
if (props.color === "black") {
return "var(--badge-alpha-black-color, #171717)";
} else if (props.color === "blue") {
return "#006ADC";
} else if (props.color === "green") {
return "#18794E";
} else if (props.color === "yellow") {
return "#35290F";
} else if (props.color === "red") {
return "#CD2B31";
}
}
if (props.color === "black") {
return props.variant === "alpha" ? "var(--badge-alpha-black-color, #171717)" : "#fff";
} else if (props.color === "blue") {
return props.variant === "alpha" ? "#006ADC" : "#fff";
} else if (props.color === "green") {
return props.variant === "alpha" ? "#18794E" : "#fff";
} else if (props.color === "yellow") {
return props.variant === "alpha" ? "#35290F" : "#fff";
} else if (props.color === "red") {
return props.variant === "alpha" ? "#CD2B31" : "#fff";
}
}};
}
font-family: Poppins, sans-serif;
font-size: 14px;
font-weight: 500;
Expand Down
2 changes: 1 addition & 1 deletion apps/every.near/widget/components/ui/chip.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Plus, X } = VM.require("every.near/widget/icons") || {
const { Plus, X } = VM.require("${config_account}/widget/icons") || {
Plus: () => <></>,
X: () => <></>,
};
Expand Down
6 changes: 3 additions & 3 deletions apps/every.near/widget/components/ui/library.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Avatar, AvatarGroup, Button, Badge, Container } = VM.require(
"every.near/widget/components"
"${config_account}/widget/components"
) || {
Avatar: () => <></>,
AvatarGroup: () => <></>,
Expand Down Expand Up @@ -210,15 +210,15 @@ return (
<h2>Chips</h2>
<h3>Single</h3>
<Widget
src="every.near/widget/components.chips"
src="${config_account}/widget/components.chips"
props={{
items: badgeColors,
onSelect: (selected) => setSelected(selected),
}}
/>
<h3>Multiple</h3>
<Widget
src="every.near/widget/components.chips"
src="${config_account}/widget/components.chips"
props={{
items: badgeColors,
onSelect: (selected) => setSelected(selected),
Expand Down
2 changes: 1 addition & 1 deletion apps/every.near/widget/components/ui/logo.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Everything } = VM.require("every.near/widget/icons") || {
const { Everything } = VM.require("${config_account}/widget/icons") || {
Everything: () => <></>,
};

Expand Down
24 changes: 24 additions & 0 deletions apps/every.near/widget/components/ui/tag.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { X } = VM.require("${config_account}/widget/icons") || {
X: () => <></>,
};

const { Badge } = VM.require("${config_account}/widget/components") || {
Badge: () => <></>,
};

const Tag = ({ children, size, variant, color, ...restProps }) => {
return (
<Badge
size={size}
variant={variant === "soft" ? "alpha" : variant}
color={color ?? "gray"}
{...restProps}
style={{ cursor: "pointer" }}
>
{children}
<X />
</Badge>
);
};

return { Tag };
50 changes: 25 additions & 25 deletions apps/every.near/widget/icons.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
const { Bell } = VM.require("every.near/widget/icons.bell");
const { Check } = VM.require("every.near/widget/icons.check");
const { ChevronDown } = VM.require("every.near/widget/icons.chevron-down");
const { ChevronUp } = VM.require("every.near/widget/icons.chevron-up");
const { Code } = VM.require("every.near/widget/icons.code");
const { Download } = VM.require("every.near/widget/icons.download");
const { Everything } = VM.require("every.near/widget/icons.everything");
const { FileCode } = VM.require("every.near/widget/icons.file-code");
const { GitFork } = VM.require("every.near/widget/icons.git-fork");
const { Grip } = VM.require("every.near/widget/icons.grip");
const { History } = VM.require("every.near/widget/icons.history");
const { LayoutTemplate } = VM.require("every.near/widget/icons.layout-template");
const { LogOut } = VM.require("every.near/widget/icons.log-out");
const { Menu } = VM.require("every.near/widget/icons.menu");
const { Moon } = VM.require("every.near/widget/icons.moon");
const { PaintRoller } = VM.require("every.near/widget/icons.paint-roller");
const { PartyPopper } = VM.require("every.near/widget/icons.party-popper");
const { Plus } = VM.require("every.near/widget/icons.plus");
const { QRCode } = VM.require("every.near/widget/icons.qr-code");
const { ShoppingCart } = VM.require("every.near/widget/icons.shopping-cart");
const { Sun } = VM.require("every.near/widget/icons.sun");
const { UserCircle } = VM.require("every.near/widget/icons.user-circle");
const { User } = VM.require("every.near/widget/icons.user");
const { Video } = VM.require("every.near/widget/icons.video");
const { X } = VM.require("every.near/widget/icons.x");
const { Bell } = VM.require("${config_account}/widget/icons.bell");
const { Check } = VM.require("${config_account}/widget/icons.check");
const { ChevronDown } = VM.require("${config_account}/widget/icons.chevron-down");
const { ChevronUp } = VM.require("${config_account}/widget/icons.chevron-up");
const { Code } = VM.require("${config_account}/widget/icons.code");
const { Download } = VM.require("${config_account}/widget/icons.download");
const { Everything } = VM.require("${config_account}/widget/icons.everything");
const { FileCode } = VM.require("${config_account}/widget/icons.file-code");
const { GitFork } = VM.require("${config_account}/widget/icons.git-fork");
const { Grip } = VM.require("${config_account}/widget/icons.grip");
const { History } = VM.require("${config_account}/widget/icons.history");
const { LayoutTemplate } = VM.require("${config_account}/widget/icons.layout-template");
const { LogOut } = VM.require("${config_account}/widget/icons.log-out");
const { Menu } = VM.require("${config_account}/widget/icons.menu");
const { Moon } = VM.require("${config_account}/widget/icons.moon");
const { PaintRoller } = VM.require("${config_account}/widget/icons.paint-roller");
const { PartyPopper } = VM.require("${config_account}/widget/icons.party-popper");
const { Plus } = VM.require("${config_account}/widget/icons.plus");
const { QRCode } = VM.require("${config_account}/widget/icons.qr-code");
const { ShoppingCart } = VM.require("${config_account}/widget/icons.shopping-cart");
const { Sun } = VM.require("${config_account}/widget/icons.sun");
const { UserCircle } = VM.require("${config_account}/widget/icons.user-circle");
const { User } = VM.require("${config_account}/widget/icons.user");
const { Video } = VM.require("${config_account}/widget/icons.video");
const { X } = VM.require("${config_account}/widget/icons.x");

return {
Bell,
Expand Down
6 changes: 3 additions & 3 deletions apps/every.near/widget/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const widgets = {
navbar: "every.near/widget/components.navbar",
navbar: "${config_account}/widget/components.navbar",
};

const config = {
Expand All @@ -23,7 +23,7 @@ const config = {
param: "page",
routes: {
home: {
path: "every.near/widget/page.home",
path: "${config_account}/widget/page.home",
blockHeight: "final",
init: {
name: "Home",
Expand Down Expand Up @@ -144,6 +144,6 @@ const Root = styled.div`

return (
<Root>
<Widget src="every.near/widget/app.view" props={{ config, ...props }} />
<Widget src="${config_account}/widget/app.view" props={{ config, ...props }} />
</Root>
);
4 changes: 2 additions & 2 deletions apps/every.near/widget/page/home.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { Container } = VM.require("every.near/widget/components") || {
const { Container } = VM.require("${config_account}/widget/components") || {
Container: () => <></>,
};

return (
<Container>
<Widget src="every.near/widget/components.ui.library" loading="" />
<Widget src="${config_account}/widget/components.ui.library" loading="" />
</Container>
);

0 comments on commit 527e04d

Please sign in to comment.