Skip to content

Commit

Permalink
new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
kof committed Jan 20, 2025
1 parent 0fbef26 commit 872394b
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 146 deletions.
6 changes: 3 additions & 3 deletions apps/builder/app/builder/features/help/help-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
GithubIcon,
LifeBuoyIcon,
PageIcon,
Youtube1cIcon,
YoutubeIcon,
} from "@webstudio-is/icons";
import { type ComponentProps } from "react";
import { $remoteDialog } from "../../shared/nano-states";
Expand Down Expand Up @@ -61,7 +61,7 @@ export const HelpCenter = ({
formAction="https://wstd.us/101"
name="list"
value="PL4vVqpngzeT4sDlanyPe99dYl8BgUYCac"
prefix={<Youtube1cIcon fill="currentColor" />}
prefix={<YoutubeIcon />}
color="ghost"
css={{ justifyContent: "start" }}
>
Expand All @@ -77,7 +77,7 @@ export const HelpCenter = ({
</Button>
<Button
formAction="https://wstd.us/community"
prefix={<DiscordIcon fill="currentColor" />}
prefix={<DiscordIcon />}
color="ghost"
css={{ justifyContent: "start" }}
>
Expand Down
154 changes: 103 additions & 51 deletions apps/builder/app/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
forwardRef,
useEffect,
useState,
type ComponentProps,
type ReactNode,
} from "react";
import {
Flex,
Separator,
List,
ListItem,
Text,
TooltipProvider,
css,
Expand All @@ -27,9 +29,10 @@ import {
DiscordIcon,
ExtensionIcon,
LifeBuoyIcon,
Youtube1cIcon,
YoutubeIcon,
} from "@webstudio-is/icons";
import { Header } from "./shared/header";
import { CollapsibleSection } from "~/builder/shared/collapsible-section";

const globalStyles = globalCss({
html: {
Expand Down Expand Up @@ -125,23 +128,62 @@ const sidebarLinkStyle = css({
},
});

const SidebarLink = ({
to,
prefix,
children,
target,
}: {
prefix: ReactNode;
children: string;
to: string;
target?: string;
}) => {
const SidebarLink = forwardRef<
HTMLAnchorElement,
{
prefix: ReactNode;
children: string;
to: string;
target?: string;
}
>(({ to, prefix, children, target }, forwardedRef) => {
return (
<NavLink to={to} end target={target} className={sidebarLinkStyle()}>
<NavLink
to={to}
end
target={target}
className={sidebarLinkStyle()}
ref={forwardedRef}
>
{prefix}
<Text variant="labelsSentenceCase">{children}</Text>
<Text variant="labelsSentenceCase" color="main">
{children}
</Text>
</NavLink>
);
});

const NavigationItems = ({
items,
}: {
items: Array<{
to: string;
prefix: ReactNode;
children: string;
target?: string;
}>;
}) => {
return (
<List style={{ padding: 0, margin: 0 }}>
{items.map((item) => {
return (
<ListItem asChild>
<NavLink
to={item.to}
end
target={item.target}
className={sidebarLinkStyle()}
>
{item.prefix}
<Text variant="labelsSentenceCase" color="main">
{item.children}
</Text>
</NavLink>
</ListItem>
);
})}
</List>
);
};

export const Dashboard = ({
Expand Down Expand Up @@ -169,43 +211,53 @@ export const Dashboard = ({
<Header variant="aside">
<ProfileMenu user={user} userPlanFeatures={userPlanFeatures} />
</Header>

<nav>
<SidebarLink to="/dashboard" prefix={<BodyIcon />}>
Projects
</SidebarLink>
<SidebarLink to="/dashboard/templates" prefix={<ExtensionIcon />}>
Starter templates
</SidebarLink>
<Separator css={{ marginBlock: theme.spacing[5] }} />
<SidebarLink
to="https://wstd.us/101"
target="_blank"
prefix={<Youtube1cIcon fill="black" />}
>
Video tutorials
</SidebarLink>
<SidebarLink
to="https://help.webstudio.is/"
target="_blank"
prefix={<LifeBuoyIcon />}
>
Support hub
</SidebarLink>
<SidebarLink
to="https://docs.webstudio.is"
target="_blank"
prefix={<ContentIcon />}
>
Docs
</SidebarLink>
<SidebarLink
to="https://wstd.us/community"
target="_blank"
prefix={<DiscordIcon fill="black" />}
>
Community
</SidebarLink>
<CollapsibleSection label="Workspace" fullWidth>
<NavigationItems
items={[
{
to: "/dashboard",
prefix: <BodyIcon />,
children: "Projects",
},
{
to: "/dashboard/templates",
prefix: <ExtensionIcon />,
children: "Starter templates",
},
]}
/>
</CollapsibleSection>
<CollapsibleSection label="Help & support" fullWidth>
<NavigationItems
items={[
{
to: "https://wstd.us/101",
target: "_blank",
prefix: <YoutubeIcon />,
children: "Video tutorials",
},
{
to: "https://help.webstudio.is/",
target: "_blank",
prefix: <LifeBuoyIcon />,
children: "Support hub",
},
{
to: "https://docs.webstudio.is",
target: "_blank",
prefix: <ContentIcon />,
children: "Docs",
},
{
to: "https://wstd.us/community",
target: "_blank",
prefix: <DiscordIcon />,
children: "Community",
},
]}
/>
</CollapsibleSection>
</nav>
</Flex>
<Main>
Expand Down
20 changes: 1 addition & 19 deletions packages/icons/icons/content.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions packages/icons/icons/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/icons/icons/extension.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 9 additions & 36 deletions packages/icons/icons/life-buoy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions packages/icons/icons/vimeo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions packages/icons/icons/youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 872394b

Please sign in to comment.